Skip to content

Bug: Lambda functions containers initialization failed because of [Errno 17] File exists #8166

@mbamber

Description

@mbamber

Description:

When I am running sam local start-api I frequently get the error:
Lambda functions containers initialization failed because of [Errno 17] File exists: '/root/.aws-sam/layers-pkg/opa-lambda-extension-44-e1a875753a' where the mentioned extension is a layer that we have written.

Sometimes it works fine, but most of the time it crashes with this error.

Steps to reproduce:

Run sam local start-api --config-env test with a config that looks as follows:

[test.local_start_api.parameters]
warm_containers = "EAGER"
port = 3001

Observed result:

sam.log

Expected result:

My API to become available every time

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

# Paste the output of `sam --info` here

{
--
"version": "1.140.0",
"system": {
"python": "3.10.12",
"os": "Linux-4.14.355-275.572.amzn2.x86_64-x86_64-with-glibc2.35"
},
"additional_dependencies": {
"docker_engine": "20.10.24",
"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"
]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions