serverless-graphql: The specified bucket does not exist

Please help me. I try to deploy serverless but this error appear when try to excecute

serverless --stage=production deploy 

into npm run deploy:api step

here is the cli output

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

     The specified bucket does not exist

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

  Your Environment Information -----------------------------
     OS:                 darwin
     Node Version:       6.2.0
     Serverless Version: 1.4.0

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 11
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Try deleting the stack from CloudFormation and redeploying - that got me over this hump.

This is just a general comment but when you deliver back error messages to the user, please try to include the proper name of what doesn’t exist. That is, if a bucket doesn’t exist you should say WHAT THE BUCKET NAME IS.

Also, passing --verbose does nothing. A command line tool is supposed to be a user interface, not a hurdle.

It would be really valuable that the bucket name is included in the error message.

Getting the same issue and i checked that the bucket does exist.

Deleting the stack from CF is not a solution and the framework should provide better fallback.

This can happen if you manually delete the S3 bucket rather than deleting it via Serverless/CloudFormation. See: https://github.com/serverless/serverless/issues/1877

I would like to reopen this issue. It is fairly easy to arrive at this situation and this has happened to me numerous times over the past few months. I’ve never been able to identify exactly how to cause it or to fix it. The error message Serverless yields is useless. At the very minimum, the bucket name needs to be included in the error.

I had deleted the s3 bucket long ago and was getting Unhandled rejection ServerlessError: The specified bucket does not exist. The cloudtrail was too old to show the bucket name.

I did sls info -v -s prod and found the ServerlessDeploymentBucketName … 👍

Deleting the cloudformation template might not be a good solution. The next deployment will create a new api-gateway deployment with different id, which will change the url(might not matter if you are using cnames). The better solution which worked for me was:

  • go to cloudtrail and select s3 resource to check the deleted bucket name. You don’t need this if you have some other way of knowing the bucket name.
  • create a bucket with same name.
  • retrigger deployment

Looks like serverless use the bucket just for backup. It worked for me.

Try deleting the stack from CloudFormation and redeploying

This worked for me, too. Thanks.