serverless: No Such Bucket

I am getting this error after attempting to sls deploy:

No Such Bucket -----------------------------------------

 The specified bucket does not exist

 For debugging logs, run again after setting SLS_DEBUG env var.

Stack Trace --------------------------------------------

NoSuchBucket: The specified bucket does not exist at Request.extractError (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/services/s3.js:524:35) at Request.callListeners (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:105:20) at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:77:10) at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:615:14) at Request.transition (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:14:12) at /usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:38:9) at Request.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:617:12) at Request.callListeners (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:115:18) at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/sequential_executor.js:77:10) at Request.emit (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:615:14) at Request.transition (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:14:12) at /usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/aws-sdk/lib/request.js:38:9)

I have been searching all over for a way to “clean” my environment or any fix for this. It has been very confusing because I saw some similar issues for 0.5 but I don’t believe that they apply to V1 (For instance, removing the _meta folder- which I can not find). The way that I got to this issue is that I previously could not deploy my lambda functions- therefore I deleted my functions and then the buckets. How do I create these bucket the way serverless initially create them?

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

 Please report this error. We think it might be a bug.

Bug Report Template -----------------------------------------------

Serverless Framework Version:
Operating System:
Expected Behavior:
Actual Behavior:
Stack-Trace (Optional):

Feature Request Template ------------------------------------------

Feature Request:
Benefits:
  • Benefit one…
Drawbacks:
  • Drawback one…
Additional Details:

Discussion template ----------------------------------------------

TLDR:
Discussion:

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 26 (7 by maintainers)

Most upvoted comments

I had the exact same issue as @lindekaer and was able to get around the error by logging in to the AWS console and manually deleting the cloud formation for my service and rerunning the deploy command after that. Hope that at least helps to get around the issue.

PSA to those landing here. You probably manually deleted your Serverless S3 bucket. To solve the problem delete the related CloudFormation as suggested by @njeirath and make sure it’s deleted as suggested by @TomDeMille.

@flomotlik or moderator. Please lock this conversation. A new issue may be opened for those who have other problems.

@flomotlik All the rights were there. I am using full admin rights. This occurred after I deleted the buckets from S3. I am new to AWS/Lambda and serverless so I may get some terminology/understanding wrong but this is what I have observed: I wanted to change the name of the service from aws-nodejs to my custom name. Additionally, I wanted to change the region. After I made those changes then I received and error that my functions could not be updated. (after an sls deploy). So this is when I deleted the functions and the associated api-gateway. I went back to deploy and I still couldn’t - so I thought that I could clean things up if I deleted the associated S3 buckets. After doing this, the above error arose.

However, I was able to fix it this way. I created a new project with create and was able to deploy with a a new service name. I then went back to my old project and deployed functions to the newly created custom service. It appears that serverless (or something) is holding on the historical names of buckets etc. Hope some of this helps— it’s working for me now.

I have had this and generally it’s because there is still a cloudformation script in AWS with ‘delete failed’.

You just need to fix that by manually deleting it.

In my case I had IAM create role but not IAM delete role, so the cloud formation script was hung up in ‘failed delete’.

I went in as a user with admin rights, manually ran ‘delete’ on it, waited till it completed and then was able to install (also I fixed the IAM permissions on the CLI user account)

It’d be nice if it at least said that it was the deployment bucket that does not exist. I just spent twenty minutes trying to figure out what happened to my deployment. Because I tied my API to an API Mapping serverless / CF could not delete me stack and serverless errored out on remove. But since CF removed the deployment bucket already any thing I ran failed. As a new-ish user to serverless it took me longer than it should have to figure out what bucket was in question.

actually it seems that any time the deployment fails in CFN, you cannot deploy again afterwards. eg. Any time the CFN stack is in ROLLBACK_COMPLETE state, you cannot deploy afterwards without blasting the stack away manually.

For instance, this error below on first deploy will cause the second deploy to fail with the “bucket does not exist” error.

C:\Users\chrisd\Documents\GitHub\uca_ux>sls deploy --stage chrisd --region ap-southeast-2                                                                                                                                                                                    
Serverless: Creating Stack...                                                                                                                                                                                                                                                
Serverless: Checking Stack create progress...                                                                                                                                                                                                                                
............Serverless: Deployment failed!                                                                                                                                                                                                                                   

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

     An error occurred while provisioning your stack: DNSEntryForStages                                                                                                                                                                                                      
     - No hosted zones named ir-lagrange.com. found.                                                                                                                                                                                                                         

  Stack Trace --------------------------------------------      

Deploying next time around, I get this:


e
  Serverless Error ---------------------------------------                                                                                                                                                                                                                   

     The specified bucket does not exist                                                                                                                                                                                                                                     

  Stack Trace --------------------------------------------   

@flomotlik I don’t think this issue should be closed, I think Serverless should do something more logical if the deployment bucket does not exist.

So I don’t think this issue should be resolved unless @Savalas’s work around is an expected behavior… and even still, the resulting error message is pretty bad.

If I delete a cloudformation associated with a serverless project and attempt to redeploy with that same project name, I see “The specified bucket does not exist”.

In my opinion, you should be able to redeploy with the same name after you’ve wiped a stack.

I fell into a related issue. My colleague once ago deployed the app at us-east-1 (he removed the bucket, but forgot to remove the CloudFormation stack). Lately we started using sa-east-1. When I decided to deploy the app back to us-east-1, the error message was: “The specified bucket does not exist”.

It would be cool if we got clearer messages from serverless.

What if the sls displays a message describing all the identified resources when a error is thrown?

I manually deleted my stack in the cloudformation UI and still get this error. It’s no longer in my list of stacks so I assume it ran ok, though I did have to force the delete in the popup.

Giving it a new stage: name fixed it.

@flomotlik I just have an update - I have just done the following actions leading to the same problem:

sls deploy (re-deploying an application)

Serverless: Creating Stack...
Serverless: Checking Stack create progress...

From here it simply hangs forever. I then kill the process. When trying to sls deploy again I get the error:

Serverless: Packaging service...

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

     The specified bucket does not exist

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

  Your Environment Infomation -----------------------------
     OS:                 darwin
     Node Version:       6.5.0
     Serverless Version: 1.0.2

Also, the same error is shown if I go to another serverless project and run sls deploy

I hope I can avoid recreating the project every time this occurs. Hope it can help as to what might be the issue!

@flomotlik thx for your quick reply. I just tried creating and deploying a new project running:

sls create --template aws-nodejs --path sls-test --name cool-service cd sls-test sls deploy

This works, thanks!

When you say make sure stack is removed, do you then mean to verify that I have no S3 buckets?