8000 bug: could not start new environment error when multiples lambdas are deployed · Issue #12636 · localstack/localstack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

bug: could not start new environment error when multiples lambdas are deployed #12636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
gvidasstage opened this issue May 19, 2025 · 1 comment
Open
1 task done
Labels
area: integration/cdk Issues related to AWS Cloud Development Kit aws:lambda AWS Lambda status: backlog Triaged but not yet being worked on type: bug Bug report

Comments

@gvidasstage
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I'm deploying a couple of lambdas to localstack using nodejs aws cdk. When only a single lambda is deployed, everything works fine. However when I deploy a second one, the first lambda becomes unusable because it fails to start with an error like this

An error occurred (ServiceException) when calling the Invoke operation (reached max retries: 2): [ab187a47-fc9c-48af-801b-51cf9716e147] Internal error while executing lambda localstack-schema-export-test-rest-api:None. Caused by AssignmentException: Could not start new environment: ContainerException:

While the second lambda works fine. Even if I then redeploy using cdk without the second lambda, the first lambda stays unusable until I clear the localstack docker container.

Example cdk:

const app = new App();

class TestStack extends Stack {
  constructor(scope: App) {
    super(scope);

    new nodejs.NodejsFunction(this, 'handler', {
      functionName: `first-lambda`,
      timeout: Duration.seconds(30),
      runtime: lambda.Runtime.NODEJS_22_X,
    });

    new nodejs.NodejsFunction(this, 'handler', {
      functionName: `second-lambda`,
      timeout: Duration.seconds(30),
      runtime: lambda.Runtime.NODEJS_22_X,
    });
  }
}

new TestStack(app, 'TestStack');

Expected Behavior

All deployed lambdas are able to be invoked

How are you starting LocalStack?

With the localstack script

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

LOCALSTACK_SERVICES=serverless,sqs,sns,sts,ssm,s3,cloudformation,lambda,iam,apigateway,stepfunctions,events localstack start -d 

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

cdklocal bootstrap --app="npx ts-node path-to-app"
cdklocal deploy --app="npx ts-node path-to-app"

awslocal lambda invoke --function-name first-lambda output.txt

Environment

- OS: macOS 15.5
- LocalStack: 
2025-05-19 09:41:25 LocalStack version: 4.4.1.dev6
2025-05-19 09:41:25 LocalStack build date: 2025-05-12
2025-05-19 09:41:25 LocalStack build git hash: e7383de31

Anything else?

No response

@gvidasstage gvidasstage added type: bug Bug report status: triage needed Requires evaluation by maintainers labels May 19, 2025
@localstack-bot
Copy link
Collaborator

Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Support if you are a licensed user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines.

@ryan-berke ryan-berke added area: integration/cdk Issues related to AWS Cloud Development Kit aws:lambda AWS Lambda status: backlog Triaged but not yet being worked on and removed status: triage needed Requires evaluation by maintainers labels May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: integration/cdk Issues related to AWS Cloud Development Kit aws:lambda AWS Lambda status: backlog Triaged but not yet being worked on type: bug Bug report
Projects
None yet
Development

No branches or pull requests

3 participants
0