Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging .NET 6 Lambda Function Locally Does Not Work #4749

Open
kilzdavi opened this issue Apr 19, 2024 · 0 comments
Open

Debugging .NET 6 Lambda Function Locally Does Not Work #4749

kilzdavi opened this issue Apr 19, 2024 · 0 comments
Labels
bug We can reproduce the issue and confirmed it is a bug. language:.NET sam service:lambda

Comments

@kilzdavi
Copy link

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
@kilzdavi kilzdavi added the bug We can reproduce the issue and confirmed it is a bug. label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug. language:.NET sam service:lambda
Projects
None yet
Development

No branches or pull requests

2 participants