Amplify-cli: amplify push fails after removing a model from schema.graphql

Created on 6 Mar 2019  路  7Comments  路  Source: aws-amplify/amplify-cli

Describe the bug
Can not remove a model from schema.graphql after it was pushed/deployed.

To Reproduce
Steps to reproduce the behavior:

  1. Initial schema.graphql
    ```
    type User @model {
    id: ID!
    invitations: [Invitation] @connection(name: "UserInvitations")
    last_name: String
    first_name: String
    }
type Invitation @model {
  id: ID!
  date: String
  sentTo: User @connection(name: "UserInvitations")
  state: String
}
```

  1. amplify push
  2. Update schema.graphql and remove Invitation
    type User @model { id: ID! last_name: String first_name: String }
  3. amplify push
  4. Update failed with the following error
    Embedded stack [ARN of User stack] was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: Export ******************:GetAtt:UserDataSource:Name cannot be deleted as it is in use by [NAME of ConnectionStack stack]

Expected behavior
Be able to remove models from schema.graphql and push/publish the changes.

Additional context
Tested using the AWS Amplify Console deploy and amplify-cli locally, version 1.1.6.

bug graphql-transformer investigating pending-response

Most helpful comment

We're waiting for this fix, I hope @kstro21 's solution works :)

All 7 comments

Hey can you try deleting the @connection directives first. Perform the push. Then remove the @model type and push again. Let me know if that works.

Hey @mikeparisstuff thanks for the suggestion.

But it doesn't work, the same result. Also, for additional information. After the amplify push failed, I restored the @connection in the schema, then, run amplify push again and it fails again now with the error

No resolver found. Service: AWSAppSync; Status Code: 404; Error Code: NotFoundException

@kstro21 Are you still stuck on this and able to reproduce with the latest version of the CLI? We weren't able to reproduce this behavior on our end.

@kaustavghosh06 I had to deploy to a new env then migrate my data.

Haven't tried it anymore. I will test it again in a new environment and will be back with the feedback.

Hi, @kaustavghosh06 same result. It is not working, but now I think I know the reason and probably will come back with a PR.

@kaustavghosh06 I've added a PR #1182 that will solve this one.

We're waiting for this fix, I hope @kstro21 's solution works :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darrentarrant picture darrentarrant  路  3Comments

adriatikgashi picture adriatikgashi  路  3Comments

YikSanChan picture YikSanChan  路  3Comments

davo301 picture davo301  路  3Comments

amlcodes picture amlcodes  路  3Comments