serverless / serverless/serverless

ServerlessError: Could not locate deployment bucket. Error: Access Denied

Open
#11,310 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
46.9k
Forks
5.7k
Avg merge
10h 7m
Merged PRs (30d)
57

Description

Are you certain it's a bug?
  • Yes, it looks like a bug
Is the issue caused by a plugin?
  • It is not a plugin issue
Are you using the latest v3 release?
  • Yes, I'm using the latest v3 release
Is there an existing issue for this?
  • I have searched existing issues, it hasn't been reported yet
Issue description

I assume the role for aws user and have a role for s3, lambda... But when I used to serverless deploy command, I got this issue below: Serverless: [AWS s3 403 0.207s 0 retries] getBucketLocation({ Bucket: 'xxxxx' })

Here is my policy
{
"Action": [
"s3:GetObject",
"s3:GetObjectAcl",
"s3:GetBucketLocation",
"s3:GetBucketAcl",
"s3:ListAllMyBuckets",
"s3:ListBucket",
"s3:DeleteObject",
"s3:PutObject",
"s3:PutBucketPolicy"
],
"Resource": [
"*"
],
"Effect": "Allow",
"Sid": "PermissionOnS3"
}
....

Service configuration (serverless.yml) content
N/A
Command name and used flags

serverless deploy --verbose -s dev -c cao-004-v2.yml

Command output
Serverless: [AWS s3 403 0.207s 0 retries] getBucketLocation({ Bucket: 'xxxx' })
 
  Serverless Error ---------------------------------------
 
  ServerlessError: Could not locate deployment bucket. Error: Access Denied
      at BbPromise.resolve.then.then.catch.err (/usr/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/existsDeploymentBucket.js:25:15)
  From previous event:
      at AwsDeploy.existsDeploymentBucket (/usr/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/existsDeploymentBucket.js:24:13)
      at AwsDeploy.BbPromise.bind.then.then (/usr/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:73:27)
  From previous event:
      at Object.before:deploy:deploy [as hook] (/usr/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:70:12)
      at BbPromise.reduce (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:490:55)
  From previous event:
      at PluginManager.invoke (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:490:22)
      at getHooks.reduce.then (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:525:24)
  From previous event:
      at PluginManager.run (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:525:8)
      at variables.populateService.then (/usr/lib/node_modules/serverless/lib/Serverless.js:133:33)
      at runCallback (timers.js:705:18)
      at tryOnImmediate (timers.js:676:5)
      at processImmediate (timers.js:658:5)
      at process.topLevelDomainCallback (domain.js:126:23)
  From previous event:
      at Serverless.run (/usr/lib/node_modules/serverless/lib/Serverless.js:120:74)
      at serverless.init.then (/usr/lib/node_modules/serverless/bin/serverless.js:82:30)
      at /usr/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:143:16
      at /usr/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:61:14
      at FSReqWrap.args [as oncomplete] (fs.js:140:20)
  From previous event:
      at initializeErrorReporter.then (/usr/lib/node_modules/serverless/bin/serverless.js:82:8)
      at runCallback (timers.js:705:18)
      at tryOnImmediate (timers.js:676:5)
      at processImmediate (timers.js:658:5)
      at process.topLevelDomainCallback (domain.js:126:23)
  From previous event:
      at Object.<anonymous> (/usr/lib/node_modules/serverless/bin/serverless.js:71:4)
      at Module._compile (internal/modules/cjs/loader.js:778:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
      at Module.load (internal/modules/cjs/loader.js:653:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
      at Function.Module._load (internal/modules/cjs/loader.js:585:3)
      at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
      at startup (internal/bootstrap/node.js:283:19)
      at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Environment information
N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading lib/plugins/aws/deploy/lib/existsDeploymentBucket.js and the deployment entry points in lib/plugins/aws/deploy/index.js, then reproduce the reported serverless deploy command with a complete service configuration and environment. Done requires identifying whether the Access Denied response is handled incorrectly and adding coverage for the confirmed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.