aws-amplify / aws-amplify/amplify-hosting
Credentials may not be refreshed on long build.
- Dominant language
- Dockerfile
- Stars
- 481
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
### Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
### App Id
d13pw8k8p2rhkg
### Region
ap-northeast-1
### Amplify Hosting feature
Build settings
### Describe the bug
I am trying to deploy my nextjs app on aws through CodeCommit repository.
But the build is failing and giving me below pasted message.
"ExpiredToken: The security token included in the request is expired"
### Expected behavior
No exceptions, automatic token refresh if operation takes long.
### Reproduction steps
- This occurs after a long build time.
- The probability of this occurring increases when Generating static pages exceeds 6000 pages.
### Build Settings
```yaml
version: 1
frontend:
phases:
preBuild:
commands:
- amplifyPush --simple
- rm -rf node_modules
- yarn install
build:
commands:
- yarn run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
```
### Additional information
```
2022-05-13T11:39:57.693Z [INFO]: info - Generating static pages (0/6189)
2022-05-13T11:40:58.011Z [INFO]: info - Generating static pages (238/6189)
2022-05-13T11:41:58.353Z [INFO]: info - Generating static pages (442/6189)
2022-05-13T11:42:58.370Z [INFO]: info - Generating static pages (751/6189)
2022-05-13T11:43:58.514Z [INFO]: info - Generating static pages (980/6189)
2022-05-13T11:44:58.553Z [INFO]: info - Generating static pages (1408/6189)
2022-05-13T11:45:16.698Z [INFO]: info - Generating static pages (1547/6189)
2022-05-13T11:46:16.947Z [INFO]: info - Generating static pages (1938/6189)
2022-05-13T11:47:17.183Z [INFO]: info - Generating static pages (2256/6189)
2022-05-13T11:48:17.386Z [INFO]: info - Generating static pages (2486/6189)
2022-05-13T11:49:17.494Z [INFO]: info - Generating static pages (2692/6189)
2022-05-13T11:50:17.641Z [INFO]: info - Generating static pages (2919/6189)
2022-05-13T11:51:00.133Z [INFO]: info - Generating static pages (3094/6189)
2022-05-13T11:52:00.264Z [INFO]: info - Generating static pages (3349/6189)
2022-05-13T11:53:00.329Z [INFO]: info - Generating static pages (3594/6189)
2022-05-13T11:54:00.581Z [INFO]: info - Generating static pages (3805/6189)
2022-05-13T11:55:00.636Z [INFO]: info - Generating static pages (3998/6189)
2022-05-13T11:56:00.690Z [INFO]: info - Generating static pages (4329/6189)
2022-05-13T11:57:00.806Z [INFO]: info - Generating static pages (4613/6189)
2022-05-13T11:57:11.404Z [INFO]: info - Generating static pages (4641/6189)
2022-05-13T11:58:11.519Z [INFO]: info - Generating static pages (4828/6189)
2022-05-13T11:59:11.553Z [INFO]: info - Generating static pages (5058/6189)
2022-05-13T12:00:11.829Z [INFO]: info - Generating static pages (5300/6189)
2022-05-13T12:01:12.448Z [INFO]: info - Generating static pages (5539/6189)
2022-05-13T12:02:12.681Z [INFO]: info - Generating static pages (5766/6189)
2022-05-13T12:03:12.821Z [INFO]: info - Generating static pages (5962/6189)
2022-05-13T12:04:12.891Z [INFO]: info - Generating static pages (6177/6189)
2022-05-13T12:04:15.921Z [INFO]: info - Generating static pages (6189/6189)
2022-05-13T12:04:15.934Z [INFO]: info - Finalizing page optimization...
2022-05-13T12:04:17.330Z [INFO]:
2022-05-13T12:04:17.396Z [INFO]: Page Size First Load JS
┌ ● / (687 ms) 1.21 kB 166 kB
├ /_app 0 B 69.9 kB
...
2022-05-13T12:04:17.708Z [INFO]: Done in 1503.58s.
2022-05-13T12:04:17.713Z [INFO]: Starting SSR Build...
2022-05-13T12:35:40.334Z [ERROR]: ExpiredToken: The security token included in the request is expired
at Request.extractError (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/protocol/rest_xml.js:53:29)
at Request.callListeners (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/request.js:686:14)
at Request.transition (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/request.js:688:12)
at Request.callListeners (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at Request.emit (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/request.js:686:14)
at Request.transition (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/request.js:688:12)
at Request.callListeners (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at callNextListener (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
at IncomingMessage.onEnd (/root/.//node_modules/@sls-next/cloudfront/node_modules/aws-sdk/lib/event_listeners.js:335:13)
at IncomingMessage.emit (node:events:402:35)
at IncomingMessage.emit (node:domain:475:12)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'ExpiredToken',
time: 2022-05-13T12:35:40.124Z,
requestId: '826a7bc1-8d34-4081-b410-1711c35d70db',
statusCode: 403,
retryable: true
}
Terminating logging...
```
Contributor guide
Assessment
This issue has not been assessed yet.