Skip to content

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

Open

Description

@colemars

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

Activity

  1. colemars commented on Jul 21, 2019

    @colemars
    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.

  2. devblueray commented on Sep 3, 2019

    @devblueray

    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.

  3. gauravrai1 commented on Sep 6, 2019

    @gauravrai1

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

  4. chrisVillanueva commented on May 30, 2020

    @chrisVillanueva
    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`

  5. jcezarms commented on Jun 7, 2022

    @jcezarms

    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.

  6. Zambonilli commented on Dec 15, 2022

    @Zambonilli

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions