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

Environment name is invalid. #13101

Closed
2 tasks done
foobarnes opened this issue Aug 10, 2023 · 7 comments
Closed
2 tasks done

Environment name is invalid. #13101

foobarnes opened this issue Aug 10, 2023 · 7 comments
Labels
multienv Issues tied to multiple environment feature in the CLI pending-triage Issue is pending triage

Comments

@foobarnes
Copy link

foobarnes commented Aug 10, 2023

How did you install the Amplify CLI?

No response

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

12.2.3

What operating system are you using?

macOS 13.4 (22F66)

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

Describe the bug

I cannot amplify env checkout [...] one of my environments.

:) > amplify env checkout jason
🛑 Environment name is invalid.
[...]
:) > amplify env list        

| Environments |
| ------------ |
| *dev         |
| prod         |
| jason        |
:) > amplify env remove jason
🛑 Environment name is invalid.
[...]
:) > amplify pull --appId {{AMPLIFY_APP_ID}}
🛑 Environment 'jason' not found.
[...]

I was able to "select" the jason env like so:

:) > amplify env add jason
Using default provider  awscloudformation
? Select the authentication method you want to use: AWS profile
✖ Initializing your environment: jason
✖ There was an error initializing your environment.
🛑 Could not initialize platform for 'jason': Missing required key 'Bucket' in params
:) > amplify env list        

| Environments |
| ------------ |
| dev          |
| prod         |
| *jason       |
:) > amplify status  
🛑 File at path: '[...]/amplify/#current-cloud-backend/amplify-meta.json' does not exist

Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
[...]

Expected behavior

Expected to be able to check out

Reproduction steps

I'm not sure how I got myself into this mess 🤷‍♂️

Project Identifier

aae37be032a2f135dcdf89710fccdf92

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@foobarnes foobarnes added the pending-triage Issue is pending triage label Aug 10, 2023
@ykethan
Copy link
Member

ykethan commented Aug 11, 2023

Hey @foobarnes, thank you reaching out. Do observe a missing jason block in your team-provider-info.json?
could you try running amplify pull --appId <app-id> --envName dev --yes to see if that pulls the environment?
if that does not work, you will need to remove the missing jason block from the local-aws-info.json and repull the environment.

Similar issue: #12887

@ykethan ykethan added multienv Issues tied to multiple environment feature in the CLI pending-response Issue is pending response from the issue author labels Aug 11, 2023
@foobarnes
Copy link
Author

Thanks, @ykethan, where is local-aws-info.json? I can't find it. I don't have a .config directory in my amplify directory.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Aug 11, 2023
@ykethan
Copy link
Member

ykethan commented Aug 11, 2023

@foobarnes the file may be hidden in VSCode, in you project directory under .vscode -> settings.json. set the amplify/.config as false.

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Aug 11, 2023
@foobarnes
Copy link
Author

Amazing, thank you so much! I need to learn my VSCode better 🥲

Trying now.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Aug 11, 2023
@foobarnes
Copy link
Author

That did it! You're awesome, @ykethan .

I'd recommend adding this helpful tip to the CLI Team Environments > Troubleshooting page since that's where I went to look for info about how to find my local-aws-info.json file. :)

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@ykethan
Copy link
Member

ykethan commented Aug 11, 2023

@foobarnes thank you for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multienv Issues tied to multiple environment feature in the CLI pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants