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

Error when trying to checkout newly cloned environment with name of previously deleted environment

Open djsjr opened this issue 3 years ago • 1 comments

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

  1. From console, clone environment giving it specific name
  2. Pull using CLI command amplify pull --appId APPID --envName ENVNAME
  3. From console, delete clone environment
  4. From console, clone original environment giving it the same specific name as you did the first time
  5. Pull using CLI command amplify pull --appId APPID --envName ENVNAME
  6. 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

djsjr avatar Jul 31 '22 04:07 djsjr

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?

josefaidt avatar Aug 01 '22 14:08 josefaidt

Closing due to inactivity. @djsjr if you are still experiencing this issue please reply back to this thread or create a new issue

josefaidt avatar Sep 22 '22 20:09 josefaidt