aws-amplify / aws-amplify/amplify-cli
CLI throws error with stack trace when attempting to delete a project that is updating
- 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?
pnpm
### If applicable, what version of Node.js are you using?
v18.7.0
### Amplify CLI Version
9.2.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.
n/a
### Amplify Categories
Not applicable
### Amplify Commands
delete
### Describe the bug
CLI throws error with stack trace when attempting to delete a project that has an active deployment running
```
josef ~/D/p/a/r/10098
> ay delete --force
⠋ Deleting resources from the cloud. This may take a few minutes...
Deleting env: dev.
⠋ Deleting resources from the cloud. This may take a few minutes...Error deleting stack amplify-10098-dev-90101
Error occurred while deleting env: dev.
Stack [arn:aws:cloudformation:us-east-1:xxx:stack/amplify-10098-dev-90101/b664a630-1334-11ed-8179-0a9a2b6fa22d] cannot be deleted while in status UPDATE_IN_PROGRESS
✖ Project delete failed.
✔ An unexpected error has occurred, opt in to send an error report to AWS Amplify with non-sensitive project configuration files. Confirm (y/N) · yes
Learn more at https://docs.amplify.aws/cli/reference/diagnose/
This project has been opted in automatically to share non-sensitive project configuration files. you can opt out by running 'amplify diagnose --auto-send-off'
✅ Report saved: /var/folders/v4/_hwk0vk17w56y213mtwkgq100000gn/T/10098/report-1659560137625.zip
✔ Done
Project Identifier: 6c23e7ef246d103bd9f1d57fda85f7e5
🛑 Stack [arn:aws:cloudformation:us-east-1:xxx:stack/amplify-10098-dev-90101/b664a630-1334-11ed-8179-0a9a2b6fa22d] cannot be deleted while in status UPDATE_IN_PROGRESS
```
### Expected behavior
CLI should fail gracefully when attempting to delete a project that is actively updating
```
josef ~/D/p/a/r/10098
> ay delete --force
🛑 Stack [arn:aws:cloudformation:us-east-1:xxx:stack/amplify-10098-dev-90101/b664a630-1334-11ed-8179-0a9a2b6fa22d] cannot be deleted while in status UPDATE_IN_PROGRESS
```
OR
```
josef ~/D/p/a/r/10098
> ay delete --force
🛑 App cannot be deleted while an update is in progress. View the currently running update here
```
### Reproduction steps
1. push an update to an active Amplify project
2. in a separate terminal instance, attempt to delete this project
### 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
Research direction
Start with the Amplify CLI delete command and trace how it handles an AWS stack in UPDATE_IN_PROGRESS. Reproduce the issue by pushing an update, then running `amplify delete --force` in a separate terminal. Done means the command exits with the concise expected error and does not emit a stack trace or unexpected-error report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100