Open nxia416 opened 1 year ago
hey @nxia416,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂.
Hi @nxia416, can you try the steps noted in this comment and see if you're able to re-deploy?
Thanks @ykethan , I tried the method and still get the same result. I think my problem is similar to #1425, however I am on Product env.
I think this could be a serious problem: I updated the API step by step in dev, but accidentally pushed all changes together to production. And now, it is stuck there.
Any suggestion?
More information:
amplify pull --appId xxxxxx --envName prod
get an older version schema. But AppSync suggests the changes are already made. It seems the amplify and appsync are inconsistent.
I am having the same issue with amplify cli 12.4.0 How did you got out of this situaton, we are stucked
How did you install the Amplify CLI?
yarn
If applicable, what version of Node.js are you using?
v16.14.2
Amplify CLI Version
12.1.1
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.
Tried delete GSIs and added back
Describe the bug
🛑 The following resources failed to deploy: Resource Name: CouponTable (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: a993b865-7a0d-8dda-5771-47cde13bc1d0, HandlerErrorCode: InvalidRequest) URL: https://console.aws.amazon.com/cloudformation/home?region=xxxxxx#/stacks/arn%3Aaws%3Acloudformation%3Aap-southeast-1%3Axxxxxxxx%3Astack%2Famplify-xxxx-apixxx-XXXX-Coupon-FE39UJC7WKM7%2F10ee48e0-xxxx-xxxx-xxxx-0a6dc331856c/events
🛑 Resource is not in the state stackUpdateComplete Name: CouponTable (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: a993b865-7a0d-8dda-5771-47cde13bc1d0, HandlerErrorCode: InvalidRequest), IsCustomResource: false
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
Expected behavior
I expect the api could rollback or update. However after
amplify pull
, I can't do anything to update amplify backendReproduction steps
I think I added 2 GSIs and removed 1 in the same git commit, and accidentally pushed it to amplify backend. After that, I can't change anything for the graphql API: always get the error message as shown in the picture.
Project Identifier
amplify diagnose --send-report
Learn more at https://docs.amplify.aws/cli/reference/diagnose/
✅ Report saved: /var/folders/2j/4v3x_j4x7x509ghkl7dwcps80000gp/T/cvmapi/report-1687166941401.zip
✔ Done
Project Identifier: 91cdde8f9febd928b9321cf78bea1dc1
Log output
Additional information
I have this coupon table and try to update it, the old schema is:
The new schema is:
So, there are several changes to the GSI, I didn't notice and pushed to Amplify. Now the API is stuck.
I tried several methods:
1,
amplify push --force
, not working... 2,amplify pull --appId xxxxxx --envName prod
and push again, still get the same error message. Another strange thing is, the pulledschema.graphql
is not sync with AppSync. 3, There are other functions accessing the Coupon table, so I couldn't remove the table...Now I know I have to update the GSI one by one. But the question now is how to make
amplify push
work again...Before submitting, please confirm: