Skip to content

Deployment failed for SuperStarStack, CloudFormation status is UPDATE_ROLLBACK_COMPLETE

0

My first deployment failed with "UPDATE_FAILED" and "UPDATE_ROLLBACK_FAILED" status, error message: Error occurred during operation 'Duplicate key ... (attempted merging values DependencyDefinition(fqen=...) and DependencyDefinition(fqen=...)) (Service: SuperStar, Status Code: 500)

I fixed the error by making a code change to CDK package. Then I redeployed but it shows the same Duplicate Key error. It seems to be stuck in "UPDATE_ROLLBACK_FAILED". So I tried a solution that seemed to work for some people: skip the failed resource in CloudFormation by clicking "Continue update rollback" button in the Stack Action.

The failed resource are marked as "UPDATE_COMPLETE" and the status become "UPDATE_ROLLBACK_COMPLETE".

However, the error is still there and I am not sure how to address it. Any suggestions would be very appreciated!

1 Answer
0

Based on the information provided, it seems you've encountered a complex issue with your CloudFormation stack deployment. Let's break down the problem and suggest some steps to resolve it:

  1. Initial Deployment Failure: Your first deployment failed with an "UPDATE_FAILED" status, followed by an "UPDATE_ROLLBACK_FAILED" status. This indicates that not only did the update fail, but the automatic rollback also encountered issues.

  2. Error Message: The error message suggests a problem with duplicate keys in your SuperStar service. This could be related to your CDK package configuration.

  3. Code Fix and Redeployment: You made changes to your CDK package to address the error, but upon redeployment, you encountered the same duplicate key error. This suggests that either the fix didn't fully address the issue, or the stack is still in a state where it can't apply the new changes.

  4. Rollback Continuation: You used the "Continue update rollback" option in CloudFormation, which is a good step when dealing with UPDATE_ROLLBACK_FAILED states. This action attempts to roll back resources that failed during the initial rollback.

  5. Current State: The stack is now in an UPDATE_ROLLBACK_COMPLETE state, which means CloudFormation successfully rolled back to the last known good state. However, the underlying issue still persists.

To address this situation, consider the following steps:

  1. Review your CDK code thoroughly: Ensure that the changes you made fully address the duplicate key issue. Look for any places where you might be defining dependencies or resources with the same identifiers.

  2. Clean up the stack: Since you're in an UPDATE_ROLLBACK_COMPLETE state, you might need to start fresh. Consider deleting the stack entirely and redeploying from scratch. This can help eliminate any lingering issues from the failed updates.

  3. Incremental deployment: If possible, try deploying your changes incrementally. Start with a minimal stack and gradually add resources. This can help isolate where the problem is occurring.

  4. Check for resource retention: Ensure that no resources are being retained that might be causing conflicts with your new deployment. Sometimes, resources marked for retention can cause issues during updates.

  5. Verify IAM permissions: Make sure your IAM role has sufficient permissions to perform all the necessary actions in your stack.

  6. CloudWatch Logs: Check the CloudWatch logs for your Lambda functions or other resources that might provide more detailed error information.

  7. Use CloudFormation drift detection: This can help identify if any resources have been changed outside of CloudFormation, which might be contributing to the deployment issues.

If the problem persists after trying these steps, you may need to engage AWS support for more in-depth troubleshooting, as the issue could be related to the specific behavior of the SuperStar service or complex interactions within your stack.

Remember, when dealing with complex CloudFormation issues, it's often helpful to simplify and isolate the problem as much as possible before attempting to deploy the full stack again.
Sources
Troubleshooting AWS CloudFormation StackSets - AWS CloudFormation
Continue rolling back an update - AWS CloudFormation
Choose how to handle failures when provisioning resources - AWS CloudFormation

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.