Cannot Debug a Lambda Timeout · Issue #7792 · localstack/localstack · GitHub
Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Cannot Debug a Lambda Timeout #7792

Description

@ellioseven

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I am attempting to deploy a Lambda function with serverless, however the function continuously times out and LocalStack logs shows me (and continously loops through):

localstack_main  | 2023-03-03T07:07:50.243 DEBUG --- [  Thread-170] l.u.c.docker_sdk_client    : Stopping container: localstack-main-lambda-tx-local-tx-get-0890be8cae7a14400aed6e74e8dddb3c
localstack_main  | 2023-03-03T07:07:50.262 DEBUG --- [cation_loop)] l.s.a.i.version_manager    : Detected no active environments for version arn:aws:lambda:us-east-1:000000000000:function:tx-local-tx-get:$LATEST. Starting one...
localstack_main  | 2023-03-03T07:07:50.262 DEBUG --- [cation_loop)] l.s.a.i.version_manager    : Starting new environment
localstack_main  | 2023-03-03T07:07:50.262 DEBUG --- [cation_loop)] l.s.a.i.docker_runtime_exe : Creating service endpoint for function arn:aws:lambda:us-east-1:000000000000:function:tx-local-tx-get:$LATEST executor 66155fab41a414300fed757eb1b23ff7
localstack_main  | 2023-03-03T07:07:50.263 DEBUG --- [cation_loop)] l.s.a.i.docker_runtime_exe : Finished creating service endpoint for function arn:aws:lambda:us-east-1:000000000000:function:tx-local-tx-get:$LATEST executor 66155fab41a414300fed757eb1b23ff7
localstack_main  | 2023-03-03T07:07:50.263 DEBUG --- [cation_loop)] l.s.a.i.docker_runtime_exe : Assigning container name of localstack-main-lambda-tx-local-tx-get-66155fab41a414300fed757eb1b23ff7 to executor 66155fab41a414300fed757eb1b23ff7
localstack_main  | 2023-03-03T07:07:50.280 DEBUG --- [cation_loop)] l.s.a.i.docker_runtime_exe : Executing start docker executor pro-hook for function arn:aws:lambda:us-east-1:000000000000:function:tx-local-tx-get:$LATEST
...
localstack_main  | 2023-03-03T07:07:50.242  WARN --- [  Thread-170] l.s.a.i.runtime_environmen : Executor 0890be8cae7a14400aed6e74e8dddb3c for function arn:aws:lambda:us-east-1:000000000000:function:tx-local-tx-get:$LATEST timed out during startup
...

Expected Behavior

I don't receive any logging information around why the timeout is happening or what I can do to fix it.

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

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

docker-compose up
...
serverless deploy --stage local
serverless invoke --raw --stage local --function
  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
    image: localstack/localstack-pro
    ports:
      - "127.0.0.1:4566:4566"            # LocalStack Gateway
      - "127.0.0.1:4510-4559:4510-4559"  # external services port range
      - "127.0.0.1:53:53"                # DNS config (required for Pro)
      - "127.0.0.1:53:53/udp"            # DNS config (required for Pro)
      - "127.0.0.1:443:443"              # LocalStack HTTPS Gateway (required for Pro)
    env_file:
      - .env
    environment:
      - DEBUG=${DEBUG-}
      - PERSISTENCE=${PERSISTENCE-}
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
      - DOCKER_HOST=unix:///var/run/docker.sock
      - PROVIDER_OVERRIDE_LAMBDA=asf

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

serverless deploy --stage local

Environment

- OS: MacOS 12.5
- LocalStack: Latest image

Anything else?

I am fairly sure this problem is due to how the application is bundled, but there is absolutely no way for me to know what the problem is on this Lambda environment. I know that the function works locally outside of the Lambda environment on my nvm node environment.

  • Works fine with serverless emulated environment: serverless invoke local --function tx-get
  • Additionally, there are no logs to view under the /aws/lambda log group.
  • Have been at this for days but can't figure out why this timeout is happening.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions