aws-amplify / aws-amplify/amplify-cli
unexpected error and stack trace on `amplify update storage` > NoSQL when no storage resource exists
- 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?
18
### Amplify CLI Version
10.2.3
### 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
Not applicable
### Describe the bug
```
aws-amplify/reproductions/storagetest
➜ amplify update storage
? Select from one of the below mentioned services: NoSQL Database
TypeError: Cannot convert undefined or null to object
at Function.keys ()
at updateWalkthrough (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-storage/lib/provider-utils/awscloudformation/service-walkthroughs/dynamoDb-walkthrough.js:96:10)
at Object.updateResource (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-storage/lib/provider-utils/awscloudformation/index.js:103:10)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Object.executeAmplifyCommand (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-storage/lib/index.js:282:3)
at async executePluginModuleCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:142:5)
at async executeCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:40:9)
at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:153:5)
🛑 An error occurred when updating the storage resource
```
### Expected behavior
Amplify CLI gracefully errors with guidance
```
aws-amplify/reproductions/storagetest
➜ amplify update storage
🛑 No storage resource exists. To get started, run `amplify add storage` https://docs.amplify.aws/cli/storage/overview/#setup-a-new-storage-resource
```
### Reproduction steps
1. `amplify init -y`
2. `amplify update storage` > NoSQL
3. observe error
### 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
Assessment
This issue has not been assessed yet.