amplify-cli: amplifyPush from amplify.yml fails with ENOENT: no such file or directory, open 'amplify/backend/awscloudformation/build/root-cloudformation-stack.json'

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.
  • I have removed any sensitive information from my code snippets and submission.

How did you install the Amplify CLI?

No response

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

No response

Amplify CLI Version

8.4.0

What operating system are you using?

amazon linux

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

Added Admin API and pushed the changes to my dev branch.

Amplify Categories

auth

Amplify Commands

push

Describe the bug

I have added admin queries API. After that, I pushed the changes in my dev branch, and amplify console build is failing for the following error.

2022-06-12T02:58:48.817Z [WARNING]: ✔ Successfully pulled backend environment dev from the cloud.
2022-06-12T02:58:49.572Z [WARNING]: ✖ There was an error initializing your environment.
2022-06-12T02:58:49.673Z [INFO]: Failed to pull the backend.
2022-06-12T02:58:49.676Z [WARNING]: - Creating Zip
2022-06-12T02:58:49.700Z [INFO]: 🛑 ENOENT: no such file or directory, open '/codebuild/output/srcXXXXXXX/src/myproject/amplify/backend/awscloudformation/build/root-cloudformation-stack.json'
2022-06-12T02:58:49.700Z [INFO]: Error: ENOENT: no such file or directory, open '/codebuild/output/srcXXXXXXX/src/myproject/amplify/backend/awscloudformation/build/root-cloudformation-stack.json'
                                 at Object.openSync (fs.js:497:3)
                                 at Object.openSync (pkg/prelude/bootstrap.js:739:32)
                                 at Object.readFileSync (fs.js:393:35)
                                 at Object.readFileSync (pkg/prelude/bootstrap.js:1025:36)
                                 at /snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/diagnose.js:131:132
                                 at Array.forEach (<anonymous>)
                                 at createZip (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/diagnose.js:130:15)
                                 at zipSend (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/diagnose.js:88:35)
                                 at reportError (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/diagnose.js:60:15)
                                 at Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:168:46)
                                 at runMicrotasks (<anonymous>)
                                 at processTicksAndRejections (internal/process/task_queues.js:95:5)
2022-06-12T02:58:49.718Z [ERROR]: !!! Build failed
2022-06-12T02:58:49.718Z [ERROR]: !!! Non-Zero Exit Code detected

Expected behavior

amplifyPush --simple should work normally as amplify push --yes for the local environment worked successfully.

Reproduction steps

Already described above.

GraphQL schema(s)

# Put schemas below this line


Log output

# Put your logs below this line


Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 31 (15 by maintainers)

Most upvoted comments

For anyone coming across this issue specifically, if you set:

  "debug": {
    "shareProjectConfig": false
  }

in your cli.json then you’ll bypass this bug ultimately throwing from packages/amplify-cli/src/commands/diagnose.ts

Hey @bobthemagicman 👋 thanks for chiming in here! From the error it appears we will need a few environment variables set in the Amplify Hosting console https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html#amplify-console-environment-variables

@stephenc222 glad to hear you are back up and running! And yes, please subscribe to https://github.com/aws-amplify/amplify-cli/issues/10581 and https://github.com/aws-amplify/amplify-cli/issues/10582 for further updates regarding the diagnostics issues

Thanks for clarifying @stephenc222 , and I was unable to reproduce attempting a build with imported storage with latest version of the CLI. Can you try modifying the AMPLIFY_STORAGE_TABLES environment variables to match { "resource-name": "table-name" }?

If my team-provider-info.json looks like:

"Membership3nckpnszi5h2hcmccvtqnxeryydev": {
          "tableName": "Membership-3nckpnszi5h2hcmccvtqnxeryy-dev",

we’ll want the following in our environment variables

{"Membership3nckpnszi5h2hcmccvtqnxeryydev":"Membership-3nckpnszi5h2hcmccvtqnxeryy-dev"}

Therefore in your case this would look like:

{"blog": "sentimentData"}