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 when renaming buckets "The bucket you tried to delete is not empty" #76

Open
ricokahler opened this issue Aug 30, 2020 · 1 comment

Comments

@ricokahler
Copy link

If I rename my bucket in my serverless config, it fails to delete the previous bucket causing the deploy to fail.

An error occurred: AssetsBucket - The bucket you tried to delete is not empty (Service: Amazon S3; Status Code: 409; Error Code: BucketNotEmpty;

For more context, I am creating the bucket in the serverless config as well.


Is this behavior intended? Is there anyway I can work around this? Thanks for any guidance!

@coyoteecd
Copy link
Contributor

@ricokahler I know is 1.5 years late, but I had the same issue and resorted to adding the functionality in another plugin (serverless-s3-remover, which is unmaintained and I migrated to https://github.com/coyoteecd/serverless-s3-cleaner

You have there a bucketsToCleanOnDeploy option which you can use with the "old" bucket name.
To prevent serverless-s3-sync plugin from conflicting with the cleaner plugin, I use sls remove --nos3sync option. Basically I let serverless-s3-sync to handle bucket updates, and the serverless-s3-cleaner to handle bucket cleanups.

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

No branches or pull requests

2 participants