aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.13k forks source link

amplify gql-compile then amplify push has broken, but won't automatically repair #2881

Closed michaelcuneo closed 5 years ago

michaelcuneo commented 5 years ago

Describe the bug I've had to change the schema.graphql in my project just recently, and I've done a subsequent amplify api gql-compile and amplify push to reflect these changes... But during one of these updates, I got an UPDATE_FAILED. Each amplify push ever since fails to finish with the error message ...

An error occurred when pushing the resources to the cloud

If I scroll back to find what broke, it appears to be the api side of the amplify project.

The following resource(s) failed to update: [UpdateImageResolver, ImageTable, DeleteImageResolver, GetImageResolver, CreateImageResolver].

I need to find out if I could remove the image model from my API completely to allow it to recompile and successfully push, or what's the correct proceedure for getting out of the Update_in_profress, failed, rollback, loop?

To Reproduce Set up a project as per documentation, amplify init, etc... Run amplify gql-compile with a successful result. Run amplify push with an unsuccessful result. Every amplify push after the fail is also an unsuccessful result.

Expected behavior Update_Complete to the API CloudFormation stack.

Desktop (please complete the following information):

michaelcuneo commented 5 years ago

To add to this... I have removed two API's Images and Gallery and their subsequent links to other models from my API and ran amplify api gql-compile again, because both of these API's had no data yet, so I could reimplement them at a later date after I fix the push... But, it has now failed again, this time with the [ConnectionStack] instead of an API, and a final failure stating...

Following resources failed

Resource Name: arn:aws:appsync:ap-southeast-2:885973830331:apis/mcb7722t55fpniyb7gfag4nrcm/types/Project/resolvers/staff (AWS::AppSync::Resolver)
Event Type: update
Reason: No resolver found. (Service: AWSAppSync; Status Code: 404; Error Code: NotFoundException; Request ID: 07a6239c-493a-11e9-866b-5f319f68b6c2)
URL: https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/arn%3Aaws%3Acloudformation%3Aap-southeast-2%3A885973830331%3Astack%2Ffastlab-20190205133112-apifastlab-6HM4I31K72Z3-ConnectionStack-1F48QS49HBWHA%2F6ea67770-413b-11e9-9a23-0af0093ead5a/events

✖ An error occurred when pushing the resources to the cloud

Resource is not in the state stackUpdateComplete

What has occurred here?

michaelcuneo commented 5 years ago

Should I just remove the API completely, rewrite the schema, export all of my DynamoDB tables before I do, that have important data inside... then start from scratch?

jkeys-ecg-nmsu commented 5 years ago

Are you using environments? You could try amplify init to get your project back to a working state.

michaelcuneo commented 5 years ago

I ended up having to remove the API completely, it wouldn’t come good after trying everything. It would be good to have some kind of default recovery on AWS end or the cli end, because it’s not the first time I’ve had an issue like this, with an entirely different CloudFormation, but identical errors... Failed/Rollback loop. ☹️

github-actions[bot] commented 3 years ago

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 or Discussions for those types of questions.