Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while re-deploying a stack that is ROLLBACK_COMPLETE state #8126

Closed
nija-at opened this issue May 21, 2020 · 2 comments · Fixed by #8948
Closed

Error while re-deploying a stack that is ROLLBACK_COMPLETE state #8126

nija-at opened this issue May 21, 2020 · 2 comments · Fixed by #8948
Assignees
Labels
bug This issue is a bug. package/tools Related to AWS CDK Tools or CLI

Comments

@nija-at
Copy link
Contributor

nija-at commented May 21, 2020

This occurs once when a stack is in ROLLBACK_COMPLETE and a cdk deploy command is issued to attempt another deployment. Retrying cdk deploy succeeds.

As far as I can tell this is not a race condition since this occurs no matter how long you wait between the stack going into ROLLBACK_COMPLETE and the issuance of the deploy command.

Reproduction Steps

  1. Create a stack via cdk deploy that is going to throw an error from CloudFormation during deployment. The stack should end up in a ROLLBACK_COMPLETE state.
  2. Re-issue the cdk deploy and the above error should show up.

A second retry of cdk deploy will succeed.

Error Log

Error message when running cdk deploy --app <path to js file> -

integ-user-pool-idp-social: deploying...
integ-user-pool-idp-social: creating CloudFormation changeset...

 ❌  integ-user-pool-idp-social failed: Error [ValidationError]: Stack [integ-user-pool-idp-social] does not exist
    at Request.extractError (/Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/protocol/query.js:50:29)
    at Request.callListeners (/Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/nija/.nvm/versions/node/v12.16.3/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
  code: 'ValidationError',
  time: 2020-05-21T10:45:53.471Z,
  requestId: '7b0e67c1-d3f0-4a60-bee0-722fec9fb71e',
  statusCode: 400,
  retryable: false,
  retryDelay: 290.0758012593673
}
Stack [integ-user-pool-idp-social] does not exist

Environment

  • CLI Version: 1.38.0
  • OS: OSX 10.14

This is 🐛 Bug Report

@nija-at nija-at added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 21, 2020
@SomayaB SomayaB added package/tools Related to AWS CDK Tools or CLI and removed needs-triage This issue or PR still needs to be triaged. labels May 26, 2020
@nija-at nija-at assigned shivlaks and unassigned nija-at May 27, 2020
@shivlaks
Copy link
Contributor

duplicate of #7340 and fixed by #8164 as of 1.42.0

@eladb
Copy link
Contributor

eladb commented Jun 29, 2020

I am still running a similar issue (albeit with a different error message) in 1.45.0:

  1. Deployed a stack
  2. Tried to update, it failed and rolled back successfully. Now the status is ROLLBACK_COMPLETE
  3. Try to update but the CLI fails with The stack named ... is in a failed state

From a quick inspection, it seems like the isSuccess property in stack-status.ts deems any stack with the word ROLLBACK in it's state to be unhealthy, which is not the case for ROLLBACK_COMPLETE.

I think the code in stack-status.ts has a few other issues. For example, the isCreationFailure property returns true only based on whether the status is ROLLBACK_*, and does not even check if the status was COMPLETE_FAILED at some point in the past.

This is a major issue - being unable to update a stack that is in ROLLBACK_COMPLETE is a huge blocker for users.

@eladb eladb reopened this Jun 29, 2020
@eladb eladb added p1 and removed p1 labels Jun 29, 2020
shivlaks added a commit that referenced this issue Jul 8, 2020
The CLI determined that a stack in UPDATE_ROLLBACK_COMPLETE
status is not updatable.

This change cleans up this logic so that a stack update will fail
only if the stack is in _FAILED status, which is a non-updatable state.

Closes #8126 #5151
@mergify mergify bot closed this as completed in #8948 Jul 17, 2020
mergify bot pushed a commit that referenced this issue Jul 17, 2020
Supersedes #8779

The CLI determined that a stack in `UPDATE_ROLLBACK_COMPLETE`
status is not updateable. related [comment](#8779 (comment))

This change modifies this logic by splitting up `waitForStack` into `waitForStackDelete`
and `waitForStackDeploy` which evaluate stack status after it reaches a stable state
depending on the operation that was performed.



Closes #8126 #5151

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
curtiseppel pushed a commit to curtiseppel/aws-cdk that referenced this issue Aug 11, 2020
Supersedes aws#8779

The CLI determined that a stack in `UPDATE_ROLLBACK_COMPLETE`
status is not updateable. related [comment](aws#8779 (comment))

This change modifies this logic by splitting up `waitForStack` into `waitForStackDelete`
and `waitForStackDeploy` which evaluate stack status after it reaches a stable state
depending on the operation that was performed.



Closes aws#8126 aws#5151

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. package/tools Related to AWS CDK Tools or CLI
Projects
None yet
4 participants