aws-amplify / aws-amplify/amplify-cli

`amplify delete` errors when project has been deleted from the AWS Console

Open
#11,486 1 comment 0 reactions 0 assignees View on GitHub
bug p2 platform platform-delete regression
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.

Yes, removed the Amplify app on console

### Amplify Categories

Not applicable

### Amplify Commands

delete

### Describe the bug
Previously when a running amplify delete on a application where the amplify app has been deleted on AWS console, the CLI would remove the amplify folder after checking for stacks and application.
In the newer version of Amplify CLI, the application does the following

```
-> amplify delete
? Are you sure you want to continue? This CANNOT be undone. (This will delete all the environments of the project from the cloud and wipe out all the local files created by Amplify CLI) Yes
⠋ Deleting resources from the cloud. This will take a few minutes.
Deleting env: abc.

Deleting env: dev.
⠸ Deleting resources from the cloud. This will take a few minutes.Stack has already been deleted or does not exist
⠦ Deleting resources from the cloud. This will take a few minutes.App dooggmmyc7koy not found.
⠧ Deleting resources from the cloud. This will take a few minutes.Stack has already been deleted or does not exist
⠸ Deleting resources from the cloud. This will take a few minutes.App dooggmmyc7koy not found.
✖ Project delete failed.
🛑 Project delete failed.
App not found.

Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

Session Identifier: 8e866bc3-263b-4215-bbea-6b251721c48a
✔ An unexpected error has occurred, opt in to send an error report to AWS Amplify with non-sensitive project configuration files. Confirm (y/N) · no
```
The application recognizes the deleted app but fails to clean up.

on CLI version 10.0.0

```
amplify delete
? Are you sure you want to continue? This CANNOT be undone. (This will delete all the environments of the project from the cloud and wipe out all the local files created by Amplify CLI) Yes
- Deleting resources from the cloud. This will take a few minutes.
Deleting env: dev.
| Deleting resources from the cloud. This will take a few minutes.Unable to remove env: dev because deployment bucket amplify-testfullamp-dev-92940-deployment does not exist or has been deleted.
- Deleting resources from the cloud. This will take a few minutes.Stack has already been deleted or does not exist
/ Deleting resources from the cloud. This will take a few minutes.App dooggmmyc7koy not found.
√ Project already deleted in the cloud.
Project deleted locally.
```

### Expected behavior

Remove amplify folder if not present and not invoke diagnose when not needed.

### Reproduction steps

1. amplify init
2. delete app on console
3. amplify delete

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Project Identifier

8e866bc3-263b-4215-bbea-6b251721c48a

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.