Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing 3 GSIs on table with enableIterativeGsiUpdates set to true throws "cannot modify more than one GSI" error #6348

Closed
tomhirschfeld opened this issue Jan 8, 2021 · 7 comments
Assignees
Labels
graphql-transformer-v1 Issue related to GraphQL Transformer v1 not-reproducible Not able to reproduce the issue

Comments

@tomhirschfeld
Copy link
Contributor

Describe the bug
Removing 3 GSIs on table with enableIterativeGsiUpdates set to true throws "cannot modify more than one GSI" error

To Reproduce
Steps to reproduce the behavior:

change schema from:

type Product
  @model
  @key(fields: ["id"])
  @key(name: "ByActive", fields: ["active"], queryField: "productsByActive")
  @key(name: "ByProduct", fields: ["product"], queryField: "productsByProduct")
  @key(name: "SKUID", fields: ["SKUID"], queryField: "productsBySKUID")
  @key(name: "ChildSKUID", fields: ["ChildSKUID"], queryField: "productsBychildSKUID")

to

type Product
@model
@key(fields: ["id"])
@key(name: "ByActive", fields: ["active"], queryField: "productsByActive")

throws error in master + production envs using the provided push simple script when iterative GSI update flag is set to true
Expected behavior

removing 3 GSIs should not trigger an error

CLI versions: latest/4.40.*

@nubpro
Copy link
Contributor

nubpro commented Jan 8, 2021

For sanity check, can you provide your cli.json?

@tomhirschfeld
Copy link
Contributor Author

tomhirschfeld commented Jan 8, 2021

@nubpro

{
  "features": {
    "graphQLTransformer": {
      "enableIterativeGsiUpdates": true
    }
  }
}

@amhinson amhinson transferred this issue from aws-amplify/amplify-js Jan 8, 2021
@edwardfoyle edwardfoyle added graphql-transformer-v1 Issue related to GraphQL Transformer v1 pending-triage Issue is pending triage labels Jan 11, 2021
@SwaySway
Copy link
Contributor

@tomhirschfeld I ran this on version 4.40.1 and I was not able to repro. I do have the feature flag enabled.

Did the error look like the following?

Attempting to mutate more than 1 global secondary index at the same time on the ProductTable table in the Product stack.
Cause: You may only mutate one global secondary index in a single CloudFormation stack update. 
How to fix: If using @key, include one @key at a time. 
If using @connection, just add one new @connection which is using @key, run `amplify push`, 

We could also look into replicating this. Could you send over your amplify/ directory to amplify-cli@amazon.com?

@SwaySway SwaySway added the pending-response Issue is pending response from the issue author label Jan 12, 2021
@tomhirschfeld
Copy link
Contributor Author

yes, I can do this, thanks!

@SwaySway SwaySway added pending-close-response-required and removed pending-response Issue is pending response from the issue author labels Jan 14, 2021
@kaustavghosh06 kaustavghosh06 moved this from To do to In progress in Pending-triage tracking Jan 26, 2021
@kaustavghosh06 kaustavghosh06 added this to In progress in Pending-triage tracking Jan 26, 2021
@kaustavghosh06 kaustavghosh06 moved this from In progress to To do in Pending-triage tracking Jan 26, 2021
@kaustavghosh06 kaustavghosh06 moved this from To do to In progress in Pending-triage tracking Jan 26, 2021
@SwaySway SwaySway added not-reproducible Not able to reproduce the issue and removed pending-close-response-required pending-triage Issue is pending triage labels Jan 26, 2021
@SwaySway
Copy link
Contributor

Closing due to lack of response. Should you still run into this issue please comment below.

Pending-triage tracking automation moved this from In progress to Done Jan 26, 2021
@mgarabedian
Copy link

I am having problems with this as well. I have the flag set. With a larger amplify push, that involved updates to function/auth/api, I never got the "Deploying stack (1 of X)" message. Amplify push failed with "Cannot perform more than one GSI creation or deletion in a single update".

I then reverted my schema.graphql ( added the deleted @keys back ), and pushed the other changes. After that succeeded, I removed 2 keys and ran 'amplify push'. I did get "Deploying stack (1 of 3)" and it succeeded.

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
graphql-transformer-v1 Issue related to GraphQL Transformer v1 not-reproducible Not able to reproduce the issue
Projects
No open projects
Development

No branches or pull requests

5 participants