aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 819 forks source link

[secretsPathAmplifyAppId] must have values error on 2nd or later deployments #10764

Open benjeater opened 2 years ago

benjeater commented 2 years ago

Before opening, please confirm:

How did you install the Amplify CLI?

npm

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

v16.13.0

Amplify CLI Version

9.1.0

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

hosting

Amplify Commands

Not applicable

Describe the bug

I am using CI/CD connected to my GitHub repo. I have one of my branches (dev) connected and the deployment is working correctly every time.

I have connected a second branch (demo) and the initial creation and deployment worked correctly.

I then did a merge to the demo branch from the dev branch. The build phase failed with the error

[secretsPathAmplifyAppId] must have values

I have manually checked the following from the initial deployment of the demo branch:

I have checked for original issues regarding this issue and I have found #8513 and #9667, but these both seem to be on the first deploy, whereas this problem when using CI/CD appears to happen only on subsequent deployments.

Expected behavior

Projects using CI/CD hosting should deploy more than once.

Reproduction steps

  1. Create a project using CI/CD hosting
  2. Connect the project to the GitHub repo
  3. Connect a second branch in the GitHub repo to another hosting env
  4. Wait for initial deployment to complete
  5. Make any change to the second branch in the GitHub repo
  6. See the error [secretsPathAmplifyAppId] must have values in build log

GraphQL schema(s)

Not applicable

Project Identifier

Project Identifier: 0a2c62eccf8d3ac5d53ed152c8cb193b

Log output

``` 2022-07-15T07:17:05.518Z [INFO]: # Cloning repository: git@github.com:benjeater/melcaas.git 2022-07-15T07:17:09.968Z [INFO]: Cloning into 'melcaas'... 2022-07-15T07:17:10.078Z [INFO]: # Switching to commit: 038dccf4c0d7832f0f4f21313ea04f15224a4cbc 2022-07-15T07:17:10.348Z [INFO]: Note: switching to '038dccf4c0d7832f0f4f21313ea04f15224a4cbc'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 038dccf Test 2022-07-15T07:17:10.397Z [INFO]: Successfully cleaned up Git credentials 2022-07-15T07:17:10.398Z [INFO]: # Checking for Git submodules at: /codebuild/output/src771248605/src/melcaas/.gitmodules 2022-07-15T07:17:10.430Z [INFO]: # Retrieving environment cache... 2022-07-15T07:17:10.861Z [INFO]: # Retrieved environment cache 2022-07-15T07:17:10.861Z [INFO]: ---- Setting Up SSM Secrets ---- 2022-07-15T07:17:10.861Z [INFO]: SSM params {"Path":"/amplify/doocypzu2klhi/newenv/","WithDecryption":true} 2022-07-15T07:17:20.116Z [INFO]: # Patching NPM package '@aws-amplify/cli' from 7.6.14 to 9.1.0... 2022-07-15T07:17:20.906Z [INFO]: # Patching NPM package '@aws-amplify/cli' from 7.6.14 to 9.1.0... 2022-07-15T07:18:45.959Z [INFO]: # Done patching NPM package '@aws-amplify/cli' to version 9.1.0 2022-07-15T07:18:53.108Z [INFO]: # Done patching NPM package '@aws-amplify/cli' to version 9.1.0 2022-07-15T07:18:53.189Z [INFO]: # Retrieving cache... 2022-07-15T07:18:57.408Z [INFO]: # Extracting cache... 2022-07-15T07:19:02.654Z [INFO]: # Extraction completed 2022-07-15T07:19:06.085Z [INFO]: ## Starting Backend Build # Starting phase: build 2022-07-15T07:19:08.030Z [INFO]: Amplify AppID found: doocypzu2klhi. Amplify App name is: melcaas 2022-07-15T07:19:08.071Z [INFO]: Backend environment newenv found in Amplify Console app: melcaas 2022-07-15T07:19:09.683Z [WARNING]: - Fetching updates to backend environment: newenv from the cloud. 2022-07-15T07:19:11.361Z [INFO]: Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category 2022-07-15T07:19:11.361Z [INFO]: Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category 2022-07-15T07:19:11.361Z [WARNING]: - Building resource auth/melcaasAuth 2022-07-15T07:19:11.475Z [WARNING]: - Building resource api/melcaasGraphQLAPI 2022-07-15T07:19:13.605Z [INFO]: ✅ GraphQL schema compiled successfully. Edit your schema at /codebuild/output/src771248605/src/melcaas/amplify/backend/api/melcaasGraphQLAPI/schema.graphql or place .graphql files in a directory at /codebuild/output/src771248605/src/melcaas/amplify/backend/api/melcaasGraphQLAPI/schema 2022-07-15T07:19:13.607Z [INFO]: Overrides functionality is not implemented for this category 2022-07-15T07:19:13.607Z [WARNING]: - Building resource storage/melcaasStorage 2022-07-15T07:19:13.644Z [WARNING]: - Building resource custom/melcaasErrorNotification 2022-07-15T07:19:13.645Z [WARNING]: - Building custom resources 2022-07-15T07:19:25.495Z [WARNING]: ✔ Successfully pulled backend environment newenv from the cloud. 2022-07-15T07:19:25.791Z [INFO]: ✅ 2022-07-15T07:19:28.125Z [INFO]: Note: It is recommended to run this command from the root of your app directory 2022-07-15T07:19:28.965Z [WARNING]: - Initializing your environment: newenv 2022-07-15T07:19:30.487Z [INFO]: Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category 2022-07-15T07:19:30.487Z [INFO]: Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category 2022-07-15T07:19:30.487Z [WARNING]: - Building resource auth/melcaasAuth 2022-07-15T07:19:30.626Z [WARNING]: - Building resource api/melcaasGraphQLAPI 2022-07-15T07:19:33.000Z [INFO]: ✅ GraphQL schema compiled successfully. Edit your schema at /codebuild/output/src771248605/src/melcaas/amplify/backend/api/melcaasGraphQLAPI/schema.graphql or place .graphql files in a directory at /codebuild/output/src771248605/src/melcaas/amplify/backend/api/melcaasGraphQLAPI/schema 2022-07-15T07:19:33.001Z [INFO]: Overrides functionality is not implemented for this category 2022-07-15T07:19:33.002Z [WARNING]: - Building resource storage/melcaasStorage 2022-07-15T07:19:33.036Z [WARNING]: - Building resource custom/melcaasErrorNotification 2022-07-15T07:19:33.037Z [WARNING]: - Building custom resources 2022-07-15T07:19:38.739Z [WARNING]: ✔ Initialized provider successfully. 2022-07-15T07:21:05.972Z [WARNING]: - Uploading files... 2022-07-15T07:21:06.602Z [WARNING]: - Uploading files... 2022-07-15T07:21:06.726Z [WARNING]: - Uploading files... 2022-07-15T07:21:07.550Z [WARNING]: - Uploading files... 2022-07-15T07:21:08.733Z [WARNING]: - Uploading files... 2022-07-15T07:21:09.016Z [WARNING]: - Uploading files... 2022-07-15T07:21:09.240Z [WARNING]: - Uploading files... 2022-07-15T07:21:09.740Z [WARNING]: - Uploading files... 2022-07-15T07:21:10.675Z [WARNING]: - Uploading files... 2022-07-15T07:21:16.015Z [WARNING]: - Uploading files... 2022-07-15T07:21:16.497Z [WARNING]: - Uploading files... 2022-07-15T07:21:17.889Z [WARNING]: - Uploading files... 2022-07-15T07:21:18.171Z [INFO]: Overrides functionality is not implemented for this category 2022-07-15T07:21:18.172Z [INFO]: Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category Overrides functionality is not implemented for this category 2022-07-15T07:21:18.172Z [WARNING]: - Building resource auth/melcaasAuth 2022-07-15T07:21:18.260Z [WARNING]: - Building resource api/melcaasGraphQLAPI 2022-07-15T07:21:20.327Z [INFO]: ✅ GraphQL schema compiled successfully. Edit your schema at /codebuild/output/src771248605/src/melcaas/amplify/backend/api/melcaasGraphQLAPI/schema.graphql or place .graphql files in a directory at /codebuild/output/src771248605/src/melcaas/amplify/backend/api/melcaasGraphQLAPI/schema 2022-07-15T07:21:20.329Z [WARNING]: - Building resource storage/melcaasStorage 2022-07-15T07:21:20.371Z [WARNING]: - Building resource custom/melcaasErrorNotification 2022-07-15T07:21:20.372Z [WARNING]: - Building custom resources 2022-07-15T07:21:25.325Z [WARNING]: - Uploading files... 2022-07-15T07:21:26.554Z [WARNING]: - Updating resources in the cloud. This may take a few minutes... 2022-07-15T07:21:32.953Z [INFO]: 2022-07-15T07:21:32.954Z [INFO]: UPDATE_IN_PROGRESS amplify-melcaas-newenv-65719 AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:27 GMT+0000 (Coordinated Universal Time) User Initiated 2022-07-15T07:21:37.896Z [INFO]: 2022-07-15T07:21:37.898Z [INFO]: UPDATE_IN_PROGRESS functionmelcaasAuthCustomMessage AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:33 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasAuthPostConfirmation AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:33 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS custommelcaasErrorNotification AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:33 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS authmelcaasAuth AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:33 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthCustomMessage AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:34 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthPostConfirmation AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:34 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE custommelcaasErrorNotification AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:34 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE authmelcaasAuth AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:34 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS apimelcaasGraphQLAPI AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:36 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:21:37.982Z [INFO]: 2022-07-15T07:21:37.983Z [INFO]: UPDATE_IN_PROGRESS amplify-melcaas-newenv-65719-apimelcaasGraphQLAPI-M9TTZWQXQ8PL AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:37 GMT+0000 (Coordinated Universal Time) User Initiated 2022-07-15T07:21:47.987Z [INFO]: 2022-07-15T07:21:47.988Z [INFO]: UPDATE_IN_PROGRESS FunctionDirectiveStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:45 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS Employee AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:45 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE FunctionDirectiveStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:45 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE Employee AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:46 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:21:52.995Z [INFO]: 2022-07-15T07:21:52.997Z [INFO]: UPDATE_IN_PROGRESS EmployeeGroupAllocation AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:48 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS NessusRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:48 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS OpenVASRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:48 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS Target AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:48 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS MeliusIssueRepresentation AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:48 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS EmployerGroup AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:48 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS HIBPRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:48 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS ScanStatistic AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:48 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS Employer AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE EmployeeGroupAllocation AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS User AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE NessusRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE OpenVASRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE Target AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE ScanStatistic AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE HIBPRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE EmployerGroup AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE Employer AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE User AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE MeliusIssueRepresentation AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:49 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS NMAPRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:51 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE NMAPRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:52 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS ConnectionStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:52 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:21:53.302Z [INFO]: 2022-07-15T07:21:53.302Z [INFO]: UPDATE_COMPLETE ConnectionStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:53 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:21:58.018Z [INFO]: 2022-07-15T07:21:58.019Z [INFO]: UPDATE_IN_PROGRESS CustomResourcesjson AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:55 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE CustomResourcesjson AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:56 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:22:03.013Z [INFO]: 2022-07-15T07:22:03.015Z [INFO]: UPDATE_COMPLETE_CLEANUP_IN_PROGRESS amplify-melcaas-newenv-65719-apimelcaasGraphQLAPI-M9TTZWQXQ8PL AWS::CloudFormation::Stack Fri Jul 15 2022 07:21:59 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:22:12.903Z [INFO]: 2022-07-15T07:22:12.904Z [INFO]: UPDATE_COMPLETE apimelcaasGraphQLAPI AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:11 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:22:17.912Z [INFO]: 2022-07-15T07:22:17.913Z [INFO]: UPDATE_IN_PROGRESS functionS3Triggere603b8f1 AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:13 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasCreateDailyStatistics AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:13 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasAuthPreTokenGeneration AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:13 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasInitialSetup AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:13 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasAuthPreSignup AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:13 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasDBStreamEmployer AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:13 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionS3Triggere603b8f1 AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:14 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthPreTokenGeneration AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:14 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasDBStreamEmployer AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:14 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasCreateDailyStatistics AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:14 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasInitialSetup AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:14 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthPreSignup AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:14 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS storagemelcaasStorage AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:16 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS AuthTriggerCustomLambdaStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:16 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE storagemelcaasStorage AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:17 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:22:17.983Z [INFO]: 2022-07-15T07:22:17.984Z [INFO]: UPDATE_IN_PROGRESS amplify-melcaas-newenv-65719-AuthTriggerCustomLambdaStack-BZY3UBSEFEPO AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:17 GMT+0000 (Coordinated Universal Time) User Initiated 2022-07-15T07:22:22.917Z [INFO]: 2022-07-15T07:22:22.918Z [INFO]: UPDATE_IN_PROGRESS functionmelcaasToolRunnerNMAP AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:19 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasToolRunnerOpenVAS AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:19 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasToolRunnerHIBP AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:19 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasToolRunnerNMAP AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:20 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasToolRunnerOpenVAS AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:20 GMT+0000 (Coordinated Universal Time) UPDATE_FAILED functionmelcaasToolRunnerHIBP AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:20 GMT+0000 (Coordinated Universal Time) Parameters: [secretsPathAmplifyAppId] must have values 2022-07-15T07:22:23.085Z [INFO]: 2022-07-15T07:22:23.085Z [INFO]: UPDATE_ROLLBACK_IN_PROGRESS amplify-melcaas-newenv-65719-AuthTriggerCustomLambdaStack-BZY3UBSEFEPO AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:21 GMT+0000 (Coordinated Universal Time) Initiated by parent stack 2022-07-15T07:22:32.925Z [INFO]: 2022-07-15T07:22:32.927Z [INFO]: UPDATE_FAILED AuthTriggerCustomLambdaStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:31 GMT+0000 (Coordinated Universal Time) Resource update cancelled UPDATE_ROLLBACK_IN_PROGRESS amplify-melcaas-newenv-65719 AWS::CloudFormation::Stack Fri Jul 15 2022 07:22:32 GMT+0000 (Coordinated Universal Time) The following resource(s) failed to update: [functionmelcaasToolRunnerHIBP, AuthTriggerCustomLambdaStack]. 2022-07-15T07:23:02.945Z [INFO]: 2022-07-15T07:23:02.946Z [INFO]: UPDATE_IN_PROGRESS functionmelcaasAuthCustomMessage AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:02 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS custommelcaasErrorNotification AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:02 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:03.241Z [INFO]: 2022-07-15T07:23:03.242Z [INFO]: UPDATE_IN_PROGRESS authmelcaasAuth AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:02 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthCustomMessage AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:02 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE custommelcaasErrorNotification AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:02 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasAuthPostConfirmation AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:02 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:07.940Z [INFO]: 2022-07-15T07:23:07.941Z [INFO]: UPDATE_COMPLETE authmelcaasAuth AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:03 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthPostConfirmation AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:03 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS apimelcaasGraphQLAPI AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:04 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:08.043Z [INFO]: 2022-07-15T07:23:08.044Z [INFO]: UPDATE_ROLLBACK_IN_PROGRESS amplify-melcaas-newenv-65719-apimelcaasGraphQLAPI-M9TTZWQXQ8PL AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:04 GMT+0000 (Coordinated Universal Time) User Initiated 2022-07-15T07:23:13.063Z [INFO]: 2022-07-15T07:23:13.066Z [INFO]: UPDATE_IN_PROGRESS Employee AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:08 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS FunctionDirectiveStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:08 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE FunctionDirectiveStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:08 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE Employee AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:08 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS ScanStatistic AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS NessusRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS MeliusIssueRepresentation AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS Employer AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS EmployerGroup AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS OpenVASRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS EmployeeGroupAllocation AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS Target AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS User AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS HIBPRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE ScanStatistic AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE MeliusIssueRepresentation AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE Employer AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE EmployerGroup AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE OpenVASRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE EmployeeGroupAllocation AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE HIBPRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE User AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE NessusRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:09 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE Target AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:10 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS NMAPRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:10 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE NMAPRecord AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:10 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:23.063Z [INFO]: 2022-07-15T07:23:23.065Z [INFO]: UPDATE_IN_PROGRESS ConnectionStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:22 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE ConnectionStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:22 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:27.949Z [INFO]: 2022-07-15T07:23:27.951Z [INFO]: UPDATE_COMPLETE apimelcaasGraphQLAPI AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:26 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasCreateDailyStatistics AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:26 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasInitialSetup AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:26 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionS3Triggere603b8f1 AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:26 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasAuthPreSignup AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:26 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasDBStreamEmployer AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:26 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasAuthPreTokenGeneration AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:26 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasInitialSetup AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:26 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthPreSignup AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:26 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasDBStreamEmployer AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:27 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthPreTokenGeneration AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:27 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionS3Triggere603b8f1 AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:27 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasCreateDailyStatistics AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:27 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS AuthTriggerCustomLambdaStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:27 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS storagemelcaasStorage AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:27 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:32.961Z [INFO]: 2022-07-15T07:23:32.963Z [INFO]: UPDATE_COMPLETE storagemelcaasStorage AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:28 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasToolRunnerNMAP AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:28 GMT+0000 (Coordinated Universal Time) UPDATE_IN_PROGRESS functionmelcaasToolRunnerOpenVAS AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:28 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasToolRunnerHIBP AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:28 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasToolRunnerNMAP AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:29 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasToolRunnerOpenVAS AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:29 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:33.019Z [INFO]: 2022-07-15T07:23:33.020Z [INFO]: UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS amplify-melcaas-newenv-65719-AuthTriggerCustomLambdaStack-BZY3UBSEFEPO AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:31 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:42.972Z [INFO]: 2022-07-15T07:23:42.974Z [INFO]: UPDATE_COMPLETE AuthTriggerCustomLambdaStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:38 GMT+0000 (Coordinated Universal Time) UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS amplify-melcaas-newenv-65719 AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:39 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE custommelcaasErrorNotification AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:41 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasDBStreamEmployer AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:41 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasToolRunnerNMAP AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:41 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasToolRunnerHIBP AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:41 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasToolRunnerOpenVAS AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:41 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasCreateDailyStatistics AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:41 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasInitialSetup AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:42 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE storagemelcaasStorage AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:42 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:47.963Z [INFO]: 2022-07-15T07:23:47.965Z [INFO]: UPDATE_COMPLETE functionS3Triggere603b8f1 AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:43 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:52.960Z [INFO]: 2022-07-15T07:23:52.961Z [INFO]: UPDATE_COMPLETE AuthTriggerCustomLambdaStack AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:51 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthPostConfirmation AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:52 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthCustomMessage AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:52 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE functionmelcaasAuthPreTokenGeneration AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:52 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:23:53.058Z [INFO]: 2022-07-15T07:23:53.059Z [INFO]: UPDATE_COMPLETE functionmelcaasAuthPreSignup AWS::CloudFormation::Stack Fri Jul 15 2022 07:23:52 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:24:07.974Z [INFO]: 2022-07-15T07:24:07.975Z [INFO]: UPDATE_COMPLETE apimelcaasGraphQLAPI AWS::CloudFormation::Stack Fri Jul 15 2022 07:24:03 GMT+0000 (Coordinated Universal Time) UPDATE_COMPLETE authmelcaasAuth AWS::CloudFormation::Stack Fri Jul 15 2022 07:24:04 GMT+0000 (Coordinated Universal Time) UPDATE_ROLLBACK_COMPLETE amplify-melcaas-newenv-65719 AWS::CloudFormation::Stack Fri Jul 15 2022 07:24:05 GMT+0000 (Coordinated Universal Time) 2022-07-15T07:24:33.161Z [INFO]: Following resources failed 2022-07-15T07:24:33.162Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud 2022-07-15T07:24:33.164Z [WARNING]: ✖ There was an error initializing your environment. 2022-07-15T07:24:33.172Z [INFO]: ResourceNotReady: Resource is not in the state stackUpdateComplete  at constructor.setError (/snapshot/repo/build/node_modules/aws-sdk/lib/resource_waiter.js:182:47)  at Request.CHECK_ACCEPTORS (/snapshot/repo/build/node_modules/aws-sdk/lib/resource_waiter.js:44:12)  at Request.callListeners (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:106:20)  at Request.emit (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:78:10)  at Request.emit (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:686:14)  at Request.transition (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:22:10)  at AcceptorStateMachine.runTo (/snapshot/repo/build/node_modules/aws-sdk/lib/state_machine.js:14:12)  at /snapshot/repo/build/node_modules/aws-sdk/lib/state_machine.js:26:10  at Request. (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:38:9)  at Request. (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:688:12)  at Request.callListeners (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:116:18)  at Request.emit (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:78:10)  at Request.emit (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:686:14)  at Request.transition (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:22:10)  at AcceptorStateMachine.runTo (/snapshot/repo/build/node_modules/aws-sdk/lib/state_machine.js:14:12)  at /snapshot/repo/build/node_modules/aws-sdk/lib/state_machine.js:26:10  at Request. (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:38:9)  at Request. (/snapshot/repo/build/node_modules/aws-sdk/lib/request.js:688:12)  at Request.callListeners (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:116:18)  at callNextListener (/snapshot/repo/build/node_modules/aws-sdk/lib/sequential_executor.js:96:12)  at IncomingMessage.onEnd (/snapshot/repo/build/node_modules/aws-sdk/lib/event_listeners.js:335:13)  at IncomingMessage.emit (events.js:412:35)  at IncomingMessage.emit (domain.js:475:12)  at endReadableNT (internal/streams/readable.js:1334:12)  at processTicksAndRejections (internal/process/task_queues.js:82:21) {  code: 'ResourceNotReady',  retryable: false,  time: 2022-07-15T07:24:28.155Z,  statusCode: 200,  retryDelay: 30000 } 2022-07-15T07:24:33.213Z [ERROR]: !!! Build failed 2022-07-15T07:24:33.213Z [ERROR]: !!! Non-Zero Exit Code detected 2022-07-15T07:24:33.213Z [INFO]: # Starting environment caching... 2022-07-15T07:24:33.214Z [INFO]: # Uploading environment cache artifact... 2022-07-15T07:24:33.301Z [INFO]: # Environment caching completed Terminating logging... ```

Additional information

No response

ykethan commented 2 years ago

Hello @benjeater, Could you please provide us the team-provider-info.json.

benjeater commented 2 years ago

@ykethan Here you go:

{
  "dev": {
    "awscloudformation": {
      "AuthRoleName": "amplify-productname-dev-144015-authRole",
      "UnauthRoleArn": "arn:aws:iam::465234467934:role/amplify-productname-dev-144015-unauthRole",
      "AuthRoleArn": "arn:aws:iam::465234467934:role/amplify-productname-dev-144015-authRole",
      "Region": "eu-west-1",
      "DeploymentBucketName": "amplify-productname-dev-144015-deployment",
      "UnauthRoleName": "amplify-productname-dev-144015-unauthRole",
      "StackName": "amplify-productname-dev-144015",
      "StackId": "arn:aws:cloudformation:eu-west-1:465234467934:stack/amplify-productname-dev-144015/48dc14b0-b1c1-11ec-a163-02844adf795f",
      "AmplifyAppId": "doocypzu2klhi",
      "AuthTriggerTemplateURL": "https://s3.amazonaws.com/amplify-productname-dev-144015-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json"
    },
    "categories": {
      "auth": {
        "productnameAuth": {}
      },
      "function": {
        "productnameAuthCustomMessage": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameAuthCustomMessage-4e45586d677a55685432-build.zip"
        },
        "productnameAuthPostConfirmation": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameAuthPostConfirmation-706a4f5a4e476b474136-build.zip"
        },
        "productnameAuthPreTokenGeneration": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameAuthPreTokenGeneration-48503772736c44304d74-build.zip"
        },
        "productnameToolRunnerNMAP": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameToolRunnerNMAP-336e736e4a2f4a376139-build.zip"
        },
        "S3Triggere603b8f1": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/S3Triggere603b8f1-39736b5a6a3534775877-build.zip"
        },
        "productnameAuthPreSignup": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameAuthPreSignup-396e37724938546c7832-build.zip"
        },
        "productnameDBStreamEmployer": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameDBStreamEmployer-3157442f744c354d4343-build.zip"
        },
        "productnameToolRunnerHIBP": {
          "secretsPathAmplifyAppId": "doocypzu2klhi",
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameToolRunnerHIBP-4a6e75354e57396b3839-build.zip"
        },
        "productnameToolRunnerOpenVAS": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameToolRunnerOpenVAS-63707866574b5a334e36-build.zip"
        },
        "productnameScanCreator": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameScanCreator-69526e4564554e59734d-build.zip"
        },
        "productnameCreateDailyStatistics": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameCreateDailyStatistics-792f6b4a527571665249-build.zip"
        },
        "productnameInitialSetup": {
          "deploymentBucketName": "amplify-productname-dev-144015-deployment",
          "s3Key": "amplify-builds/productnameInitialSetup-4139384561682f563169-build.zip"
        }
      },
      "hosting": {
        "amplifyhosting": {
          "appId": "doocypzu2klhi",
          "type": "cicd"
        }
      }
    }
  }
}
ykethan commented 2 years ago

hey @benjeater, Thank you for the information. looking at the file I observe that the demo branch is currently missing from the file. if we are trying to deploy a demo branch we will require values for this environment in the file..

Could you please try amplify env checkout <current-env-name> and see if the fields do get populated. Additionally, could you please try doing a amplify pull to pull in the latest changes from the project bucket.

benjeater commented 2 years ago

I first tried amplify checkout env demo

% amplify checkout env demo
Please pass in a valid environment name. Run amplify env list to get a list of valid environments
% amplify env list

| Environments |
| ------------ |
| *dev         |

There is no environment to switch to because the environment was created by connecting a branch from the GitHub repo to the project in the AWS Amplify console, not the CLI.

I then did a pull of the project to check the difference

% amplify pull             

Pre-pull status:

    Current Environment: dev

┌──────────┬───────────────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name                 │ Operation │ Provider plugin   │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productDBStreamEmployer       │ Update    │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productInitialSetup           │ Update    │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productAuthCustomMessage      │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productAuthPostConfirmation   │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productAuthPreTokenGeneration │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ S3Triggere603b8f1             │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productAuthPreSignup          │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productToolRunnerNMAP         │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productToolRunnerHIBP         │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productToolRunnerOpenVAS      │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productScanCreator            │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productCreateDailyStatistics  │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Auth     │ productAuth                   │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Api      │ productGraphQLAPI             │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Hosting  │ amplifyhosting                │ No Change │                   │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Storage  │ productStorage                │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Custom   │ productErrorNotification      │ No Change │ awscloudformation │
└──────────┴───────────────────────────────┴───────────┴───────────────────┘

Local changes detected.
Pulling changes from the cloud will override your local changes.
? Are you sure you would like to continue? Yes
⠹ Fetching updates to backend environment: dev from the cloud.Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
Overrides functionality is not implemented for this category
⠋ Building resource api/productGraphQLAPI✅ GraphQL schema compiled successfully.

Edit your schema at /Users/imac/git/product/amplify/backend/api/productGraphQLAPI/schema.graphql or place .graphql files in a directory at /Users/imac/git/product/amplify/backend/api/productGraphQLAPI/schema
Overrides functionality is not implemented for this category
✔ Successfully pulled backend environment dev from the cloud.
✅ 
Post-pull status:

    Current Environment: dev

┌──────────┬───────────────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name                 │ Operation │ Provider plugin   │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Custom   │ productErrorNotification      │ Update    │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productAuthCustomMessage      │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productAuthPostConfirmation   │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productAuthPreTokenGeneration │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ S3Triggere603b8f1             │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productAuthPreSignup          │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productToolRunnerNMAP         │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productDBStreamEmployer       │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productToolRunnerHIBP         │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productToolRunnerOpenVAS      │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productScanCreator            │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productCreateDailyStatistics  │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Function │ productInitialSetup           │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Auth     │ productAuth                   │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Api      │ productGraphQLAPI             │ No Change │ awscloudformation │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Hosting  │ amplifyhosting                │ No Change │                   │
├──────────┼───────────────────────────────┼───────────┼───────────────────┤
│ Storage  │ productStorage                │ No Change │ awscloudformation │
└──────────┴───────────────────────────────┴───────────┴───────────────────┘

The only differences after the pull are the datetimes of the last deployment (because it was built and deployed in the cloud it will have different timestamps from when I built it locally) and the deployment zip hashes.

I have another environment called e2etests which was previously deploying fine but has the same issue starting at the same time. I also created a brand new environment (newenvtest) to see if the problem happened with a new environment; it did and the second deployment did not work.

Your comment about the environment not being present in the team-provider-info.json file made me look for a way to pull this environment from the cloud. I found the Import an Environment process.

Using the Import an Environment process, populating the details from IAM, S3, and CloudFormation, I was able to add an environment to the team-provider-info.json file.

{
  "dev": {
    "awscloudformation": {
      "AuthRoleName": "amplify-product-dev-144015-authRole",
      "UnauthRoleArn": "arn:aws:iam::465234467934:role/amplify-product-dev-144015-unauthRole",
      "AuthRoleArn": "arn:aws:iam::465234467934:role/amplify-product-dev-144015-authRole",
      "Region": "eu-west-1",
      "DeploymentBucketName": "amplify-product-dev-144015-deployment",
      "UnauthRoleName": "amplify-product-dev-144015-unauthRole",
      "StackName": "amplify-product-dev-144015",
      "StackId": "arn:aws:cloudformation:eu-west-1:465234467934:stack/amplify-product-dev-144015/48dc14b0-b1c1-11ec-a163-02844adf795f",
      "AmplifyAppId": "doocypzu2klhi",
      "AuthTriggerTemplateURL": "https://s3.amazonaws.com/amplify-product-dev-144015-deployment/amplify-cfn-templates/auth/auth-trigger-cloudformation-template.json"
    },
    "categories": {
      "auth": {
        "productAuth": {}
      },
      "function": {
        ...
      },
      "hosting": {
        "amplifyhosting": {
          "appId": "doocypzu2klhi",
          "type": "cicd"
        }
      }
    }
  },
  "demo": {
    "awscloudformation": {
      "Region": "eu-west-1",
      "DeploymentBucketName": "amplify-product-demo-70125-deployment",
      "StackName": "amplify-product-demo-70125",
      "StackId": "arn:aws:cloudformation:eu-west-1:465234467934:stack/amplify-product-demo-70125/9c670910-0279-11ed-9557-029315a1ff45",
      "UnauthRoleName": "amplify-product-demo-70125-unauthRole",
      "UnauthRoleArn": "arn:aws:iam::465234467934:role/amplify-product-demo-70125-unauthRole",
      "AuthRoleName": "amplify-product-demo-70125-authRole",
      "AuthRoleArn": "arn:aws:iam::465234467934:role/amplify-product-demo-70125-authRole"
    }
  }
}

I then tried listing the environments in the CLI

% amplify env list

| Environments |
| ------------ |
| *dev         |
| demo         |

Looks good so far I thought, so let's try switching to the demo environment:

% amplify checkout env demo
⠼ Initializing your environment: demo🛑 Could not initialize 'demo': Access Denied

Is there anything else I can try?

ykethan commented 2 years ago

Hello @benjeater, interesting. Could you please verify the profile being used for this environment by checking the local-aws-info.json present under the amplify/.config folder. If you are utilizing Vscode the folder may be hidden, please open the .vscode/settings.json and remove or comment out the line containing amplify/.config.

Could you please verify if the profile name does match with the profile in your credentials file locally and the credentials for the profile as well.

benjeater commented 2 years ago

@ykethan I can confirm that the settings in local-aws-info.json for the profileName match with a profile name available in my AWS credentials file. I can also confirm that the profile is able to perform amplify push on the dev environment (i.e. the locally created environment) without any issue.

ykethan commented 2 years ago

Hey @benjeater, to confirm by any chance do you have Branch auto detection enabled. For reference: https://docs.aws.amazon.com/amplify/latest/userguide/pattern-based-feature-branch-deployments.html

benjeater commented 2 years ago

Hey @ykethan; no, I am using the "connect branch" button on the app hosting environments page in the AWS console to create the new environments.

lazpavel commented 2 years ago

Hi @benjeater, from Amplify Console, can you go to your amplify project > backend environments > under Local Setup Instructions copy the amplify pull --appId <app-id> --envName demo and execute in an empty directory.

Are you getting any errors on pull? if not can you check that amplify env list prints the correct environment? Can you run amplify diagnose --send-report and share the Project Identifier from the terminal?

benjeater commented 2 years ago

Hey @lazpavel, the project identifier is 0a2c62eccf8d3ac5d53ed152c8cb193b.

Running amplify pull --appId <app-id> --envName demo in an empty directory resulted in a successful pull of the environment data. I then ran an amplify pull on the dev environment in the same folder to ensure that an overwrite didn't occur. Everything seemed fine.

I then went back to my project directory, switched git to the demo branch and performed an amplify pull on the demo environment. This was all successful.

I performed an amplify push -y to update the demo environment in AWS; this was also successful.

The manual deployment resulted in local changes that I then committed to the demo branch of my GitHub repo. I performed a git commit and git push to the repo and the continuous deployment worked correctly.

It seems that this problem is isolated to environments that have never had a local amplify push (i.e. those created from repo branches with continuous deployment).

WORKAROUND:

amplify pull --appId <app-id> --envName <env-with-issue>
amplify push -y

This workaround unblocks me, but if I was using branch auto-detection, this wouldn't be a great solution. I'm not sure how much more help I can offer in narrowing this down, but let me know if there is anything else you want me to try.

ADDITIONAL TESTING:

I then switched to the new-env-test branch locally, made a small change to one of the files, and performed a git commit and git push. The continuous deployment triggered correctly and the deployment failed with the [secretsPathAmplifyAppId] must have values error. I therefore still have a branch that someone with more knowledge than me can take a look at if required.

ykethan commented 2 years ago

Hey @benjeater, Thank you for providing us the information. If I may ask what was the change performed on the files?

made a small change to one of the files

benjeater commented 2 years ago

@ykethan I bumped the package.json patch version

edwardfoyle commented 2 years ago

HI @benjeater for some reason it seems like you team-provider-info.json file is not being updated correctly when creating / checking out a new environment or not being persisted to your repo. Can you make sure that all your environments in the team-provider-info.json file have the secretsPathAmplifyAppId value defined and that these changes are committed to the repo? The file should look something like this:

{
    "environment1": {
        "awscloudformation": {
            "AmplifyAppId": "abcd1234"
            ...
        },
        "categories": {
            "function": {
                "functionName": {
                    "secretsPathAmplifyAppId": "abcd1234"
                }
            }
        }
    },
    "environment2": {
        "awscloudformation": {
            "AmplifyAppId": "9876qwer"
            ...
        },
        "categories": {
            "function": {
                "functionName": {
                    "secretsPathAmplifyAppId": "9876qwer"
                }
            }
        }
    }
}

Make sure that the secretsPathAmplifyAppId is defined for all functions that use secrets and defined in all environments.

benjeater commented 2 years ago

Hey @edwardfoyle, I can confirm that the secretsPathAmplifyAppId exists in the dev environment of my team-provider-info.json file. 👍🏻

The environment created locally (dev) is fine, but this problem is for environments created via continuous deployment from my GitHub repo.

These environments never get written to the team-provider-info.json file because their creation and deployment is performed in the AWS cloud without any interaction with my local machine or a commit to the GitHub repo.

The initial deployment of the environment using continuous deployment works and has the right values (details in my initial post). The problem seems to be that between the initial deployment and the 2nd deployment the secret value is forgotten.

josefaidt commented 2 years ago

Reproduction steps:

  1. amplify init > environment name main
  2. create a git repository and push an empty commit git init; gh repo create; git commit -m 'init' --allow-empty; git push -u origin main
  3. add hosting with amplify add hosting > CI/CD with Amplify Hosting + Git
  4. add contents and push to git git add .; git commit -m 'add hosting'; git push
  5. checkout a new branch with git checkout -b next
  6. create a new environment with amplify env add > next
  7. add changes to git, connect branch in Amplify Hosting
  8. add a function with a single secret, mysecret, with amplify add function
  9. push change to git
  10. allow Amplify Hosting to build successfully
  11. open and merge a PR from next to main
  12. allow Amplify Hosting to build, observe error
CREATE_FAILED               functionwithsecret       AWS::CloudFormation::Stack Fri Jul 29 2022 15:03:54 GMT+0000 (Coordinated Universal Time) Parameters: [secretsPathAmplifyAppId] must have values

Mitigation steps:

  1. locally, check out the main branch and main Amplify environment
  2. we should see the team-provider-info.json file is updated with the new function
    "function": {
      "withsecret": {}
    }
  3. from here when we run amplify update function we see this secret is associated with the function
    Secrets configuration
        - mysecret
  4. choose to update the function's secret and add a value for the main environment (note: previously we added this secret for the next environment, and the CLI will create an SSM parameter with the environment name in the key, which is why we need to step back through this flow for the main environment) image
  5. after updating the secret, the missing key should now be available in the team-provider-info and subsequent pushes to git for this branch/env will succeed
    "function": {
        "withsecret": {
          "secretsPathAmplifyAppId": "du4677olxujg5"
        }
      }

@benjeater would you say these reproduction steps accurately reflect the steps you took prior to receiving this error?

josefaidt commented 2 years ago

regression of https://github.com/aws-amplify/amplify-cli/issues/9667

benjeater commented 2 years ago

@josefaidt Reproduction steps 1-5 are the same, but step 6 is where my methodology differed. My steps would be:

  1. amplify init > environment name main
  2. create a git repository and push an empty commit git init; gh repo create; git commit -m 'init' --allow-empty; git push -u origin main
  3. add hosting with amplify add hosting > CI/CD with Amplify Hosting + Git
  4. add contents and push to git git add .; git commit -m 'add hosting'; git push
  5. checkout a new branch with git checkout -b next

All the same so far, but the following steps are my process:

  1. add a function with a single secret, mysecret, with amplify add function
  2. push the change to git
  3. connect the next branch to Amplify using the AWS console
  4. allow Amplify Hosting to build successfully
  5. make any change to the next branch locally
  6. push the change to git
  7. allow Amplify Hosting to build the next environment, observe error

This puts you in a state where the next environment is not stored in the team-provider-info.json file locally or in git because that environment was never created locally.

The mitigation process is to pull the next environment down from Amplify with the following commands:

amplify pull --appId <app-id> --envName <env-with-issue>
amplify push
git commit -m 'pull down of remote environment'
git push

This gets the next environment details into the local team-provider-info.json file and means that subsequent commits to the branch in git will be deployed correctly. This mitigation process would probably be successful without the amplify push command because the commit to git would have the necessary information for a build.

If I was to guess where the problem is, it would be that an initial build environment of an environment created in Amplify console is different to subsequent pulls from GitHub. This difference means the initial build pulls data from the existing environment, but future builds use the details in the GitHub repo and can't find the details because the environment doesn't exist in the repo.

samputer commented 2 years ago

Running into the same problem, thanks to @benjeater 's work around of doing a pull first, I got this working on automatic branch deployments with the following added step in my amplify build settings:

The first command obtains the git branch name (which should match the backend name) and pulls the environment

- amplify pull --yes --appId $AWS_APP_ID --envName $AWS_BRANCH
- amplifyPush --simple
david-startinvest commented 1 year ago

Hello, I have the same issue. but the last solution you provided is not working for me. I did "amplify delete" and started amplify init , and created my functions from scratch and when I add hosting, I get same error as below. I have already added solution by @samputer to my build setting but that does not change. can someone help?

🛑 The following resources failed to deploy: Resource Name: functiondonationfinal3makepayment123 (AWS::CloudFormation::Stack) Event Type: update Reason: Parameters: [phrase, stripePkTest, stripeSkLive, stripePkLive, stripeSkTest] must have values URL: https://console.aws.amazon.com/cloudformation/home?region=us-west-1#/stacks/arn%3Aaws%3Acloudformation%3Aus-west-1%3A733328664694%3Astack%2Famplify-donationfinal3-dev-171218%2F45fcfd60-bd4e-11ed-8ee4-02d69899c47f/events 2023-03-08T03:06:33.424Z [INFO]: 🛑 Resource is not in the state stackUpdateComplete Name: functiondonationfinal3makepayment123 (AWS::CloudFormation::Stack), Event Type: update, Reason: Parameters: [phrase, stripePkTest, stripeSkLive, stripePkLive, stripeSkTest] must have values Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

david-startinvest commented 1 year ago

I forgot to mention that my environmental variables for function [phrase, stripePkTest, stripeSkLive, stripePkLive, stripeSkTest] they have value and are not empty. The project was working but after me tweaking functions with "aws udpate-function-config" I started getting error. even deleting the project and creating new amplify project is not helping .... I am not sure how Amplify is tracking me across various projects and same error triggers ...

BMscis commented 3 months ago

I had this issue after doing an amplify pull, for some reason, it sometimes removes the functions env variables and secrets. I was able to fix this by calling amplify update function and adding the secrets back.