aws-amplify / aws-amplify/amplify-cli

Amplify env list does not show both env's on headless pull

Open
#11,489 1 comment 0 reactions 0 assignees View on GitHub
bug multienv p2
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### 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](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#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?

_No response_

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

_No response_

### Amplify CLI Version

10.5.1

### What operating system are you using?

Windows

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

No

### Amplify Categories

Not applicable

### Amplify Commands

env

### Describe the bug

When headless pulling env a and then headless pulling env b, override existing `local-aws-info.json` with new env causing `Amplify env list` to display only one environment.

Note: Running `amplify env checkout a` works as expected and `Amplify env list` then shows both the environments. The `team-provider-info.json` does show both environments before the env checkout as well.

customers are stuck assuming their previous environments are not actually available

### Expected behavior

Show both environments on headless pull second environment.

### Reproduction steps

1. `amplify init` (add env dev)
2. `amplify env add test`
3. Create a new folder outside present project
4. run `amplify pull --appId --envName dev`
5. selecting modifiable as yes
6. run `amplify pull --appId --envName test`
7. run `amplify env list`
observe only one env, which is test
```
| Environments |
| ------------ |
| *test |
```
8. run `amplify env checkout test`
9. run `amplify env list`
Observe both env's
```
| Environments |
| ------------ |
| *test |
| dev |
```

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Project Identifier

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the listed `amplify pull --appId ... --envName` commands for `dev` and `test`, then inspect how headless pull updates `local-aws-info.json` and how `team-provider-info.json` is preserved. Compare that flow with `amplify env checkout`; done means `amplify env list` shows both environments after the second headless pull.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.