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

./amplify/.config/local-env-info.json: No such file or directory

Open thisismydesign opened this issue 5 years ago • 13 comments

Hey, I'm getting this error with the configure command.

using amplify available at PATH
/usr/local/bin/amplify
amplify version Scanning for plugins...
Plugin scan successful
4.27.0
/entrypoint.sh: line 62: ./amplify/.config/local-env-info.json: No such file or directory

My job:

  deploy:
    if: github.ref == 'refs/heads/master'
    runs-on: ubuntu-latest
    timeout-minutes: 10
    needs: [lint, test-unit, test-e2e, build]
    steps:
    - name: configure amplify
      uses: ambientlight/[email protected]
      with:
        amplify_command: configure
        amplify_env: prod
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_REGION: eu-west-1

thisismydesign avatar Aug 11 '20 06:08 thisismydesign

Hm, this is strange, It fails at https://github.com/ambientlight/amplify-cli-action/blob/60165d38e083b3e52d7d026e038bdfb08a2fad14/entrypoint.sh#L62

Do you have amplify/.config/project-config.json commited in your repo?

ambientlight avatar Aug 11 '20 07:08 ambientlight

Do you have amplify/.config/project-config.json commited in your repo?

No

thisismydesign avatar Aug 11 '20 08:08 thisismydesign

The script for now doesn't check whether amplify/.config directory exists, I am also not quite sure whether it will run env pull without project-config.json, please check whether the step runs if you have project-config.json commited.

Is it the case that amplify/.config/project-config.json is now .gitignored in default amplify template? Or you have manually added it to .gitignore?

ambientlight avatar Aug 11 '20 08:08 ambientlight

Is it the case that amplify/.config/project-config.json is now .gitignored in default amplify template? Or you have manually added it to .gitignore?

Not gitignored on my side.

thisismydesign avatar Aug 11 '20 08:08 thisismydesign

Hi, Same issue here, do we need to commit the amplify folder in order to get the configure working? or can we run amplify pull? I don't see in the action doc that amplify pull is supported

nitzan-upstream avatar Aug 20 '20 13:08 nitzan-upstream

NVM after committing amplify/.config/project-config.json it's working, thank you.

nitzan-upstream avatar Aug 23 '20 05:08 nitzan-upstream

I suspect it could be related to this https://github.com/aws-amplify/amplify-cli/issues/5931

noobling avatar Dec 09 '20 12:12 noobling

hello. any fix?

Fix-vinicius-oliveira avatar Jan 18 '21 19:01 Fix-vinicius-oliveira

Having the same issue, (running on 4.16.2). Tried the latest too, didn't work. /entrypoint.sh: line 62: ./amplify/.config/local-env-info.json: No such file or directory

ChaitanyaKrishnaPappala avatar Jan 29 '21 21:01 ChaitanyaKrishnaPappala

Surprisingly, adding the - uses: actions/checkout@v1 fixed the issue for me.

Below is my .yml script,

name: 'Amplify Configuration'
on:
  push:
    branches:
      - develop
      - staging
      - master

jobs:
  test:
    name: amplify-cli-action
    env:
      awsRegion: us-east-1
      amplifyVersion: 4.16.1
      amplifyEnvironment: "${{ (github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/master') && 'prod' || 'dev' }}"
    runs-on: ubuntu-latest


    steps:
      - uses: actions/checkout@v1

      - name: configure amplify
        uses: ambientlight/[email protected]
        with:
          amplify_cli_version: ${{ env.amplifyVersion }}
          amplify_command: configure
          amplify_env: ${{ env.amplifyEnvironment }}
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: ${{ env.awsRegion }}

      - name: deploy/push amplify
        uses: ambientlight/[email protected]
        with:
          amplify_cli_version: ${{ env.amplifyVersion }}
          amplify_command: push
          amplify_env: ${{ env.amplifyEnvironment }}
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: ${{ env.awsRegion }}

@thisismydesign @Fix-vinicius-oliveira @ambientlight

ChaitanyaKrishnaPappala avatar Jan 29 '21 22:01 ChaitanyaKrishnaPappala

Hey, same issue here. Any fix?

mariobalrod avatar May 11 '21 14:05 mariobalrod

The ./amplify/.config/local-env-info.json should be git ignored: https://docs.amplify.aws/cli/reference/files/#gitignore

So the action fails because the file is not available during runtime. A simple touch ./amplify/.config/local-env-info.json before echo should make it work I guess.

zirkelc avatar Sep 29 '21 14:09 zirkelc

Faced the same issue, I committed ./amplify/.config/local-env-info.json to the repo and removed it from the .gitignore file as a temporary fix.

On top of that, I realised that I had to use 'project_dir' to point to my frontend subdirectory for steps using 'with'. Working-directory only works for steps with 'run'.

marcusleeeugene avatar Oct 05 '21 08:10 marcusleeeugene