Deploy fails after opting in to new Lambda states
See original GitHub issueIssue Summary
Amazon seems to be expanding Lambda function states - read more here. This is planned to kick in 1 Nov 2021.
tl;dr is: This change can impact workflow patterns which update a function right after creating or modifying it, which can cause function update fail.
After experimentally opting in for this (as instructed in the blog post above), my application no longer deploys.
Actual behavior
Running npx serverless
ends up with the following error:
error:
ResourceConflictException: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:us-east-1:801001371903:function:pent2-web-feature-image-lambda
at Object.extractError (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/protocol/json.js:52:27)
at Request.extractError (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
at Request.callListeners (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/request.js:688:14)
at Request.transition (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/request.js:690:12)
at Request.callListeners (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at Request.emit (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/request.js:688:14)
at Request.transition (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/request.js:690:12)
at Request.callListeners (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at callNextListener (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
at IncomingMessage.onEnd (/home/travis/build/niche-and-services/pent2-web/node_modules/aws-sdk/lib/event_listeners.js:336:13)
at IncomingMessage.emit (events.js:326:22)
at IncomingMessage.EventEmitter.emit (domain.js:483:12)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ResourceConflictException',
time: 2021-10-28T14:10:21.087Z,
requestId: '16b80c4e-6e61-4337-aad8-013eaa51c70f',
statusCode: 409,
retryable: false,
retryDelay: 6.8138474319063835
}
Expected behavior
App should deploy normally.
Steps to reproduce
- Set
inputs.description
field in your config toaws:states:opt-in
- Run
npx serverless
- It should fail after ~a minute.
Versions
- OS/Environment: Mac OS / Linux (Travis)
- @sls-next/serverless-component version:
3.5.2
- Next.js version:
11.1.0
Additional context
Checklist
- You have reviewed the README and FAQs, which answers several common questions.
- You have reviewed our DEBUGGING wiki and have tried your best to include complete information and reproduction steps (including your configuration) as is possible.
- You have first tried using the most recent
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.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:9
Top Results From Across the Web
Troubleshoot deployment issues in Lambda
Deployment errors prevent the new version from being used and can arise from issues with your deployment package, code, permissions, or tools.
Read more >AWS lambda ResourceConflictException on deployment
I am aware of the new lambda states feature, and that it can potentially produce this error. However, since all the other lambdas...
Read more >The State of Serverless | Datadog
Our latest report, which builds on our yearly research on the serverless ecosystem, examines thousands of applications to surface insights into how ...
Read more >Ask deploy no longer deploys to existing lambda function
2 Answers ... It appears if I set the function description to "aws:states:opt-out" the problem goes away... ... Yes, just found that and...
Read more >AWS Lambda Functions - Serverless Framework
An ECR repository is created only for new services or the first time that a function configured with an image is deployed. In...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I can confirm
3.5.3-alpha.4
is working just fine for me too 👍🏻Thanks a lot for your help and a quick fix 👏🏻
Woops, 3rd time’s the charm, tested again and this fixes now: https://github.com/serverless-nextjs/serverless-next.js/pull/1992