question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"The local environment configuration does not allow modifying the backend." when running `amplify env checkout <env_name>`

See original GitHub issue

Before opening, please confirm:

JavaScript Framework

Not applicable

Amplify APIs

Not applicable

Amplify Categories

Not applicable

Environment information

  System:
    OS: macOS 11.7
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 357.89 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.22.12 - ~/.nvm/versions/node/v12.22.12/bin/node
    npm: 6.14.17 - ~/.nvm/versions/node/v12.22.12/bin/npm
  Browsers:
    Chrome: 105.0.5195.125
    Safari: 15.5
  npmGlobalPackages:
    @angular/cli: 14.1.3
    @aws-amplify/cli: 9.2.1
    memlab: 1.1.27
    npm: 6.14.17
    pm2: 5.2.0

Note: amplify -v return 10.0.0.

Describe the bug

When running amplify env checkout dev in an amplify project where there is no backend folder (*), one gets the following error:

The local environment configuration does not allow modifying the backend. Use amplify env pull --envName dev

The environment is checked out (as shown by amplify env list), but the error above still shows.

Moreover, running amplify env pull --envName dev as suggested by the error will yield the following error:

✖ There was an error initializing your environment. ⠋ Creating Zip File at path: ‘/Users/…/erroramplify2/amplify/backend/backend-config.json’ does not exist ✖ Creating Zip 🛑 File at path: ‘/Users/…/erroramplify2/amplify/backend/backend-config.json’ does not exist

(*) Having a project with no backend folder happens when the user responded “No” to “Do you plan on modifying this backend? No” when pulling the project from the cloud with amplify pull --appId <appId>.

Expected behavior

The error message should not show, the environment should simply be “checked out”/switched.

Reproduction steps

  1. Initialize a new amplify project: mkdir amplify-project && cd $_ && amplify init
  2. Select the default configuration.
  3. Create a new env: amplify env add test
  4. Create a new folder to pull the origin amplify project into (say, you’re a colleague and want to contribute to the original project): cd .. && mkdir amplify-project-clone && $_
  5. Pull the amplify project config: `amplify pull --appId <appId_of_the_amplify_project_initilaized_above>
  6. Select again default configuration.
  7. When asked Do you plan on modifying this backend?, respond No
  8. Run amplify env checkout test
  9. See the error

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
wcricchicommented, Dec 3, 2022

Is there an update on this issue? The same thing happened to me when I pulled a different env, chose “No” to modifying the backend for that env, but now I cannot make changes to any of my other environments.

1reaction
manu2504commented, Nov 27, 2022

@ykethan any update on this ticket? I’m still facing this really annoying bug as an AWS customer.

I had to rollback to @aws-amplify/cli@9 as v10 is broken on this aspect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Team environments - Commands - AWS Amplify Docs
Amplify environments help you manage your local and cloud environments to mimic your team ... Use this command to checkout the <env-name> environment....
Read more >
Jump over a hurdle of working with Amplify backend ...
dev environment doesn't exist on my local. $ amplify env checkout dev --restore Please pass in a valid environment name. Run amplify env...
Read more >
Team workflows with Amplify backend environments
In the build settings screen, pick an existing backend environment to set up continuous deployment with the main branch. Choose prod from the...
Read more >
Setup Amplify backend environment for different branch
if you change the git branch then you also need to change corresponding amplify environment by running this command amplify checkout env ......
Read more >
AWS Amplify and Multiple Serverless Environments
This will allow you to pull down a newer version of the environment in which you are already working; checkout <envname> — Moves...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found