Skip to content

Instantly share code, notes, and snippets.

@horacioh
Last active May 26, 2019 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save horacioh/c5b3cf64d82b6b22124e39b7c14c4c27 to your computer and use it in GitHub Desktop.
Save horacioh/c5b3cf64d82b6b22124e39b7c14c4c27 to your computer and use it in GitHub Desktop.

I had pushed this schema.graphql:

type Post @model {
  id: ID!
  title: String!
  slug: String!
  content: String!
  createdAt: String!
  actions: [PostHistory] @connection(name: "PostHistory", sortField: "createdAt")
}
type PostHistory @model {
  id: ID!
  postId: ID!
  createdAt: String
  payload: Post @connection(name: "PostHistory", sortField: "createdAt")
}

and then I wanted to change to this new schema:

type Post @model {
  id: ID!
  title: String!
  slug: String!
  content: String!
  actions: [PostHistory]
}
type PostHistory @model {
  id: ID!
  postId: ID!
  creator: String!
  createdAt: String
  payload: HistoryPayload
}

type HistoryPayload {
  title: String
  slug: String
  content: String
}

and I got this error when I tried to push the update schema (check 02_error-log.txt)

I saw a some issues with the sort of same error and what I did was to modify the schema to delete all the connections first and then add the new fields, but I got the same error. here's the schema I tried to push on the first step (delete connections):

type Post @model {
  id: ID!
  title: String!
  slug: String!
  content: String!
  createdAt: String!
}
type PostHistory @model {
  id: ID!
  postId: ID!
  createdAt: String
}

what I end up doing was amplify delete and re-create again. This is fine for test projects but for production projects this is something I will not be able to do. any suggestions on where to start looking for solutions to avoid this situation with a real project?

thanks!

| -> amplify push
Current Environment: dev
| Category | Resource name | Operation | Provider plugin |
| -------- | -------------------- | --------- | ----------------- |
| Api | postsactivityamplify | Update | awscloudformation |
? Are you sure you want to continue? Yes
GraphQL schema compiled successfully.
Edit your schema at /Users/horacio/workspace/playground/posts-activity-amplify-example/amplify/backend/api/postsactivityamplify/schema.graphql or place .graphql files in a directory at /Users/horacio/workspace/playground/posts-activity-amplify-example/amplify/backend/api/postsactivityamplify/schema
? Do you want to update code for your updated GraphQL API Yes
? Do you want to generate GraphQL statements (queries, mutations and subscription) based on your schema
types? This will overwrite your current graphql queries, mutations and subscriptions Yes
⠦ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS postsactivityamplify-20190525234721 AWS::CloudFormation::Stack Mon May 27 2019 01:34:52 GMT+0200 (CEST) User Initiated
⠧ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS apipostsactivityamplify AWS::CloudFormation::Stack Mon May 27 2019 01:34:58 GMT+0200 (CEST)
⠇ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77 AWS::CloudFormation::Stack Mon May 27 2019 01:34:59 GMT+0200 (CEST) User Initiated
⠏ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS GraphQLAPIKey AWS::AppSync::ApiKey Mon May 27 2019 01:35:08 GMT+0200 (CEST)
⠇ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS GraphQLSchema AWS::AppSync::GraphQLSchema Mon May 27 2019 01:35:08 GMT+0200 (CEST)
⠏ Updating resources in the cloud. This may take a few minutes...
UPDATE_COMPLETE GraphQLAPIKey AWS::AppSync::ApiKey Mon May 27 2019 01:35:09 GMT+0200 (CEST)
⠙ Updating resources in the cloud. This may take a few minutes...
UPDATE_COMPLETE GraphQLSchema AWS::AppSync::GraphQLSchema Mon May 27 2019 01:35:21 GMT+0200 (CEST)
⠧ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS PostHistory AWS::CloudFormation::Stack Mon May 27 2019 01:35:25 GMT+0200 (CEST)
UPDATE_IN_PROGRESS Post AWS::CloudFormation::Stack Mon May 27 2019 01:35:26 GMT+0200 (CEST)
⠼ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-PostHistory-1SSVCRDWABKJA AWS::CloudFormation::Stack Mon May 27 2019 01:35:26 GMT+0200 (CEST) User Initiated
UPDATE_ROLLBACK_IN_PROGRESS postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-PostHistory-1SSVCRDWABKJA AWS::CloudFormation::Stack Mon May 27 2019 01:35:28 GMT+0200 (CEST) Export yrt53loec5aclcvoqkf7cs3bsm:GetAtt:PostHistoryDataSource:Name cannot be deleted as it is in use by postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7-ConnectionStack-1IOR20OK59NRY
⠦ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-Post-LD6TAMTMRRKC AWS::CloudFormation::Stack Mon May 27 2019 01:35:26 GMT+0200 (CEST) User Initiated
⠴ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_IN_PROGRESS postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-Post-LD6TAMTMRRKC AWS::CloudFormation::Stack Mon May 27 2019 01:35:29 GMT+0200 (CEST) Export yrt53loec5aclcvoqkf7cs3bsm:GetAtt:PostDataSource:Name cannot be deleted as it is in use by postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7-ConnectionStack-1IOR20OK59NRY
⠋ Updating resources in the cloud. This may take a few minutes...
UPDATE_FAILED PostHistory AWS::CloudFormation::Stack Mon May 27 2019 01:35:37 GMT+0200 (CEST) Embedded stack arn:aws:cloudformation:eu-west-1:115238827609:stack/postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-PostHistory-1SSVCRDWABKJA/abf67420-8008-11e9-8163-020193028d12 was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: Export yrt53loec5aclcvoqkf7cs3bsm:GetAtt:PostHistoryDataSource:Name cannot be deleted as it is in use by postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7-ConnectionStack-1IOR20OK59NRY
UPDATE_FAILED Post AWS::CloudFormation::Stack Mon May 27 2019 01:35:37 GMT+0200 (CEST) Embedded stack arn:aws:cloudformation:eu-west-1:115238827609:stack/postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-Post-LD6TAMTMRRKC/9740e720-7f38-11e9-bf0f-0673b71e51da was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: Export yrt53loec5aclcvoqkf7cs3bsm:GetAtt:PostDataSource:Name cannot be deleted as it is in use by postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7-ConnectionStack-1IOR20OK59NRY
⠏ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_IN_PROGRESS postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77 AWS::CloudFormation::Stack Mon May 27 2019 01:35:38 GMT+0200 (CEST) The following resource(s) failed to update: [PostHistory, Post].
⠋ Updating resources in the cloud. This may take a few minutes...
UPDATE_FAILED apipostsactivityamplify AWS::CloudFormation::Stack Mon May 27 2019 01:35:46 GMT+0200 (CEST) Embedded stack arn:aws:cloudformation:eu-west-1:115238827609:stack/postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77/898c24f0-7f38-11e9-b4fb-02a08d23d630 was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: The following resource(s) failed to update: [PostHistory, Post].
⠏ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_IN_PROGRESS postsactivityamplify-20190525234721 AWS::CloudFormation::Stack Mon May 27 2019 01:35:47 GMT+0200 (CEST) The following resource(s) failed to update: [apipostsactivityamplify].
⠧ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS apipostsactivityamplify AWS::CloudFormation::Stack Mon May 27 2019 01:36:09 GMT+0200 (CEST)
⠸ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS GraphQLAPIKey AWS::AppSync::ApiKey Mon May 27 2019 01:36:39 GMT+0200 (CEST)
UPDATE_IN_PROGRESS GraphQLSchema AWS::AppSync::GraphQLSchema Mon May 27 2019 01:36:39 GMT+0200 (CEST)
UPDATE_COMPLETE GraphQLAPIKey AWS::AppSync::ApiKey Mon May 27 2019 01:36:41 GMT+0200 (CEST)
⠴ Updating resources in the cloud. This may take a few minutes...
UPDATE_COMPLETE GraphQLSchema AWS::AppSync::GraphQLSchema Mon May 27 2019 01:36:53 GMT+0200 (CEST)
UPDATE_IN_PROGRESS PostHistory AWS::CloudFormation::Stack Mon May 27 2019 01:36:54 GMT+0200 (CEST)
UPDATE_IN_PROGRESS Post AWS::CloudFormation::Stack Mon May 27 2019 01:36:54 GMT+0200 (CEST)
⠼ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-Post-LD6TAMTMRRKC AWS::CloudFormation::Stack Mon May 27 2019 01:37:09 GMT+0200 (CEST)
⠦ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-PostHistory-1SSVCRDWABKJA AWS::CloudFormation::Stack Mon May 27 2019 01:37:10 GMT+0200 (CEST)
⠧ Updating resources in the cloud. This may take a few minutes...
UPDATE_COMPLETE Post AWS::CloudFormation::Stack Mon May 27 2019 01:37:17 GMT+0200 (CEST)
UPDATE_COMPLETE PostHistory AWS::CloudFormation::Stack Mon May 27 2019 01:37:17 GMT+0200 (CEST)
⠋ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77 AWS::CloudFormation::Stack Mon May 27 2019 01:37:20 GMT+0200 (CEST)
⠸ Updating resources in the cloud. This may take a few minutes...
UPDATE_COMPLETE apipostsactivityamplify AWS::CloudFormation::Stack Mon May 27 2019 01:37:28 GMT+0200 (CEST)
⠹ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS postsactivityamplify-20190525234721 AWS::CloudFormation::Stack Mon May 27 2019 01:37:28 GMT+0200 (CEST)
UPDATE_IN_PROGRESS apipostsactivityamplify AWS::CloudFormation::Stack Mon May 27 2019 01:37:30 GMT+0200 (CEST)
⠙ Updating resources in the cloud. This may take a few minutes...
UPDATE_IN_PROGRESS Post AWS::CloudFormation::Stack Mon May 27 2019 01:37:32 GMT+0200 (CEST)
UPDATE_IN_PROGRESS PostHistory AWS::CloudFormation::Stack Mon May 27 2019 01:37:32 GMT+0200 (CEST)
⠧ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-PostHistory-1SSVCRDWABKJA AWS::CloudFormation::Stack Mon May 27 2019 01:37:33 GMT+0200 (CEST)
⠋ Updating resources in the cloud. This may take a few minutes...
UPDATE_COMPLETE PostHistory AWS::CloudFormation::Stack Mon May 27 2019 01:37:43 GMT+0200 (CEST)
UPDATE_COMPLETE Post AWS::CloudFormation::Stack Mon May 27 2019 01:37:43 GMT+0200 (CEST)
UPDATE_ROLLBACK_COMPLETE postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77 AWS::CloudFormation::Stack Mon May 27 2019 01:37:43 GMT+0200 (CEST)
⠴ Updating resources in the cloud. This may take a few minutes...
UPDATE_ROLLBACK_COMPLETE postsactivityamplify-20190525234721-apipostsactivityamplify-1BX265LOA7C77-Post-LD6TAMTMRRKC AWS::CloudFormation::Stack Mon May 27 2019 01:37:33 GMT+0200 (CEST)
⠹ Updating resources in the cloud. This may take a few minutes...
UPDATE_COMPLETE apipostsactivityamplify AWS::CloudFormation::Stack Mon May 27 2019 01:37:52 GMT+0200 (CEST)
UPDATE_ROLLBACK_COMPLETE postsactivityamplify-20190525234721 AWS::CloudFormation::Stack Mon May 27 2019 01:37:52 GMT+0200 (CEST)
⠴ Updating resources in the cloud. This may take a few minutes...Error updating cloudformation stack
⠦ Updating resources in the cloud. This may take a few minutes...
Following resources failed
✖ An error occurred when pushing the resources to the cloud
Resource is not in the state stackUpdateComplete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment