Error when trying to checkout newly cloned environment with name of previously deleted environment
Before opening, please confirm:
- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have searched for duplicate or closed issues.
- [X] I have read the guide for submitting bug reports.
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v14.19.1
Amplify CLI Version
9.1.0
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Amplify Categories
auth, storage, function, api, analytics
Amplify Commands
env
Describe the bug
I can clone an environment, giving it a new name. I can then pull it using amplify pull --appId APPID --envName ENVNAME (clone does not appear as an environment when I use amplify env list' and is not found when I use amplify env checkout ENVNAME but perhaps that's another bug.)
If I delete this cloned environment, and then reclone the original and name it the same as the deleted clone, the pull won't work. Here's the error:
Fetching updates to backend environment: newdev from the cloud.🛑 Could not initialize 'newdev': The specified bucket does not exist
Expected behavior
Pull should pull newly cloned environment
Reproduction steps
- From console, clone environment giving it specific name
- Pull using CLI command
amplify pull --appId APPID --envName ENVNAME - From console, delete clone environment
- From console, clone original environment giving it the same specific name as you did the first time
- Pull using CLI command
amplify pull --appId APPID --envName ENVNAME - Get error
GraphQL schema(s)
n/a
Project Identifier
n/a
Log output
# Put your logs below this line
Fetching updates to backend environment: newdev from the cloud.🛑 Could not initialize 'newdev': The specified bucket does not exist
Additional information
No response
Hey @djsjr :wave: thanks for raising this! From your reproduction steps I noticed these environments are deleted and cloned from the Console rather than the CLI, however the CLI is still aware of the "old" environment which points to an s3 bucket that no longer exists (because it was deleted). Before attempting to pull and initialize the environment created in the console, can you first run amplify env remove and select the environment that is no longer needed, then try pulling the freshly-cloned env?
Closing due to inactivity. @djsjr if you are still experiencing this issue please reply back to this thread or create a new issue