aws / aws/aws-toolkit-vscode

(ARM) Debugging .NET 6 Lambda Function Locally Does Not Work

Open
#4,749 1 comment 0 reactions 0 assignees View on GitHub
bug lambda lambda-appbuilder lambda-arm language:.NET partner-team sam
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

Hi team. I am trying to debug a .NET 6 lambda function locally. But when when I try to run the debugger or invoke VS Code Hangs when attaching debugger to SAM application, then errors out with the following error messages:

`Starting: "sh" -c "docker exec -i $(docker ps -q -f publish=5858) /tmp/lambci_debug_files/vsdbg --interpreter=vscode"
The pipe program 'sh' exited unexpectedly with code 137`

`Starting: "sh" -c "docker exec -i $(docker ps -q -f publish=5858) /tmp/lambci_debug_files/vsdbg --interpreter=vscode"
Error from pipe program 'sh': Error response from daemon: No such container: tmp/lambci_debug_files/vsdbg
The pipe program 'sh' exited unexpectedly with code 1.`

## Steps to reproduce the issue

1. Run `sam init`
2. Choose **Standalone function** template. Keep the default settings
3. Go to **AWS: Edit SAM Debug Configuration** Command palette
4. Invoke Target Type = **Template** and load the **helloFromLambdaFunction** from the SAM Template
5. Set runtime to **dotnet6**.
6. Set Payload as **"HelloWorld"**
7. Invoke

## Expected behavior

VS Code attaches Debugger using the **public.ecr.aws/lambda/dotnet:6-rapid-x86_64** Docker image.

## System details (run the `AWS: About Toolkit` command)

- OS: MacOS 14.4.1
- Visual Studio Code version:
Version: 1.88.1 (Universal)
Commit: e170252f762678dec6ca2cc69aba1570769a5d39
Date: 2024-04-10T17:42:52.765Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 23.4.0
- AWS Toolkit version: 2.19.0
- Laptop: M2 Macbook Pro

## Other notes
1. sam invoke local in the terminal works.
2. Setting architecture to arm64 causes it to run successfully but the vsdebugger does not currently support the arm64 architecture.
3. Using AWS Lambda tools to debug works as expected.
4. SAM debugging works as expected in Python

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue from the listed sam init steps using AWS: Edit SAM Debug Configuration and the public.ecr.aws/lambda/dotnet:6-rapid-x86_64 image on an arm64 Mac. Start by comparing the failing VS Code debugger attachment with the working terminal invocation and arm64 configuration. Done means the debugger attaches successfully, or the supported architecture limitation is documented and surfaced clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp, docker, vscode
Domain
backend, cloud, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.