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

Getting "The serverless deployment bucket does not exist", when the bucket does exist. #6351

Open
colemars opened this issue Jul 9, 2019 · 6 comments

Comments

@colemars
Copy link

colemars commented Jul 9, 2019

Run sls deploy:

Serverless Error ---------------------------------------
 
  The serverless deployment bucket "notes-app-2-api-dev-serverlessdeploymentbucket-n5stychfa7ue" does not exist. Create it manually if you want to reuse the CloudFormation stack "notes-app-2-api-dev", or delete the stack if it is no longer required.

Go to create new bucket:

Screen Shot 2019-07-09 at 11 28 39 AM

Run sls remove:

  Serverless Error ---------------------------------------
 
  The specified bucket does not exist
@colemars
Copy link
Author

I believe this may actually be an issue with S3 not fully deleting buckets immediately, or ever, sometimes.

In that case, the namespace is still owned and it appears in the console but it's empty and unable to be deleted.

@devblueray
Copy link

Found this and wanted to add a comment with my experience. The most common cause I've found is when you try to delete a stack and the delete fails for some reason. If it gets to the S3 bucket resource before it gets to the failure then the bucket will get deleted producing this error if you try to redeploy because the stack already exists. You will need to manually delete the stack because to my knowledge there's no way for serverless to recover once the bucket is gone.

@gauravrai1
Copy link

Deleting the stack form the cloud formation resolved the issue for me thanks @devblueray

@chrisVillanueva
Copy link
Contributor

Just ran into this issue. Here is the log information:

`Serverless: Packaging service...

Serverless Error ---------------------------------------

The serverless deployment bucket "fs-dashboard-dev-serverlessdeploymentbucket-1j077zxpijd1t" does not exist. Create it manually if you want to reuse the CloudFormation stack "fs-dashboard-dev", or delete the stack if it is no longer required.

Get Support --------------------------------------------
Docs: docs.serverless.com

Serverless: Packaging service...

Serverless Error ---------------------------------------

The serverless deployment bucket "fs-dashboard-dev-serverlessdeploymentbucket-1j077zxpijd1t" does not exist. Create it manually if you want to reuse the CloudFormation stack "fs-dashboard-dev", or delete the stack if it is no longer required.

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com

Your Environment Information ---------------------------
Operating System: linux
Node Version: 8.9.4

Serverless: Packaging service...

Serverless Error ---------------------------------------

The serverless deployment bucket "fs-dashboard-dev-serverlessdeploymentbucket-1j077zxpijd1t" does not exist. Create it manually if you want to reuse the CloudFormation stack "fs-dashboard-dev", or delete the stack if it is no longer required.

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com

Your Environment Information ---------------------------
Operating System: linux
Node Version: 8.9.4
Framework Version: 1.71.3
Plugin Version: 3.6.12
SDK Version: 2.3.1

Serverless: Packaging service...

Serverless Error ---------------------------------------

The serverless deployment bucket "fs-dashboard-dev-serverlessdeploymentbucket-1j077zxpijd1t" does not exist. Create it manually if you want to reuse the CloudFormation stack "fs-dashboard-dev", or delete the stack if it is no longer required.

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com

Your Environment Information ---------------------------
Operating System: linux
Node Version: 8.9.4
Framework Version: 1.71.3
Plugin Version: 3.6.12
SDK Version: 2.3.1
Components Version: 2.30.12

child process exited with code 1 and signal null
start S3 Sync
unable to sync: NoSuchBucket: The specified bucket does not exist`

@jcezarms
Copy link

jcezarms commented Jun 7, 2022

Same scenario as #3964, reproducible with the most recent version (3.19.0). There's currently no way to remove a stack with the missing bucket, so it's the exact same issue.

A workaround, using only the CLI:
Look for the missing bucket's name in the output of sls deploy --debug "*" --stage <stage>, following the format:

aws: [AWS s3 404 0.236s 0 retries] headBucket({
  Bucket: 'my-missing-bucket-stage-name-uuid'
})

Afterwards,

# recreate basic bucket
aws s3api create-bucket --bucket <my-missing-bucket-stage-name-uuid> --region <region>

# ensure the bucket is empty to prevent cloudformation from getting stuck in DELETE FAILED:
aws s3 rm s3://<my-missing-bucket-stage-name-uuid> --recursive --region us-east-1

# even if the stack is state-blocked, it should be removable
aws cloudformation delete-stack --stack-name <my-stack> --debug

... and redeploy.

This is a very loose process, so YMMV.

@Zambonilli
Copy link

I was receiving this error as well but my bucket did in fact exist. I deleted the contents of the bucket and ran serverless deploy again and had a successful deployment. Hopefully, this helps someone else from having to delete the full cloudformation stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants