Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters: [unauthRoleName, authRoleName] must have values on amplify push function #9484

Closed
4 tasks done
MichaelPlan opened this issue Jan 10, 2022 · 47 comments · Fixed by #10035
Closed
4 tasks done
Labels
api-graphql Issues related to GraphQL resources in the API category bug Something isn't working functions Issues tied to the functions category ops-deploy Operational theme: push and deployment p1 platform Issues tied to the general CLI platform regression Flair label to track regressions

Comments

@MichaelPlan
Copy link

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v14.18.2

Amplify CLI Version

7.6.7

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

Amplify Categories

function

Amplify Commands

add, push

Describe the bug

It's not possible to push a new lambda function with CLI.

UPDATE_FAILED api AWS::CloudFormation::Stack Mon Jan 10 2022 22:32:05 GMT+0100 (Central European Standard Time) Parameters: [unauthRoleName, authRoleName] must have values
CREATE_FAILED functiontest AWS::CloudFormation::Stack Mon Jan 10 2022 22:32:06 GMT+0100 (Central European Standard Time) Resource creation cancelled
UPDATE_FAILED AuthTriggerCustomLambdaStack AWS::CloudFormation::Stack Mon Jan 10 2022 22:32:06 GMT+0100 (Central European Standard Time) Resource update cancelled

Expected behavior

UPDATE_COMPLETE

Reproduction steps

  1. amplify add function
  2. choose Lambda function
  3. function name => test
  4. runtime => NodeJS
  5. function Template => Hello world
  6. advanced settings => No
  7. amplify push function test
  8. " Function │ test │ Create │ awscloudformation"
  9. continue => Y
  10. [unauthRoleName, authRoleName] must have values

GraphQL schema(s)

# Put schemas below this line

Log output

# Put your logs below this line


Additional information

No response

@mkpratt
Copy link

mkpratt commented Jan 11, 2022

I also have been dealing with this exact same issue. Fails with this same error on a few existing and unchanged REST APIs when trying to push a minor update on the GraphQL API
Parameters: [authRoleName, unauthRoleName] must have values

Amplify CLI Version 7.6.8

@josefaidt
Copy link
Contributor

Hey @MichaelPlan 👋 thanks for raising this! From the CloudFormation lines you posted I noticed this is failing for your API, is this a REST API by chance?

UPDATE_FAILED api AWS::CloudFormation::Stack Mon Jan 10 2022 22:32:05 GMT+0100 (Central European Standard Time) Parameters: [unauthRoleName, authRoleName] must have values

If so, was this project recently migrated from using an older version of the CLI?

@josefaidt josefaidt added the pending-triage Issue is pending triage label Jan 11, 2022
@josefaidt josefaidt self-assigned this Jan 11, 2022
@josefaidt josefaidt added the pending-response Issue is pending response from the issue author label Jan 11, 2022
@MichaelPlan
Copy link
Author

@josefaidt yes, the project was recently migrated. The only solution to fix it was to create a complete new project. But after some days working with the new version, I'm now getting this for hours:

A deployment is in progress.
If the prior rollback was aborted, run:
"amplify push --iterative-rollback" to rollback the prior deployment
"amplify push --force" to re-deploy

when try to push anything.

I pulled everything again and made some small changes, but nothing works anymore.
With "amplify push --iterative-rollback" I 'm getting ": ["Index: 1 State: {"preRollback":"previousDeploymentReadyCheck"} Message: Resource is not in the state stackUpdateComplete"]":

In amplify studio I can see "Deployment completed".

Do you have any solution for the problem? Is it possible to abort a deployment?

@johnpc
Copy link
Contributor

johnpc commented Jan 18, 2022

Did you previously override cloudformation configuration directly?

@josefaidt
Copy link
Contributor

Hey @MichaelPlan 👋 to mitigate the parameters issue we should be able to safely remove those parameters, though ideally this should have been done for us. For the deployment issue, if you visit the CloudFormation console do you see a deployment in progress by chance?

@josefaidt
Copy link
Contributor

Closing due to inactivity. @MichaelPlan if you are still experiencing this issue please reply back to this thread and we can re-open to investigate further 🙂

@LucasKnudsen
Copy link

Hey, I'm having similar issues.

I am on version 7.6.21 and migrated to Transformer v2.

amplify push work fine, but amplify function push and amplify function push locationGeocoder throws the following error:

UPDATE_FAILED      apicondominium                       AWS::CloudFormation::Stack Wed Feb 23 2022 08:26:08 GMT+0100 (Central European Standard Time) Parameters: [unauthRoleName, authRoleName] must have values

This is from a newly redeployed Stack as well.

The only place I'm using these values as parameters is within the Geo resource, which was generated by Amplify.

@josefaidt josefaidt reopened this Mar 2, 2022
@josefaidt
Copy link
Contributor

Hey @LucasKnudsen apologies for the delay! I was able to successfully reproduce this with the following steps on the latest version of the Amplify CLI (7.6.22):

  1. create a new project with amplify init -y
  2. add a GraphQL API with amplify add api, choose IAM as an auth mode
    a. in my reproduction, I chose Cognito as the default auth mode and IAM as an additional auth mode
  3. push with amplify push -y
  4. add a function with amplify add function
  5. attempt to push just the new function with amplify push function <my-function-name> or amplify push function
  6. observe error

Marking as a bug 🙂

@josefaidt josefaidt removed their assignment Mar 2, 2022
@josefaidt josefaidt added api-graphql Issues related to GraphQL resources in the API category bug Something isn't working functions Issues tied to the functions category platform Issues tied to the general CLI platform and removed pending-response Issue is pending response from the issue author pending-triage Issue is pending triage labels Mar 2, 2022
@josefaidt josefaidt changed the title Parameters: [unauthRoleName, authRoleName] must have values Parameters: [unauthRoleName, authRoleName] must have values on amplify push function Mar 2, 2022
@josefaidt josefaidt linked a pull request Apr 5, 2022 that will close this issue
5 tasks
@OlgaMaslova
Copy link

Hello,

I am experiencing the same bug when trying to push only function. I have the latest version of amplify (8.3.1). Any ideas?

Thanks!

@mstoyanovv
Copy link

Hello,

I am experiencing the same bug when trying to push only function. I have the latest version of amplify (8.3.1). Any ideas?

Thanks!

It happens to me too but in my case I recreated the table that was linked to a given function. After that amplify function push started throwing those errors. Relinking the function to the table by amplify function update might solve it.

@MaximeIJ
Copy link

MaximeIJ commented Aug 28, 2022

Same, seeing this in CI/CD builds of a custom function. The logs say they patched the CLI to v 9.2.1:
Done patching NPM package '@aws-amplify/cli' to version 9.2.1

I'm not seeing the issue from local amplify push though

Edit 2 days later: the issue disappeared for me as mysteriously as it appeared.

@miquelvir
Copy link

Seeing the issue as well.

@jbreemhaar
Copy link

@edwardfoyle yes, I'm at 9.2.1.

@javabudd
Copy link

javabudd commented Sep 3, 2022

seeing the issue as well, amplify push leads to an error in both the UI and CLI (9.2.1):

AWS::CloudFormation::Stack Sat Sep 03 2022 14:04:58 GMT-0600 (Mountain Daylight Time) Parameters: [unauthRoleName] must have values

@bordernone
Copy link

Had a similar issue. Here's my solution https://stackoverflow.com/a/73673509/11135757

@avinashrgudipati
Copy link

Had a similar issue. Here's my solution https://stackoverflow.com/a/73673509/11135757

It was a nightmare but I did the above and didn’t help me. On CI/CD it specifically says unAuthUserRole issue but on the react app it now says Resource not in StackUpdateComplete. Previously the above was followed by unAuthRole error

@bordernone
Copy link

Had a similar issue. Here's my solution https://stackoverflow.com/a/73673509/11135757

It was a nightmare but I did the above and didn’t help me. On CI/CD it specifically says unAuthUserRole issue but on the react app it now says Resource not in StackUpdateComplete. Previously the above was followed by unAuthRole error

Check if you see the identity pool linked in your "Authentication" section in Amplify Studio. Additionally, you can add StackUpdateComplete to your auth profile.

@avinashrgudipati
Copy link

@bordernone

I have a cognitive userpool linked. Any idea how I can add the stackUpdateComplete to the auth profile. Thank you for the response

@bordernone
Copy link

@bordernone

I have a cognitive userpool linked. Any idea how I can add the stackUpdateComplete to the auth profile. Thank you for the response

My question is does it show that you have an identity pool attached as well? This was the reason I was getting the error. I also had user pool linked but no identity pool was linked to it

@avinashrgudipati
Copy link

Sorry about that. I do not have any identity pool attached. Any steps to attach that would be really appreciated

@bordernone
Copy link

Sorry about that. I do not have any identity pool attached. Any steps to attach that would be really appreciated

It's actually in that StackOverflow answer I linked above. I will update the answer with more details.

@avinashrgudipati
Copy link

Any update on this? Stuck and I can’t delete any db items from client because I can’t update API

@bordernone did you have a lambda function in your setup?

@bordernone
Copy link

Any update on this? Stuck and I can’t delete any db items from client because I can’t update API

@bordernone did you have a lambda function in your setup?

This might help: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-integrating-user-pools-with-identity-pools.html

Nope I didn't

@avinashrgudipati
Copy link

avinashrgudipati commented Sep 25, 2022

Any update on this? Stuck and I can’t delete any db items from client because I can’t update API
@bordernone did you have a lambda function in your setup?

This might help: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-integrating-user-pools-with-identity-pools.html

Nope I didn't

That might be the difference. The issue started happening when I added the function as the OP reported. I will try creating a completely new project without lambda function and try migrating the database

But will try your suggestion again. Thank you kindly for the link @bordernone

@javabudd
Copy link

javabudd commented Oct 2, 2022

experiencing the same bug when attempting to push a new environment importing a cognito user pool...

Deployment failed.
Deploying root stack gtart [ =============--------------------------- ] 1/3
        amplify-gtart-staging-142557   AWS::CloudFormation::Stack     UPDATE_ROLLBACK_COMPLETE       Sun Oct 02 2022 14:28:59…
        apigtart                       AWS::CloudFormation::Stack     CREATE_FAILED                  Sun Oct 02 2022 14:28:30…
Deployed api gtart [ ======================================== ] 12/12

🛑 The following resources failed to deploy:
🛑 An error occurred during the push operation: /
Resource is not in the state stackUpdateComplete
Parameters: [unauthRoleName] must have values

@avinashrgudipati
Copy link

I don’t want to jinx my self but I got past this. Unfortunately the solution isn’t pretty.

@javabudd how did you create auth?

@javabudd
Copy link

javabudd commented Oct 2, 2022

I don’t want to jinx my self but I got past this. Unfortunately the solution isn’t pretty.

@javabudd how did you create auth?

I used the UI to attach an existing user pool, if I remove the auth and try again it works.

@lazpavel
Copy link
Contributor

lazpavel commented Nov 23, 2022

No longer reproducible with v.10.5.1. PR fix: #10848

@Abhishek-cmd13
Copy link

This issue is not been solved yet.

@Arnav7501
Copy link

issue is still there

@Arnav7501
Copy link

@javabudd how did you remove the auth?

@avinashrgudipati
Copy link

avinashrgudipati commented Feb 6, 2023 via email

@Arnav7501
Copy link

yeah you're right a new environment fixed it... unfortunately my app is in production and the new environment doesn't keep the logins so that is an extremely unfortunate bug. I appreciate your help though.

@josefaidt
Copy link
Contributor

Hey folks 👋 if you are experiencing this error when attempting to push updates to your Amplify project using the latest version of the CLI (10.7.2 at the time of writing), please file a separate bug report

@kuoaid
Copy link

kuoaid commented Nov 4, 2024

same issue on Amplify push (all). Using the latest CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-graphql Issues related to GraphQL resources in the API category bug Something isn't working functions Issues tied to the functions category ops-deploy Operational theme: push and deployment p1 platform Issues tied to the general CLI platform regression Flair label to track regressions
Projects
None yet
Development

Successfully merging a pull request may close this issue.