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

UX improvement: Displaying the rollback reason after stack goes into failed state #687

Merged

Conversation

GarisonLotus
Copy link
Contributor

This is something that's slightly bothered me for a while, but not enough for me to do something about it. I've always wanted stacker to display the reason for a roll back.

This PR includes a new function in the default provider that returns the rollback reason, which is now called via the build action when a failure occurs. Stacker will display the reason after either ROLLBACK_COMPLETE or UPDATE_ROLLBACK_COMPLETE.

Tested both creating a new stack that fails as well as updating a deployed stack with multiple rollback reasons due to more than one failed update to the same stack. Both show the latest event failure reason.

⇒  stacker build -i ./us-east-1.env ./create_failed_test.yaml -r us-east-1
[2018-12-06T19:41:28] Using interactive AWS provider mode.
The "cbdvxkjnkejcbs-error-test2" stack is in a failed state (ROLLBACK_COMPLETE).
It cannot be updated, but it can be deleted and re-created.
All its current resources will IRREVERSIBLY DESTROYED.
Proceed carefully!

Execute the above changes? [y/n] y
[2018-12-06T19:41:33] Destroying stack "cbdvxkjnkejcbs-error-test2" for re-creation
[2018-12-06T19:41:33] error-test2: submitted (destroying stack for re-creation)
[2018-12-06T19:41:36] cbdvxkjnkejcbs-error-test changes:
Parameters Modified: VpcId
Replacements:
- Modify SecurityGroup (AWS::EC2::SecurityGroup)
Execute the above changes? [y/n/v] y
[2018-12-06T19:41:37] error-test: submitted (updating existing stack)
[2018-12-06T19:42:05] error-test2: submitted (creating new stack)
[2018-12-06T19:42:08] cbdvxkjnkejcbs-error-test Stack Roll Back Reason: Parameter validation failed: parameter value vpc-garisonwi for parameter name VpcId does not exist
[2018-12-06T19:42:08] error-test: failed (updating existing stack)
[2018-12-06T19:42:35] cbdvxkjnkejcbs-error-test2 Stack Roll Back Reason: Parameter validation failed: parameter value vpc-c7d4adbh for parameter name VpcId does not exist. Rollback requested by user.
[2018-12-06T19:42:35] error-test2: failed (creating new stack)
[2018-12-06T19:42:35] The following steps failed: error-test, error-test2

@GarisonLotus GarisonLotus force-pushed the display_rollback_error branch from 0d839d6 to 409e24f Compare December 7, 2018 04:08
@russellballestrini
Copy link
Member

russellballestrini commented Dec 7, 2018

@GarisonLotus amazing this will save me from having to open the CloudFormation console on failures!

@GarisonLotus
Copy link
Contributor Author

I'm looking into the two failing tests now.

@GarisonLotus GarisonLotus force-pushed the display_rollback_error branch from 5d8bf4d to f1faa2b Compare December 12, 2018 00:58
@GarisonLotus GarisonLotus force-pushed the display_rollback_error branch from f1faa2b to 5728f0a Compare December 12, 2018 01:02
@GarisonLotus
Copy link
Contributor Author

@russellballestrini - I mocked sample event data in tests so they would pass with the new function.

@russellballestrini russellballestrini merged commit 6f3485f into cloudtools:master Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants