aws / aws/aws-sam-cli

Bug: sam build stuck at "Setting DockerBuildArgs for ..."

Open
#8,044 3 comments 1 reaction 0 assignees View on GitHub
stage/needs-triage
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Description:

The command 'sam build' is getting stuck at "Setting DockerBuildArgs for ".
I have an application with many lambda functions, overall divided in two types. I highlighted with double* the differences between types A and B.

Type A follows the template:
```
myFunction:
Type: AWS::Serverless::Function
Properties:
PackageType: Image
MemorySize: 8000
Timeout: 60
Role: arn:aws:iam::.....
Architectures:
- x86_64
Events:
.....
**Metadata:
Dockerfile: Dockerfile
DockerContext: ./myFunctionFolder**
```

Type B follows the template:
```
myFunction:
Type: AWS::Serverless::Function
Properties:
**CodeUri: my_function_folder/**
PackageType: Image
Timeout: 300
Role: arn:aws:iam::......
Architectures:
- x86_64
**Environment:
......**
Events:
......
**Metadata:
Dockerfile: ./my_function_folder/Dockerfile
DockerContext: ./**
```

Both were building with no issues up to yesterday. After no change at all, type B doesn't build anymore, getting stuck at "Setting DockerBuildArgs for " (worth noticing that I don't use DockerBuildArgs anywhere). Type A still builds normally.

I suspect SAM CLI got automatically updated (does it do that? like windows?). I remember weeks ago it complaining that it had available updates that I ignored, and it is no longer complaining.

### Steps to reproduce:

See description

### Observed result:

No error, just stuck at a specific point of the building process.

### Expected result:

I expected the application to be built successfully as it was before.

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

```
{
"version": "1.132.0",
"system": {
"python": "3.12.6",
"os": "Windows-11-10.0.26100-SP0"
},
"additional_dependencies": {
"docker_engine": "28.1.1",
"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_RUST_CARGO_LAMBDA"
]
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.