Amplify-cli: src/project/amplify/.config/local-env-info.json' error raised when deploy.

Created on 23 Nov 2020  路  39Comments  路  Source: aws-amplify/amplify-cli

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the
Amplify Console GitHub Issue Tracker

Describe the bug
Error: File at path: '/codebuild/output/src663057245/src/REPO/amplify/.config/local-env-info.json' does not exist
error is raised when project is deployed by amplifyPush --simple command.

Amplify CLI Version

  • 4.34.0

To Reproduce
Project is connected to github.

  1. merge to dev branch from working branch
  2. Triggers build script
backend:
  phases:
    build:
      commands:
        - chmod +x ./config/backend.sh
        - ./config/backend.sh
frontend:
...
  1. build script is
if [ "${AWS_BRANCH}" = "master" ] || [ "${AWS_BRANCH}" = "dev" ]
then
  echo "BUILD ENV:  ${AWS_BRANCH}"
  npm install -g @aws-amplify/cli
  amplifyPush --simple
else
  echo "BUILD ENV: ${AWS_BRANCH}"
  echo "Not pushing backend"
fi

Expected behavior
Deployed successfully

Desktop (please complete the following information):
WSL

Additional context

  • Using custom build image mrytkm/amplify-amazonlinux2
  • Log output
2020-11-23T01:44:12.252Z [INFO]: Git SSH Key acquired
2020-11-23T01:44:12.325Z [INFO]: # Cloning repository: [email protected]:TEAM/REPO.git
2020-11-23T01:44:12.338Z [INFO]: Agent pid 129
2020-11-23T01:44:12.344Z [INFO]: Identity added: /root/.ssh/git_rsa (/root/.ssh/git_rsa)
2020-11-23T01:44:12.416Z [INFO]: Cloning into 'MYPROJECT'...
2020-11-23T01:44:13.090Z [INFO]: Warning: Permanently added the RSA host key for IP address 'MYIP' to the list of known hosts.
2020-11-23T01:44:16.200Z [INFO]: # Switching to commit: 9bf07fd88ec507104956a3ac7d91e53d681aabef
2020-11-23T01:44:16.331Z [INFO]: Agent pid 142
2020-11-23T01:44:16.335Z [INFO]: Identity added: /root/.ssh/git_rsa (/root/.ssh/git_rsa)
2020-11-23T01:44:16.352Z [INFO]: Note: switching to '9bf07fd88ec507104956a3ac7d91e53d681aabef'.
                                 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 <new-branch-name>
                                 Or undo this operation with:
                                 git switch -
                                 Turn off this advice by setting config variable advice.detachedHead to false
                                 HEAD is now at 9bf07fd Merge pull request #80 from REPO/BRANCH
2020-11-23T01:44:16.359Z [INFO]: Successfully cleaned up Git credentials
2020-11-23T01:44:16.359Z [INFO]: # Checking for Git submodules at: /codebuild/output/src663057245/src/REPO/.gitmodules
2020-11-23T01:44:16.389Z [INFO]: # Retrieving cache...
2020-11-23T01:45:10.883Z [INFO]: # Extracting cache...
2020-11-23T01:46:22.466Z [INFO]: # Extraction completed
2020-11-23T01:46:22.731Z [INFO]: # Retrieving environment cache...
2020-11-23T01:46:22.820Z [INFO]: # Retrieved environment cache
2020-11-23T01:46:22.828Z [INFO]: # Ensuring NPM package '@aws-amplify/cli' is version: 'latest'
2020-11-23T01:46:26.030Z [INFO]: # Patching NPM package '@aws-amplify/cli' from 1.12.0 to 4.34.0...
2020-11-23T01:47:20.904Z [INFO]: # Done patching NPM package '@aws-amplify/cli'
2020-11-23T01:47:25.225Z [INFO]: ## Starting Backend Build
                                 # Starting phase: build
                                 # Executing command: chmod +x ./config/backend.sh
2020-11-23T01:47:25.229Z [INFO]: # Executing command: ./config/backend.sh
2020-11-23T01:47:25.231Z [INFO]: AWS_BRANCH name: dev
2020-11-23T01:47:25.231Z [INFO]: BUILD ENV:  dev
2020-11-23T01:47:25.235Z [INFO]: # Getting Amplify CLI Cloud-Formation stack info from environment cache
2020-11-23T01:47:25.248Z [INFO]: # Start initializing Amplify environment: dev
2020-11-23T01:47:25.248Z [INFO]: {STACK INFO...} 
2020-11-23T01:47:26.347Z [INFO]: File at path: '/codebuild/output/src663057245/src/REPO/amplify/.config/local-env-info.json' does not exist
2020-11-23T01:47:26.348Z [INFO]: Error: File at path: '/codebuild/output/src663057245/src/REPO/amplify/.config/local-env-info.json' does not exist
                                 at Function.JSONUtilities.readJson (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/jsonUtilities.js:40:19)
                                 at StateManager.getData (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/state-manager/stateManager.js:166:56)
                                 at StateManager.getLocalEnvInfo (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/state-manager/stateManager.js:77:25)
                                 at teamProviderInfoGetAuthResourceNameHasSecrets (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/utils/team-provider-migrate.js:44:61)
                                 at Object.exports.migrateTeamProviderInfo (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/utils/team-provider-migrate.js:18:34)
                                 at Object.run (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/index.js:76:45)
                                 at process._tickCallback (internal/process/next_tick.js:68:7)
                                 at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
                                 at startup (internal/bootstrap/node.js:283:19)
                                 at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2020-11-23T01:47:26.355Z [ERROR]: !!! Build failed
2020-11-23T01:47:26.355Z [ERROR]: !!! Non-Zero Exit Code detected
2020-11-23T01:47:26.355Z [INFO]: # Starting environment caching...
2020-11-23T01:47:26.355Z [INFO]: # Uploading environment cache artifact...
2020-11-23T01:47:26.459Z [INFO]: # Environment caching completed
Terminating logging...
auth bug

Most helpful comment

@hyungjunk @chuongvuoop2021 Hey all I could reproduce we are actively working on a fix now

All 39 comments

I have the same issue, anyone finds a workaround yet?

I just had to downgrade amplify version. You can set in Build settings menu.

I just had to downgrade amplify version. You can set in Build settings menu.

which version do you use?

It is 4.29.x

Can't rememeber precisely but pretty sure it wont be a big matter.

I recommend checking out the last successful build log of your project and use the same version. Thats what I did.

my last successful build was with 4.32.1, same as my fail one, I downgraded it back to 4.29.0, and still wouldn't work, found a workaround by not ignoring amplify/.config/project-config.json though, thanks

@hyungjunk @chuongvuoop2021 Hey all I could reproduce we are actively working on a fix now

I have the same issue, the last version working for us is : 4.32.1

Same here! Since yesterday morning. I tried by not ignoring amplify/.config/project-config.json but when I push to my production branch it gets stucked

I had the same issue on 4.34.0 what fixed it for me was changing the Build image settings to use the latest Amplify cli because the default version seems to be older than the latest, previously I was updating the amplify cli as part of my build script but that wasn't working anymore. Also 4.34.0 has changed were the some information is located, I think you have to run any amplify command to make this change to your project I ran amplify --version in the root of my project and the dialog to update the files started. Also setup a service role if you haven's already

I have the same issue, the last version working for us is : 4.32.1

Worked for me, thanks.

I just changed config in amplify console => build settings -> Build image settings
Screenshot 2020-11-25 at 15 52 22

Dear amplify developers, please check for deploying code created with old version of amplify before release new version. For the last one year working on a project that use amplify I had experienced a similar issue a few times and such a problem is unacceptable for production use of amplify.

A fix has been released in Amplify CLI version 4.36.1. If you still see this issue, please comment below and we will re-open.

same problem as before. However, I am able to build up to 4.32 by adjusting build settings. It fails on 4.32.1 during back end build. I have at least an operating system. What should I do next?
log (85).txt

Reopen this issue

I have updated the amplify cli version to 4.36.2. This issue is still happening. Whatever the fix was, clearly its not working.

I also still have this problem on 4.36.2.

@drclohite
@nickamckenna
What's the error you see?

https://github.com/aws-amplify/amplify-cli/issues/5974 @drclohite your issue is somewhat identical to the issue mentioned here +1 or follow up the thread there

Reopen this issue again

The issue is not identical.

5974 happens when using amplify env checkout dev command.

However, this happens with amplifyPush --simple in amplify.yml. This is a more urgent issue than the other one, as currently it stops the production deployment pipeline.
We have this simple command to push our changes to production using our production deployment script in amplify.yml. We have noticed this issue with the latest amplify cli update. Currently, we cant deploy to production as it always fails.

Either give some work around or fix this issue. Please do not close this issue without proper solution.

Issue is exactly the same as describe in very first comment.

@sky4git
Can you share the log output?

2020-11-29T06:25:12.623Z [INFO]: # Executing command: amplify --version
2020-11-29T06:25:13.646Z [INFO]: Initializing new Amplify CLI version...
2020-11-29T06:25:13.939Z [INFO]: Done initializing new version.
2020-11-29T06:25:13.939Z [INFO]: Scanning for plugins...
2020-11-29T06:25:13.973Z [INFO]: Plugin scan successful
2020-11-29T06:25:14.006Z [INFO]: File at path: '/codebuild/output/src654173097/src/MYPROJECTNAME/amplify/.config/local-env-info.json' does not exist
2020-11-29T06:25:14.006Z [INFO]: Error: File at path: '/codebuild/output/src654173097/src/MYPROJECTNAME/amplify/.config/local-env-info.json' does not exist
at Function.JSONUtilities.readJson (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/jsonUtilities.js:40:19)
at StateManager.getData (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/state-manager/stateManager.js:166:56)
at StateManager.getLocalEnvInfo (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/state-manager/stateManager.js:77:25)
at teamProviderInfoGetAuthResourceNameHasSecrets (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/utils/team-provider-migrate.js:39:61)
at Object.exports.migrateTeamProviderInfo (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/utils/team-provider-migrate.js:18:34)
at Object.run (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/index.js:78:45)
2020-11-29T06:25:14.013Z [ERROR]: !!! Build failed
2020-11-29T06:25:14.013Z [ERROR]: !!! Non-Zero Exit Code detected

@sky4git Can you try changing your amplify CLI version in the console to 4.32.1? https://github.com/aws-amplify/amplify-cli/issues/5931#issuecomment-733724542

I seen that workaround in previous comment. But its not a proper fix.
Why would we need to rollback to previous CLI version.
It creates inconsistencies in local and production environments.
There should be a proper fix for this.

If we have to do that, that should be the last option.

The reason why this issue is closed is because we have skipped checks for env on amplify init, pull and env in 4.36.2. and the amplifyPush script does basically that

I seen that workaround in previous comment. But its not a proper fix.
Why would we need to rollback to previous CLI version.
It creates inconsistencies in local and production environments.
There should be a proper fix for this.

If we have to do that, that should be the last option.

Sorry for being unclear @sky4git. I'm trying to provide a temporary workaround so that you can get unblocked. I didn't mean to imply it was a replacement for a fix.

@ammarkarachi
Yes, I understand the change.
But what is the fix?
How can I make my production pipeline working again? What do I need to change in my amplify.yml script?

Remember, this issue is happening without we doing anything wrong and just updating the CLI version caused this issue.

@jhockett My local cli version is already upgraded to 4.36.2. no issue when using amplify push --yes. Its just production pipeline is broken. I am afraid to rollback to previous version now. It can cause unintended effects on production.

Can you confirm the version on your production pipeline?

4.36.2

@sky4git What's your build script like?

version: 1
env:
   AMPLIFY_AMAZON_CLIENT_ID: "XXX"
  AMPLIFY_AMAZON_CLIENT_SECRET: "XXX"
  AMPLIFY_FACEBOOK_CLIENT_ID: "XXX"
  AMPLIFY_FACEBOOK_CLIENT_SECRET: "XXX"
  AMPLIFY_GOOGLE_CLIENT_ID: "XXX"
  AMPLIFY_GOOGLE_CLIENT_SECRET: "XXX"
  MODE: "production"
#ENV: "master"
backend:
  phases:
    preBuild:
      commands:
        - yum install golang -y
        - npm install -g @aws-amplify/cli
    build:
      commands:
        - ls -la
        - amplify --version
        - go env
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    # IMPORTANT - Please verify your build commands
    build:
      commands:
        - npm run export
  artifacts:
    # IMPORTANT - Please verify your build output directory
    baseDirectory: out
    files:
      - "**/*"
  cache:
    paths:
      - node_modules/**/*

Downgrading to 4.32.1 solved my problem!

log (95).txt
Attached is the latest error file, the same as past error files. I cannot get past 4.32 as a Build Image console setting, although on my pc. My dev machine is also rolled back to 4.32 although it works when set to the latest. The problem is that it will not build when I update my GitHub files and Amplify Build Image is set to the latest. It builds when set to 4.32.

@drclohite Do you know what your role policies are?

@ammarkarachi I have administrator access which includes Amplify and Amplify Admin

any progress? Still building to 4.32, although no hold up

Hey folks, please fix this problem! As of now, I am afraid of developing any new features for my app on Amplify. If this problem still exists for a couple of months, we might as well just call 4.32.1 is the final version of Amplify. Any new features release on Amplify will not be used for any production environment anyway.

I created an Amplify app using CLI v4.39.0 on one computer, but git pulling my iOS codebase and trying to run amplify configure with the same CLI version on a different computer results in the error:

File at path: '/Users/.../amplify/.config/local-env-info.json' does not exist

That file is ignored in the default .gitignore given by Amplify, so this really does seem like a bug.

From what I understand, I shouldn't use a CLI version lower than the one I created the project with. Actually, I get a different error when I try downgrading to 4.32.1 and running amplify configure:

File project: data.graphqltransformer should NOT have additional properties: 'enableiterativegsiupdates'

This is extremely frustrating!

Hi all, we are working on a release to fix this problem as soon as possible, I apologize for the issues we are working on it to get the issues addressed as soon as possible.

This original bug seems to be fixed now with cli version @aws-amplify/[email protected].

However, the old bug is resurfaced now again.
Error: auth headless is missing the following inputParams googleClientId, facebookAppId

I have all the necessary environment variables in my environment variables settings:
AMPLIFY_FACEBOOK_CLIENT_ID
AMPLIFY_FACEBOOK_CLIENT_SECRET
AMPLIFY_GOOGLE_CLIENT_ID
AMPLIFY_GOOGLE_CLIENT_SECRET
You can see my amplify.yml script again here: https://github.com/aws-amplify/amplify-cli/issues/5931#issuecomment-735527370

Here is the whole log for your information:
2020-12-19T06:08:55.477Z [INFO]: Failed to pull the backend. 2020-12-19T06:08:55.480Z [INFO]: auth headless is missing the following inputParams googleClientId, facebookAppId 2020-12-19T06:08:55.485Z [INFO]: Error: auth headless is missing the following inputParams googleClientId, facebookAppId  at updateConfigOnEnvInit (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/src/provider-utils/awscloudformation/index.js:135:15)  at /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/src/index.js:300:28  at /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/promise-sequential/index.js:16:18  at runMicrotasks (<anonymous>)  at processTicksAndRejections (internal/process/task_queues.js:97:5) 2020-12-19T06:08:55.506Z [ERROR]: !!! Build failed 2020-12-19T06:08:55.507Z [ERROR]: !!! Non-Zero Exit Code detected

image

This is also breaking production amplifyPush --simple and not an issue with local environment amplify push.
If you want I can create a new ticket but please fix this permanently

Yup, 4.4 did not work for me either. I had to drop from 4.32 to 4.30 to get my side working again. Phew!

Was this page helpful?
0 / 5 - 0 ratings