aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Bug: sam build - ReadTimeout

Open A-Shevchenko opened this issue 5 months ago • 2 comments

Description:

Error: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) when running sam build

Steps to reproduce:

I have a SAM stack with several Lambdas (Python), one of them seems to have quite heavy list of dependencies. sam build fails with the mentioned error the build inside container was successful according to log

Observed result:

sam-build.log

Expected result:

I expect successful result of sam build

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

{
  "version": "1.146.0",
  "system": {
    "python": "3.11.10",
    "os": "Linux-6.11.0-1018-azure-x86_64-with-glibc2.39"
  },
  "additional_dependencies": {
    "container_engine": "Docker(v28.0.4)",
    "aws_cdk": "Not available",
    "terraform": "Not available"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_PACKAGE_PERFORMANCE",
    "SAM_CLI_BETA_RUST_CARGO_LAMBDA"
  ]
}

A-Shevchenko avatar Nov 11 '25 21:11 A-Shevchenko

The 60 second time limit is coming from the docker.py library that SAM CLI depend on. It weird that it takes more than a minutes to return the result.

Do you have a example project that we can use to reproduce the issue? This seems to be a performance issue rather than a bug.

vicheey avatar Dec 04 '25 00:12 vicheey

Not anymore, unfortunately. But it was some Python project with docling and it was building for quite a while

A-Shevchenko avatar Dec 04 '25 14:12 A-Shevchenko