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.

Deploy fails after opting in to new Lambda states

See original GitHub issue

Issue 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

  1. Set inputs.description field in your config to aws:states:opt-in
  2. Run npx serverless
  3. It should fail after ~a minute.

Versions

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 or alpha @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 old serverless-next.js component and the serverless-next.js plugin are deprecated and no longer maintained.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

5reactions
domeqcommented, Oct 30, 2021

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 👏🏻

1reaction
dphangcommented, Oct 30, 2021

Woops, 3rd time’s the charm, tested again and this fixes now: https://github.com/serverless-nextjs/serverless-next.js/pull/1992

Read more comments on GitHub >

github_iconTop 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 >

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