amplify-category-api
amplify-category-api copied to clipboard
Amplify push fails after migration to gql transfromer v2
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
18.19.0
Amplify CLI Version
12.12.4
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
I created a new Amplify environment to test migration to transformer v2. After running amplify migrate api, and fixing minor issues it caused preventing push (just a duplicated rule inside @auth), amplify push fails.
The issue seems quite similar to https://github.com/aws-amplify/amplify-category-api/issues/2458, at leasta when it comes to the stack rollback failing. Same as in that ticket (see https://github.com/aws-amplify/amplify-category-api/issues/2458#issuecomment-2062343231), after the push my root stack (amplify-myapp-devupgrade-5970a) is at UPDATE_ROLLBACK_COMPLETE state, but nested stack (amplify-myapp-devupgrade-5970a-apimyapp-F4NIC8HGO4VC) is at UPDATE_ROLLBACK_FAILED state. Under Root Stack resources the failing stack is listed as "UPDATE_COMPLETED".
After digging into the Cloudformation stack amplify-myapp-devupgrade-5970a -> amplify-myapp-devupgrade-5970a-apimyapp-F4NIC8HGO4VC I notice, that only certain Models fail.
For example: PaymentEvent, AdditionalServicePricing, User, Organization all succesfull, while Business, ExternalBusiness and Category are failing.
Example of ListCompanyResolver failing:
Digging into the Failing ones, I see that they are fail at the ListXResovler. Why is this happening and how do I fix it? Might it have something to do with the improvePluralization feature flag being forced with v2, since all failing resolvers seem to be ones that would be pluralized by adding something else than just "s" at the end? I am once again trying to migrate to Transformer V2, to be ready when the Gen2 migration becomes possible.
At AppSync console we can also see those failing resolvers missing. Also see how the generated query is called "listBusinesss", should improved pluralization be "listBusinesses"?
So firstly how should I get unblocked to continue testing the migration?
And why does this happen, how can we avoid this mess when hopefully eventually moving onto production with this migration?
Expected behavior
I should be able to amplify push after transformer v2 migration without erroring and getting stuck at rollback failed state.
Reproduction steps
- Have Gen 1 project using Transformer V1
- Run amplify migrate api
- Try to amplify push
Project Identifier
6308c65c680deb869980844a29382065
Log output
# Put your logs below this line
Additional information
Changes to cli.json by amplify migrate api
Before submitting, please confirm:
- [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.