#UPDATE_ROLLBACK_IN_PROGRESS stuck status

10 messages · Page 1 of 1 (latest)

south moss
#

I have an Amplify app, but when I deploy a new version, the build is timing out. When I check CloudFormation, one of the nested stacks is in the status UPDATE_ROLLBACK_IN_PROGRESS. Any ideas why this error is occurring?

gaunt wave
#

👋 this typically pops up when a deployment fails or something like a container failed to start -- this would cause the container to loop until CFN timed out. If you look at the nested stack in question and look through the events for a failure, does it give a decent reason?

south moss
#

Yes I have a custom resource that failed to deploy. when I click in Detect root cause I see the reason (I added the xxxx to clean the names): Embedded stack arnawscloudformation:us-east-1xxxstack/amplify-xxxxxxxxx-customcustomResource/xxxxx was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: The following resource(s) failed to update: [AllowBucketNotificationsTolakeFileTriggerFunctionReferences, xxxxxxNotificationsxxxxx, xxxxxxxxxPolicy19C94EDF]. When I go to the nested stack the last event is in UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS . The failed reason of the nested stack is: Received response status [FAILED] from custom resource. Message returned: Error: An error occurred (InvalidArgument) when calling the PutBucketNotificationConfiguration operation: Unable to validate the following destination configurations. See the details in CloudWatch Log Stream: 2024/02/07/[$LATEST]xxxx . Any ideas how can I solve this?

#

When I try to re deploy the Amplify App, it fails after 3 min with the reason: ["Index: 0 State: {"deploy":"deploying"} Message: Stack:arn:aws:cloudformation:us-east-1❌xxxxxxxxxxxxxxxstack/amplify-xxxxxxxx is in UPDATE_COMPLETE_CLEANUP_IN_PROGRESS state and can not be updated."]

gaunt wave
#
Error: An error occurred (InvalidArgument) when calling the PutBucketNotificationConfiguration operation: Unable to validate the following destination configurations

this is an interesting error. What does the custom resource do? is this using a Function to ingest some data and send to S3? Are you using S3 from amplify add storage?

south moss
#

I just solve the error. and the cause is weird, let me explain. I have 2 s3 bukcets, the first one (added with amplify add storage) and I have another s3 bucket added as a custom resourse. (i have 2 buckets becasuse I wanted to separete business logic permissions, etc).

#

I have a Imabda function (added as amplify add function). In the custom resource I have defined the s3 bucket and a trigger (bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new notifications.LambdaDestination(importedLambda))) with the lambda function imported with the AmplifyDependentResourcesAttributes

#

Seems like when the Stack update fails, I assume maybe because the lambda function does not exist yet when the notification of the custom resourse is being created,

#

If I delete the bucket.addEventNotification the stack update works without error. And in the next stack update I can add the addEventNotification and it works without error (because the lambda function is already created in the previous push)

#

The question is, what is the order of the stack resourses when they are being created? is this problem related because I am combining a lambda function created with the amplify add function and a s3 bucket created as a custom resource?