Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thisismydesign opened this issue Aug 11, 2020 · 13 comments
Open

Comments

@thisismydesign
Copy link

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/amplify-cli-action@0.2.1
      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
@ambientlight
Copy link
Owner

Hm, this is strange, It fails at

echo '{"projectPath": "'"$(pwd)"'","defaultEditor":"code","envName":"'$6'"}' > ./amplify/.config/local-env-info.json

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

@thisismydesign
Copy link
Author

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

No

@ambientlight
Copy link
Owner

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?

@thisismydesign
Copy link
Author

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.

@nitzan-upstream
Copy link

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
Copy link

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

@noobling
Copy link

noobling commented Dec 9, 2020

I suspect it could be related to this aws-amplify/amplify-cli#5931

@Fix-vinicius-oliveira
Copy link

hello. any fix?

@ChaitanyaKrishnaPappala

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
Copy link

ChaitanyaKrishnaPappala commented Jan 29, 2021

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/amplify-cli-action@0.2.1
        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/amplify-cli-action@0.2.1
        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

@mariobalrod
Copy link

Hey, same issue here. Any fix?

@zirkelc
Copy link

zirkelc commented Sep 29, 2021

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.

@marcusleeeugene
Copy link

marcusleeeugene commented Oct 5, 2021

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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants