Open parvusville opened 1 year ago
I also tried instructions from this comment with no luck. https://github.com/aws-amplify/amplify-category-api/issues/1425#issuecomment-1546148219
Pre-push status showed no changes to the GraphQL API, but it still tried to deploy something.
This time console gives me more clear message after amplify push
fails, message is fundamentally same as before. Just as a reminder, when I inspect these DynamoDB tables in cloud, they all have the new indexes from the original push that timed out.
🛑 The following resources failed to deploy:
Resource Name: UserTable (AWS::DynamoDB::Table)
Event Type: update
Reason: Resource handler returned message: "Cannot perform more than one GSI creation or deletion in a single update" (RequestToken: 65488e9b-5ba4-7a6e-df31-db7bd77d5178, HandlerErrorCode: InvalidRequest)
URL: xxx
Resource Name: ReviewTable (AWS::DynamoDB::Table)
Event Type: update
Reason: Resource handler returned message: "Cannot perform more than one GSI creation or deletion in a single update" (RequestToken: ca464380-097d-284f-0ec8-22d09678f0f0, HandlerErrorCode: InvalidRequest)
URL: xxx
Resource Name: PricingExceptionTable (AWS::DynamoDB::Table)
Event Type: update
Reason: Resource handler returned message: "Cannot perform more than one GSI creation or deletion in a single update" (RequestToken: 1c3bbe8c-ece7-23db-c470-1069b8908926, HandlerErrorCode: InvalidRequest)
URL: xxx
🛑 Resource is not in the state stackUpdateComplete
Name: UserTable (AWS::DynamoDB::Table), Event Type: update, Reason: Resource handler returned message: "Cannot perform more than one GSI creation or deletion in a single update" (RequestToken: 65488e9b-5ba4-7a6e-df31-db7bd77d5178, HandlerErrorCode: InvalidRequest), IsCustomResource: false
Name: ReviewTable (AWS::DynamoDB::Table), Event Type: update, Reason: Resource handler returned message: "Cannot perform more than one GSI creation or deletion in a single update" (RequestToken: ca464380-097d-284f-0ec8-22d09678f0f0, HandlerErrorCode: InvalidRequest), IsCustomResource: false
Name: PricingExceptionTable (AWS::DynamoDB::Table), Event Type: update, Reason: Resource handler returned message: "Cannot perform more than one GSI creation or deletion in a single update" (RequestToken: 1c3bbe8c-ece7-23db-c470-1069b8908926, HandlerErrorCode: InvalidRequest), IsCustomResource: false
Hey, 👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂.
One more update to the previous. I tried manually removing the new indexes (in the case of this table leaving no indexes) from PricingException in the DDB Console to see if it makes any difference, but the same error still persists. This was also done in the similar state than the previous comment: after amplify pull
, and I just added one change to the schema (a field: test: String
).
Resource Name: PricingExceptionTable (AWS::DynamoDB::Table)
Event Type: update
Reason: Resource handler returned message: "Cannot perform more than one GSI creation or deletion in a single update" (RequestToken: 2db3d1b2-5baa-fb48-a91d-419ff9c52aef, HandlerErrorCode: InvalidRequest)
How did you install the Amplify CLI?
No response
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
12.2.3
What operating system are you using?
Pop Os
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
TLDR; I merged lots of changes from dev to staging environment, which caused us to run into the default 30minute timeout with the Amplify Hosting CI/CD build, and now we are unable to deploy anything. I am also quite hesitant of pushing these changes into production, before I know how to resolve this particular issue. Though I hope the push would be just fine by using a longer timeout than the default 30 minutes.
The changes included:
Since the build ran for 30 minutes before timing out, it did successfully create lots of stuff, including the new API Gateway with the Lambda, AND all of the GSI:s. So now I am in a state where part of the updates are deployed into the cloud, but the CLI of course does not know of them. Not sure if this is part of the problem and if I should do something about it. For example remove created stuff manually..?
Now we are facing this message when trying to push.
The API stack (old existing GraphQL API, where I added the new @key:s to) always ends up in
UPDATE_ROLLBACK_COMPLETE
state.I will include all the steps taken in the Reproduction steps section. Below is what I have found from the affected Cloudformation Stack (GraphQL API one, amplify-myapp-staging-165805-apimyapp1MEX5K4GYEIYQ):
And here is a sample from the part that fails on the Review table stack (amplify-myapp-staging-165805-apimyapp-1MEX5K4GYEIYQ-Review-1BC3241C95LS4):
As far as I understand, this seems to be the key thing blocking the push at least for now:
I also see similar error on the User table's stack, to which I also added new indexes. However with other Tables I also added indexes to, I only see
Resource update cancelled
as the reason for the "UPDATE_FAILED".The results are pretty much the same for the later deployments, and the stack always end up in UPDATE_ROLLBACK_COMPLETE -state.
Expected behavior
When a deployment halts due to whatever reason, we should have a way out afterwards.
Reproduction steps
2023-08-08T08:12:31.155Z [INFO]: 🛑 Cannot iteratively rollback as the following step does not contain a previousMetaKey: {"status":"DEPLOYING"}
2023-08-08T08:27:04.100Z [INFO]: Rolled back (2 of 1) 2023-08-08T08:27:04.160Z [WARNING]: ✖ There was an error initializing your environment. 2023-08-08T08:27:04.161Z [INFO]: 🛑 ["Index: 0 State: {\"deploy\":\"waitingForDeployment\"} Message: Resource is not in the state stackUpdateComplete"] ... 2023-08-08T08:27:04.203Z [INFO]: Session Identifier: e7ddd0ef-b014-486a-b61f-2f274cdc6af5
Rolled back (2 of 1) 🛑 ["Index: 0 State: {\"deploy\":\"waitingForDeployment\"} Message: Resource is not in the state stackUpdateComplete"]
Put your logs below this line