"The local environment configuration does not allow modifying the backend." when running `amplify env checkout <env_name>`
See original GitHub issueBefore opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- 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.
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
- Initialize a new amplify project:
mkdir amplify-project && cd $_ && amplify init
- Select the default configuration.
- Create a new env:
amplify env add test
- 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 && $_
- Pull the amplify project config: `amplify pull --appId <appId_of_the_amplify_project_initilaized_above>
- Select again default configuration.
- When asked
Do you plan on modifying this backend?
, respondNo
- Run
amplify env checkout test
- 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:
- Created a year ago
- Comments:5 (1 by maintainers)
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.
@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.