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

On remove of "single-page-app" and "static-website": S3 Bucket deletion is triggered, when the bucket is not yet empty #383

Open
InvisibleKind opened this issue Feb 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@InvisibleKind
Copy link

Description

Recently an error startet to appear, which was not there before: whenever a Stack deletion is triggered through serverless remove the lift still tries to empty the S3 bucket of the single-page-app or static-website construct
But for some reason doesn't wait until the cleanup is finished and triggers the removal of a Bucket itself, which results in an error like:
Resource handler returned message: "The bucket you tried to delete is not empty (Service: S3, Status Code: 409, Request ID: -, Extended Request ID: -)"

The whole output (omitting the hashes and project info):

npx serverless remove --stage=poc

Removing fe-service from stage poc (eu-central-1)
Emptying S3 bucket 'fe-serv-buildpublicbucket' for the 'build_public' static website, else CloudFormation will fail (it cannot delete a non-empty bucket)
Environment: darwin, node 20.11.0, framework 3.38.0 (local), plugin 7.2.0, SDK 4.5.1
Credentials: Local, "default" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
DELETE_FAILED: buildpublicBucket (AWS::S3::Bucket)
Resource handler returned message: "The bucket you tried to delete is not empty (Service: S3, Status Code: 409, Request ID:-, Extended Request ID: -)" (RequestToken: -, HandlerErrorCode: GeneralServiceException)

Serverless Framework: 3.38.0
Lift: 1.28.1

Triggering the same remove command second or third time will empty the bucket and remove the stack completely.

Removing the files from the bucket using AWS Console works without issues.

Average number of files in the S3 Bucket: 1175 objects, 63.1 MB

How to Reproduce

Not sure, what the exact scenario is, but I assume, that you need a project with 1k+ files, deployed either as "single-page-app" or as "static-website".

Additional Information

No response

@InvisibleKind InvisibleKind added the bug Something isn't working label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant