amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

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

Open MichaelPlan opened this issue 2 years ago • 33 comments

Before opening, please confirm:

  • [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • [X] I have searched for duplicate or closed issues.
  • [X] I have read the guide for submitting bug reports.
  • [X] 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

MichaelPlan avatar Jan 10 '22 21:01 MichaelPlan

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

mkpratt avatar Jan 11 '22 19:01 mkpratt

Hey @MichaelPlan :wave: 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 avatar Jan 11 '22 21:01 josefaidt

@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?

MichaelPlan avatar Jan 18 '22 16:01 MichaelPlan

Did you previously override cloudformation configuration directly?

johnpc avatar Jan 18 '22 20:01 johnpc

Hey @MichaelPlan :wave: 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 avatar Feb 01 '22 17:02 josefaidt

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 🙂

josefaidt avatar Feb 15 '22 22:02 josefaidt

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.

LucasKnudsen avatar Feb 23 '22 07:02 LucasKnudsen

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 avatar Mar 02 '22 21:03 josefaidt

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!

OlgaMaslova avatar Jun 02 '22 14:06 OlgaMaslova

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.

mstoyanovv avatar Jun 10 '22 12:06 mstoyanovv

Also experiencing this bug on pushes for functions. Edit: I'm on amplify CLI version 8.5.0

behaviary avatar Jun 15 '22 00:06 behaviary

From the comments, I found that the amplify push api, amplify push function, and other Backend-only functions have similar errors.

I was able to get around the error and update Backend with amplify push.

I hope this obstacle will be remedied.

amplify -v 9.0.0

s-ueno avatar Jun 22 '22 14:06 s-ueno

I am also still finding the same issue when running amplify push function in version 9.1.0

I tried deleting the amplify directory and pulling a fresh copy using amplify pull --appId <appId> but still found the issue persisted when I changed the lambda function runtime code and tried to push.

For now I am also able to use the workaround of just pushing everything with amplify push, but this does take significantly longer.

@josefaidt - Please could this issue be investigated further/reopened?

dwil618 avatar Jul 15 '22 14:07 dwil618

Hey @dwil618 and folks in the thread :wave: thank you for bringing this to our attention! I was able to successfully reproduce this with version 9.1.0 using amplify push function in an existing Amplify app, receiving:

UPDATE_FAILED      api9966            AWS::CloudFormation::Stack Wed Jul 20 2022 10:20:43 GMT-0500 (Central Daylight Time) Parameters: [unauthRoleName, authRoleName] must have values

Re-opening and marking as a regression

josefaidt avatar Jul 20 '22 15:07 josefaidt

I'm also stuck with this error. amplify -v 9.2.0

alanblake avatar Aug 04 '22 05:08 alanblake

I'm also stuck with this error. amplify -v 9.2.0

I managed to get past this by doing an amplify pull and then amplify push

alanblake avatar Aug 04 '22 06:08 alanblake

Seeing this error when I tried to push a schema change from IDE

Fails when I edit schema on Amplify Studio and try to deploy the changes as well

Fails CI/CD builds

all of this happened after I’ve added and deployed a post confirmation trigger from the AWS console. Removing the trigger didn’t seem to help

Not able to get past this issue with amplify push either

I’m stuck

avinashrgudipati avatar Aug 07 '22 02:08 avinashrgudipati

this error is also occurring after amplify add geo amplify push

Parameters: [unauthRoleName] must have values

i've tried a thousand different methods and suggestions to get it working, but no go.

evan1715 avatar Aug 09 '22 22:08 evan1715

9.2.0 - same here. can amplify push but not amplify function push

CodySwannGT avatar Aug 10 '22 02:08 CodySwannGT

@dwil618

significantly longer

The reason it's failing on other services when calling amplify push <category> is because it always does a full push. The only thing specifying the category does; to my understanding, is filter the update table at the start so you only see what matters to you for that push since that list can become quite large.

However if you want to speed things up a bit, you can add --yes after your pull/push to not pause on that table and have to hit enter.

theZ3r0CooL avatar Aug 22 '22 01:08 theZ3r0CooL

Hi all, so far I'm unable to repro this using v 9.2.1 of the CLI. Is anyone still having this issue on that version?

edwardfoyle avatar Aug 23 '22 18:08 edwardfoyle

Still an issue for me with CLI 9.2.1

Amplify push (with or without category part) and deployments fail with same errors

avinashrgudipati avatar Aug 23 '22 19:08 avinashrgudipati

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.

MaximeIJ avatar Aug 28 '22 05:08 MaximeIJ

Seeing the issue as well.

miquelvir avatar Aug 30 '22 18:08 miquelvir

@edwardfoyle yes, I'm at 9.2.1.

jbreemhaar avatar Sep 01 '22 14:09 jbreemhaar

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

javabudd avatar Sep 03 '22 20:09 javabudd

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

bordernone avatar Sep 10 '22 16:09 bordernone

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

avinashrgudipati avatar Sep 19 '22 18:09 avinashrgudipati

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.

bordernone avatar Sep 20 '22 14:09 bordernone

@bordernone

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

avinashrgudipati avatar Sep 20 '22 15:09 avinashrgudipati