{"record":{"id":"b9618eec7785d88f","repo":"serverless/serverless","slug":"deployment-bucket-not-found","errorCode":"DEPLOYMENT_BUCKET_NOT_FOUND","errorMessage":"Could not locate deployment bucket: \"${this.bucketName}\". Error: ${err.message}","messagePattern":"Could not locate deployment bucket: \"(.+?)\"\\. Error: (.+?)","errorType":"exception","errorClass":"ServerlessError","httpStatus":null,"severity":"error","filePath":"packages/serverless/lib/plugins/aws/deploy/lib/ensure-valid-bucket-exists.js","lineNumber":35,"sourceCode":"        err.providerError?.code !== 'ValidationError' ||\n        !err.message.includes('does not exist for stack')\n      ) {\n        throw err\n      }\n    }\n\n    // Validate that custom deployment bucket exists and has proper location\n    if (\n      this.serverless.service.provider.deploymentBucket ||\n      this.globalDeploymentBucketUsed\n    ) {\n      let result\n      try {\n        result = await this.provider.request('S3', 'getBucketLocation', {\n          Bucket: this.bucketName,\n        })\n      } catch (err) {\n        throw new ServerlessError(\n          `Could not locate deployment bucket: \"${this.bucketName}\". Error: ${err.message}`,\n          'DEPLOYMENT_BUCKET_NOT_FOUND',\n        )\n      }\n\n      if (result.LocationConstraint == null || result.LocationConstraint === '')\n        result.LocationConstraint = 'us-east-1'\n      if (result.LocationConstraint === 'EU')\n        result.LocationConstraint = 'eu-west-1'\n      if (result.LocationConstraint !== this.provider.getRegion()) {\n        throw new ServerlessError(\n          'Deployment bucket is not in the same region as the lambda function',\n          'DEPLOYMENT_BUCKET_INVALID_REGION',\n        )\n      }\n      // If above is satisfied, then custom S3 bucket is valid\n      return\n    }","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/serverless/serverless/blob/b9d7ea51c8cce57cff1207964b9b71123673081f/packages/serverless/lib/plugins/aws/deploy/lib/ensure-valid-bucket-exists.js#L17-L53","documentation":"Error \"Could not locate deployment bucket: \"${this.bucketName}\". Error: ${err.message}\" thrown in serverless/serverless.","triggerScenarios":"Thrown at packages/serverless/lib/plugins/aws/deploy/lib/ensure-valid-bucket-exists.js:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the deployment bucket name and that it exists in your account, and grant s3:GetBucketLocation/HeadBucket permissions."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b9d7ea51c8cce57cff1207964b9b71123673081f","analyzedAt":"2026-08-13T04:14:40.386Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}