Delete or Create key fails: Attempting to mutate more than 1 global secondary index at the same time
See original GitHub issueDescribe the bug
When attempting to delete a single key (no other changes) I get:
Attempting to mutate more than 1 global secondary index at the same time on the FooTable table in the Foo stack.
An error occurred during the push operation: Attempting to mutate more than 1 global secondary index at the same time on the FooTable table in the Foo stack.
Amplify CLI Version
4.29.2
To Reproduce
- Have a schema that has already been pushed with an example
@key
- Try to delete the
@key
amplify push
fails
Expected behavior
@key
should be deleted
Additional context
Example schema:
type Foo
@model
@key(name: "FooStatusUpdatedAt", fields: ["status", "updatedAt"], queryField: "fooStatusUpdatedAt")
@searchable
{
updatedAt: AWSDateTime,
status: PublicationStatus,
...
}
enum PublicationStatus {
draft
}
Note: I downgraded to @aws-amplify/cli@4.27.3
and was able to perform the amplify push
without issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:39 (10 by maintainers)
Top Results From Across the Web
Managing Global Secondary Indexes - Amazon DynamoDB
Create, modify, and delete global secondary indexes online in Amazon DynamoDB. ... You must specify one attribute to act as the index partition...
Read more >AWS Amplify create Global Secondary Index after DynamoDB ...
An error occured during the push operation: Attempting to add a local secondary index to the table1Table table in the table1 stack. Local...
Read more >API (GraphQL) - Troubleshooting - AWS Amplify Docs
Attempting to mutate more than 1 global secondary index at the same time. If you're running into the error above during amplify push...
Read more >Cannot perform more than one GSI creation or deletion in a ...
Problem. This error occurs when you try to: create a DynamoDB table with more than one Global Secondary Index (GSI); or; add or...
Read more >GSI (Global Secondary Index) errors with Amplify push
DynamoDB cannot update, modify, create, or delete more than on GSI (Global Secondary Index) at a time on a particular table.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Any updates on this?
I have the same problem, and I just found out that the order of the
@key
directives seems to matter. Going from this:to this:
results in abovementioned error, but instead doing:
seems to work. My guess is that the diffing in the first case creates something like this:
instead of this: