-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
stage/needs-investigationRequires a deeper investigationRequires a deeper investigation
Description
Description:
When attempting to attach a debugger to a locally running AWS Lambda function using the SAM CLI on an Apple ARM-based chip (e.g., M1/M2), the debugger keep hanging and never attached. My guess is potentially due to compatibility issues between the debugger, SAM CLI, and Docker on the ARM architecture.
Steps to reproduce:
- Create new directory
mkdir -p ~/.vsdbg
- Use Docker to download and install vsdbg for the AWS Lambda runtime container with .NET 6 and copy it to local machine
docker run --rm --mount type=bind,src=~/.vsdbg,dst=/vsdbg --entrypoint bash lambci/lambda:dotnet6.0 -c "curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg"
- Build SAM
sam build
- SAM local start api
sam local start-api --port 1111 --skip-pull-image --debug-port 5858 --debugger-path ~/.vsdbg --warm-containers EAGER
- Start launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Docker Attach",
"type": "coreclr",
"request": "attach",
"processId": "1",
"pipeTransport": {
"pipeProgram": "sh",
"pipeArgs": [
"-c",
"docker exec -i $(docker ps -q -f publish=5858) ${debuggerCommand}"
],
"debuggerPath": "/tmp/lambci_debug_files/vsdbg",
"pipeCwd": "${workspaceFolder}",
},
"sourceFileMap": {
"/var/task": "${workspaceFolder}"
}
}
]
}
I attempted to try both run the launch.json file before and after hitting the endpoint to see if it makes any different.
Observed result:
No breakpoint were hit. the debugger keep hanging and never actually attached.
Expected result:
It will actually hit the breakpoints.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: MacOS Apple M3
sam --version: 1.132- Lambda Runtime: dotnet6
{
"version": "1.132.0",
"system": {
"python": "3.13.1",
"os": "macOS-15.2-arm64-arm-64bit-Mach-O"
},
"additional_dependencies": {
"docker_engine": "27.3.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"
]
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stage/needs-investigationRequires a deeper investigationRequires a deeper investigation