serverless
serverless copied to clipboard
Getting "The serverless deployment bucket does not exist", when the bucket does exist.
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:
Run sls remove:
Serverless Error ---------------------------------------
The specified bucket does not exist
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.
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.
Deleting the stack form the cloud formation resolved the issue for me thanks @devblueray
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`
Same scenario as https://github.com/serverless/serverless/issues/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.
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.