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

UPDATE_FAILED error: api [unauthRoleName, authRoleName] do not exist in the template

Open bokuweb opened this issue 7 years ago • 47 comments

Note: If your question is regarding the AWS Amplify Console service, please log it in the official AWS Amplify Console forum

** Which Category is your question related to? **

amplify-cli

** What AWS Services are you utilizing? **

dyamo, appsync, s3, cognito

** Provide additional details e.g. code snippets **

I upgraded amplify-cli3.0.0 to 3.11.0 after executing amplify api update. However I ran into folowing error.

UPDATE_FAILED               api              AWS::CloudFormation::Stack Tue Oct 08 2019 15:23:16 GMT+0900 (Japan Standard Time) Parameters: [unauthRoleName, authRoleName] do not exist in the template

I failed to publish, what should I do solve this problem? I exec following command on circleCI

amplify init --amplify "{\"envName\":\"staging\"}" --yes
amplify publish --invalidateCloudFront --yes

bokuweb avatar Oct 08 '19 06:10 bokuweb

I added "AuthRoleName" and "UnauthRoleName" to customResources.json and parameters.json for now.

bokuweb avatar Oct 08 '19 08:10 bokuweb

Umm, this issue is not solved by above workaround..

bokuweb avatar Oct 08 '19 09:10 bokuweb

any updates? I did pull --restore today, changed minor thing in graphql then pushed and it failed with this problem. I changed nothing and it fails now, it must be some internal change to amplify/appsync. Can someone look at it?

rb365 avatar Oct 09 '19 20:10 rb365

I added this to parameters.json and it stopped failing: "authRoleName": { "Ref": "AuthRoleName" }, "unauthRoleName": { "Ref": "UnauthRoleName" }

still testing to see if there are any issues with that

rb365 avatar Oct 09 '19 21:10 rb365

it succeeded the first time but now I did another update completely unrelated to API and push fails with same error

rb365 avatar Oct 09 '19 22:10 rb365

same issue here. In the build settings of the amplify console, I specified a package version override to 3.10.0 and my builds are working again.

ricksmit3000 avatar Oct 10 '19 13:10 ricksmit3000

Deleting the build folder inside: backend / api / api_name/ and running: amplify api gql-compile before pushing solved the issue for me.

bastianbb avatar Oct 11 '19 12:10 bastianbb

It was too good to be true. I upgraded from 3.0.0 and landed on 3.11.0 after having upgraded to 3.14.0 but hit by #2550 — I'm using Amplify Console to deploy to production solely and development, but for development I also push manually sometimes.

I had a few successful deployments and suddenly started getting this error also. Tried the solution by @bastianbb in https://github.com/aws-amplify/amplify-cli/issues/2519#issuecomment-540580276 without result. No solution for the CLI besides downgrading to 3.10.0 it seems? I will now try pushing with 3.11.0 in the CLI and see if that fixes Console deployments.

houmark avatar Oct 13 '19 08:10 houmark

Same problem here, with 3.14.0. When I added storage and then try to push, the following error occurs and the push is aborted:

Parameters: [unauthRoleName, authRoleName, additionalQuestions] do not exist in the template

fsommers avatar Oct 13 '19 15:10 fsommers

When I added the above-referenced fields back manually to the respective config files, the amplify push finally succeeded. That was my "fix"

fsommers avatar Oct 13 '19 17:10 fsommers

All these seems to be temporary fixes which may fix push once or twice, but it will eventually fail later on, especially when doing deployment with Amplify Console.

@UnleashedMind please advice what is either a permanent manually fix/workaround or if we can expect a new release that fixes this soon?

houmark avatar Oct 15 '19 00:10 houmark

I am having same problem for the past week, using amplify CLI version 3.9.0. Problem has happened both with amplify CLI push and also with amplify console deployment. Should I try 3.10.0?

I also see the message "Could not read cloudformation template at path: C:\xxxxx\fa-console\amplify\backend\api\facilitiesconsole\build\cloudformation-template.json". This file does not exist. Is it supposed to exist? When should it be created?

Could not read cloudformation template at path: C:\xxxxx\fa-console\amplify\backend\api\facilitiesconsole\build\cloudformation-template.json
- Updating resources in the cloud. This may take a few minutes...

UPDATE_IN_PROGRESS facilitiesconsole-dev-20190904015757 AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:18 GMT-0400 (Eastern Daylight Time) User Initiated
UPDATE_IN_PROGRESS authfacilitiesconsole934f5027        AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:22 GMT-0400 (Eastern Daylight Time)
UPDATE_IN_PROGRESS storagefaservicedynamo               AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:22 GMT-0400 (Eastern Daylight Time)
UPDATE_COMPLETE    storagefaservicedynamo               AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:23 GMT-0400 (Eastern Daylight Time)
UPDATE_COMPLETE    authfacilitiesconsole934f5027        AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:23 GMT-0400 (Eastern Daylight Time)
\ Updating resources in the cloud. This may take a few minutes...

UPDATE_IN_PROGRESS          apifacilitiesconsole                 AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:25 GMT-0400 (Eastern Daylight Time)                                                                                           
UPDATE_IN_PROGRESS          functionfaservicelambda              AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:25 GMT-0400 (Eastern Daylight Time)                                                                                           
UPDATE_FAILED               apifacilitiesconsole                 AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:26 GMT-0400 (Eastern Daylight Time) Parameters: [unauthRoleName, authRoleName] do not exist in the template                   
UPDATE_FAILED               functionfaservicelambda              AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:26 GMT-0400 (Eastern Daylight Time) Resource update cancelled                                                                 

update: I tried amplify cli 3.10.0, then amplify init and amplify push and it failed in the same way. update: Same with 3.15.0, same failure.

mrducky4 avatar Oct 17 '19 00:10 mrducky4

@mrducky4 A few questions

  • What was the update flow that was done?
  • Is this a graphql api?
  • Was IAM auth being used in the schema?

SwaySway avatar Oct 17 '19 02:10 SwaySway

I am having same problem for the past week, using amplify CLI version 3.9.0. Problem has happened both with amplify CLI push and also with amplify console deployment. Should I try 3.10.0?

I also see the message "Could not read cloudformation template at path: C:\xxxxx\fa-console\amplify\backend\api\facilitiesconsole\build\cloudformation-template.json". This file does not exist. Is it supposed to exist? When should it be created?

Could not read cloudformation template at path: C:\xxxxx\fa-console\amplify\backend\api\facilitiesconsole\build\cloudformation-template.json
- Updating resources in the cloud. This may take a few minutes...

UPDATE_IN_PROGRESS facilitiesconsole-dev-20190904015757 AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:18 GMT-0400 (Eastern Daylight Time) User Initiated
UPDATE_IN_PROGRESS authfacilitiesconsole934f5027        AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:22 GMT-0400 (Eastern Daylight Time)
UPDATE_IN_PROGRESS storagefaservicedynamo               AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:22 GMT-0400 (Eastern Daylight Time)
UPDATE_COMPLETE    storagefaservicedynamo               AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:23 GMT-0400 (Eastern Daylight Time)
UPDATE_COMPLETE    authfacilitiesconsole934f5027        AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:23 GMT-0400 (Eastern Daylight Time)
\ Updating resources in the cloud. This may take a few minutes...

UPDATE_IN_PROGRESS          apifacilitiesconsole                 AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:25 GMT-0400 (Eastern Daylight Time)                                                                                           
UPDATE_IN_PROGRESS          functionfaservicelambda              AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:25 GMT-0400 (Eastern Daylight Time)                                                                                           
UPDATE_FAILED               apifacilitiesconsole                 AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:26 GMT-0400 (Eastern Daylight Time) Parameters: [unauthRoleName, authRoleName] do not exist in the template                   
UPDATE_FAILED               functionfaservicelambda              AWS::CloudFormation::Stack Wed Oct 16 2019 19:45:26 GMT-0400 (Eastern Daylight Time) Resource update cancelled                                                                 

update: I tried amplify cli 3.10.0, then amplify init and amplify push and it failed in the same way. update: Same with 3.15.0, same failure.

@mrducky4 look at my previous comment. My problem was the same, no CF template in the build folder.

bastianbb avatar Oct 17 '19 08:10 bastianbb

@SwaySway I'll answer the best I can.

  • What was the update flow that was done? I don't really know what was relevant. I have been switching back and forth between a test branch and a dev branch, and switching the corresponding amplify environments between test and dev. The thing I'm working on is a lambda function (functionfaservicelambda) for a REST API (facilitiesservice) added with amplify. But I'm just changing the .js source code, not trying to make changes with amplify api update or anything like that. amplify status shows this:
| Category | Resource name             | Operation | Provider plugin   |
| -------- | ------------------------- | --------- | ----------------- |
| Function | faservicelambda           | Update    | awscloudformation |
| Auth     | facilitiesconsole934f5027 | No Change | awscloudformation |
| Api      | facilitiesconsole         | No Change | awscloudformation |
| Api      | facilitiesservice         | No Change | awscloudformation |
| Storage  | faservicedynamo           | No Change | awscloudformation |
  • Is this a graphql api? facilitesconsole is a graphql API. facilitiesservice is a REST API.

  • Was IAM auth being used in the schema? I don't think so, but I'm new to all this so I'm not completely sure. I am using a Cognito user pool, and using @auth in the graphql schema. I know the graphql API authorization has been working properly based on the Cognito user login, with a custom tenantID field associated with the cognito user, and also in some cases based on which cognito group the user is a member of. So my understanding is all this is using Cognito and not using IAM.

mrducky4 avatar Oct 17 '19 11:10 mrducky4

@bastianbb thank you for the suggestion. I did amplify api gql-compile, and it created the cloudformation-template.json file that was missing before. Then during amplify push I get different errors now.

UPDATE_IN_PROGRESS facilitiesconsole-dev-20190904015757 AWS::CloudFormation::Stack Thu Oct 17 2019 07:10:55 GMT-0400 (Eastern Daylight Time) User Initiated
UPDATE_IN_PROGRESS storagefaservicedynamo               AWS::CloudFormation::Stack Thu Oct 17 2019 07:10:59 GMT-0400 (Eastern Daylight Time)
UPDATE_IN_PROGRESS authfacilitiesconsole934f5027        AWS::CloudFormation::Stack Thu Oct 17 2019 07:10:59 GMT-0400 (Eastern Daylight Time)
UPDATE_COMPLETE    storagefaservicedynamo               AWS::CloudFormation::Stack Thu Oct 17 2019 07:10:59 GMT-0400 (Eastern Daylight Time)
UPDATE_FAILED      authfacilitiesconsole934f5027        AWS::CloudFormation::Stack Thu Oct 17 2019 07:11:00 GMT-0400 (Eastern Daylight Time) Parameters: [hostedUI, thirdPartyAuth] must have values

Those parameters hostedUI and thirdPartyAuth are things that did change recently in some files managed by amplify as I was trying different things to work around the push problem. When I tried something that didn't work, I then tried to revert all the changes to get back to the original state with original problem. Maybe I missed reverting something. I don't have a good understanding of the overall amplify workflow, every time I do anything it breaks the deployment process, so I may open a separate issue to ask about that.

Update: In my whole project, there was no mention of the terms hostedUI or thirdPartyAuth in any .yml or .json file. So I don't understand why amplify (or cloudformation?) was saying the must have values, because as far as I can tell they didn't exist at all. Could it be related to something that was (partially) deployed in the cloud during a previous attempt at amplify push?

I upgraded (again) to amplify version 3.15.0. Then I did amplify init and then amplify auth update. I didn't really want to update anything, so I answered the questions the same as before, trying not to make any changes. But things did change, such as adding hostedUI and thirdPartyAuth elements into the auth parameters.json and xxx-cloudformation-template.yml files. Then amplify push finally succeeded.

Later on I will open a separate issue with questions about amplify workflow for multiple environments and multiple development machines.

mrducky4 avatar Oct 17 '19 11:10 mrducky4

i tried to push a new update over the newest CLI: 3.15

Get this error: UPDATE_FAILED authaivyusers AWS::CloudFormation::Stack Thu Oct 24 2019 20:08:16 GMT+0200 (GMT+02:00) Parameters: [unauthRoleName, allowUnauthenticatedIdentities, thirdPartyAuth, mfaLambdaLogPolicy, openIdLambdaRoleName, policyName, userpoolClientName, mfaLambdaIAMPolicy, mfaPassRolePolicy, authRoleName, PostConfirmation, roleName, userpoolClientLogPolicy, identityPoolName, userpoolClientLambdaPolicy, mfaLambdaRole] do not exist in the template

So tried: amplify update auth.

Than i get this error: Bildschirmfoto 2019-10-24 um 20 05 45

So at the moment i cant push.

i just updated a function.

So i did an --restore, but the same error

So i tried again update auth with some other settings: Bildschirmfoto 2019-10-24 um 21 19 53

Create a new ENV and push my Production env is working, so maybe this is a problem in my cloudFormation?

davidbiller avatar Oct 24 '19 17:10 davidbiller

Is there any progress here? Or Workarounds? So i have this in my develop, i could create a new ENV, but i dont know if i merge my project to production, that i have the same problem again with production env. Would be bad.

davidbiller avatar Oct 28 '19 12:10 davidbiller

@davidbiller So have you fixed the no values error? And you're stuck with the API Key error? This error comes in when you have an expired API Key. You can follow these steps - https://github.com/aws-amplify/amplify-cli/issues/242#issuecomment-546733822 to update your API Key.

kaustavghosh06 avatar Oct 28 '19 20:10 kaustavghosh06

@davidbiller So have you fixed the no values error? And you're stuck with the API Key error? This error comes in when you have an expired API Key. You can follow these steps - #242 (comment) to update your API Key.

@kaustavghosh06

Hey. Ja, but i cant deploy. "APIKeyExpirationEpoch": "-1", is there since the first day, 1 year ago :)

But still get this error.

davidbiller avatar Oct 28 '19 20:10 davidbiller