Closed yk-matsu closed 3 years ago
The stacktrace above doesn't show it but I assume it is probably this line that fails, since you mention ISR: https://github.com/serverless-nextjs/serverless-next.js/blob/e7031355d4bf6dcac5bef6009456fbaae1f3b98c/packages/serverless-components/nextjs-component/src/component.ts#L555
Wondering if there is some delay in Lambda creation in ap-northeast-1. Do you see the function created at all? Maybe worth investigating if there is a more reliable way to wait for Lambda to be created. I thought https://github.com/serverless-nextjs/serverless-next.js/blob/e7031355d4bf6dcac5bef6009456fbaae1f3b98c/packages/serverless-components/nextjs-component/src/component.ts#L550 would do so since it is awaiting for the Lambda, but maybe it is less reliable on AP regions.
cc @kirkness
i'm seeing same error with 1.20.0-alpha.16, in eu-central-1 region.
DEBUG ─ Deploying bucket j1p5vt-s6j2zta in region eu-central-1.
DEBUG ─ Checking if bucket j1p5vt-s6j2zta exists.
DEBUG ─ Setting acceleration to "true" for bucket j1p5vt-s6j2zta.
DEBUG ─ Bucket j1p5vt-s6j2zta was successfully deployed to the eu-central-1 region.
DEBUG ─ Starting deployment of lambda j1p5vt-s6j2zta to the eu-central-1 region.
DEBUG ─ Syncing role j1p5vt-9rrmai8 in region us-east-1.
DEBUG ─ Updating service for role j1p5vt-9rrmai8.
DEBUG ─ Updating policy for role j1p5vt-9rrmai8.
DEBUG ─ Saved state for role j1p5vt-9rrmai8.
DEBUG ─ Role j1p5vt-9rrmai8 was successfully deployed to region us-east-1.
DEBUG ─ Deployed role arn is arn:aws:iam::066589566831:role/j1p5vt-9rrmai8.
DEBUG ─ Packaging lambda code from /home/circleci/repo/.serverless_nextjs/regeneration-lambda.
DEBUG ─ Uploading j1p5vt-s6j2zta lambda code.
DEBUG ─ Updating j1p5vt-s6j2zta lambda config.
DEBUG ─ Successfully deployed lambda j1p5vt-s6j2zta in the eu-central-1 region.
error:
InvalidParameterValueException: Function does not exist
at Object.extractError (/home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/protocol/json.js:52:27)
at Request.extractError (/home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
at Request.callListeners (/home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/request.js:688:14)
at Request.transition (/home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/home/circleci/.serverless/components/registry/npm/@sls-next/serverless-component@1.20.0-alpha.16/node_modules/aws-sdk/lib/request.js:690:12) {
code: 'InvalidParameterValueException',
time: 2021-06-02T19:13:52.100Z,
requestId: '788d7483-bd3a-462f-bc52-4c498403a531',
statusCode: 400,
added some logging before await sqs.addEventSource(regenerationLambdaResult.name);
in serverless-next.js/packages/serverless-components/nextjs-component/src/component.ts
but it doesn't seem to go there, no logs printed.
But deployment succeeded after changing https://github.com/serverless-nextjs/serverless-next.js/blob/e7031355d4bf6dcac5bef6009456fbaae1f3b98c/packages/serverless-components/aws-sqs/serverless.js#L19 region to 'eu-central-1'.
added some logging before
await sqs.addEventSource(regenerationLambdaResult.name);
inserverless-next.js/packages/serverless-components/nextjs-component/src/component.ts
but it doesn't seem to go there, no logs printed.But deployment succeeded after changing
region to 'eu-central-1'.
Changing this also worked +1
Thanks, makes sense since Lambda for regeneration is using bucket region specified but SQS queue does not use same region, and it is using us-east-1 by default. So it cannot find the function since it's in the wrong region. Will fix it by using bucketRegion for SQS's region.
Describe the bug
When I specify bucket region. InvaliadParameterValueException error is occured. like below.
Actual behavior
Actual behavior is written in Screenshots/Code/Logs section.
Expected behavior
ap-northeast-1 region's S3 bucket is created and ISR works.
Steps to reproduce
Screenshots/Code/Logs
Versions
Additional context
Bucket region is not specfied in serverless.yml. us-east-1 S3 bucket is created, and ISR works.
like below.
Checklist
latest
oralpha
@sls-next/serverless-component
release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.