question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AccessDenied: Access Denied

See original GitHub issue

Describe the bug

Access Denied: Access Denied is displayed

Actual behavior

.env

APP_NAME=nextjs
APP_DOMAIN=mydomain

AWS_ACCESS_KEY_ID=accesskey
AWS_SECRET_ACCESS_KEY=secretkey

serverless.yml

Project:
  component: "@sls-next/serverless-component@latest"
  inputs:
    name: ${env.APP_NAME}-function
    domain: ["development", "${env.APP_DOMAIN}"]
    bucketName: serverless-bucket-${env.APP_NAME}
$ serverless --debug

  DEBUG ─ Resolving the template's static variables.
  DEBUG ─ Collecting components from the template.
  DEBUG ─ Downloading any NPM components found in the template.
  DEBUG ─ Analyzing the template's components dependencies.
  DEBUG ─ Creating the template's components graph.
  DEBUG ─ Syncing template state.
  DEBUG ─ Executing the template's components graph.
info  - Loaded env from C:\Users\user\Documents\Projects\Testing\nextjs\.env
info  - Creating an optimized production build...
info  - Collecting page data...
info  - Generating static pages (0/3)
info  - Generating static pages (1/3)
info  - Generating static pages (2/3)  
info  - Generating static pages (3/3)  
info  - Finalizing page optimization...

Page                                                           Size     First Load JS
┌ ○ /                                                          3.05 kB        62.1 kB
├ ○ /404                                                       3.44 kB        62.5 kB
└ ○ /blog                                                      2.77 kB        61.9 kB
+ First Load JS shared by all                                  59.1 kB
  ├ chunks/3a3f75626beeb6412aba5e6564dc5dac4d3e7fd6.00aaea.js  10.4 kB
  ├ chunks/framework.cb05d5.js                                 39.9 kB
  ├ chunks/main.087f27.js                                      7.02 kB
  ├ chunks/pages/_app.af1b8e.js                                1.01 kB
  └ chunks/webpack.e06743.js                                   751 B

λ  (Lambda)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
   (ISR)     incremental static regeneration (uses revalidate in getStaticProps)

  DEBUG ─ Deploying bucket nextjs in region us-east-1.
  DEBUG ─ Checking if bucket nextjs exists.
  DEBUG ─ Setting acceleration to "true" for bucket nextjs.

  error:
  AccessDenied: Access Denied
    at Request.extractError (C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\services\s3.js:700:35)
    at Request.callListeners (C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\sequential_executor.js:106:20)
    at Request.emit (C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\sequential_executor.js:78:10)
    at Request.emit (C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\request.js:688:14)
    at Request.transition (C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\request.js:22:10)
    at AcceptorStateMachine.runTo (C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\state_machine.js:14:12)
    at C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\state_machine.js:26:10
    at Request.<anonymous> (C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\request.js:38:9)
    at Request.<anonymous> (C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\request.js:690:12)
    at Request.callListeners (C:\Users\user\.serverless\components\registry\npm\@sls-next\serverless-component@1.17.1-alpha.3\node_modules\@sls-next\serverless-component\node_modules\aws-sdk\lib\sequential_executor.js:116:18) {
  code: 'AccessDenied',
  region: null,
  time: 2020-10-01T02:44:35.157Z,
  requestId: 'DF92DDD7AFAF84B5',
  extendedRequestId: '1QEMsr3BmbEA6YPz+/CbYgD3eCtSgcQpQeqUyxIASz9Rg1iLKH09UCwkrzv/LZxvpqAH+uyeDFg=',
  cfId: undefined,
  statusCode: 403,
  retryable: false,
  retryDelay: 92.07993005048066
}

  10s » Project » AccessDenied: Access Denied

Versions

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

4reactions
YuK1Gamecommented, Oct 5, 2020

removed .serverless .serverless_nextjs .next and succeeded!

1reaction
huisang-growthcommented, Feb 14, 2021

@manobo Turns out this was an AWS permission issue for me. I asked my VP of engineering for admin access on AWS, and then gave myself all kinds of access. This solved the AccessDenied error for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my access denied on s3 (using the aws-sdk for Node.js)?
The problem was that my new IAM user didn't have a policy attached to it. I assigned it the AmazonS3FullAccess policy and now...
Read more >
Troubleshoot 403 Access Denied errors from Amazon S3
If you're getting Access Denied errors on public read requests that are allowed, check the bucket's Amazon S3 block public access settings. Review...
Read more >
This is the reason your S3 bucket is denying you access
1. Unchecking "block all public access." ... This check-box appears when you first create your bucket, so if you missed it, head to...
Read more >
Resolve HTTP 403 "Access Denied" AmazonS3Exception in ...
Resolution · First, check the credentials or role specified in your application code · Check the policy for the Amazon EC2 instance profile...
Read more >
Why am I getting an Access Denied error from the Amazon S3 ...
We appreciate your feedback: https://amazonintna.qualtrics.com/jfe/form/SV_czLXcR3SDA353wiFor more details see the Knowledge Center article ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found