aws / aws/aws-toolkit-vscode

SAM Python Debugger fails to respect breakpoints in VSC when DockerContext is modified to ./

Open
#5,353 0 comments 0 reactions 0 assignees View on GitHub
bug docker lambda language:python sam sam-packagetype-image
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

## Problem
SAM Python Debugger fails to respect breakpoints in VSC when `DockerContext` is modified to `./`

## Steps to reproduce the issue

1. Create new SAM application using the VSCode toolkit
2. Modify `template.yaml` from:
```
Metadata:
Dockerfile: Dockerfile
DockerContext: ./hello_world
DockerTag: python3.12-v1
```
to
```
Metadata:
Dockerfile: hello_world/Dockerfile
DockerContext: ./
DockerTag: python3.12-v1
```
4. Modify `Dockerfile` (`COPY ./hello_world/app.py requirements.txt ./`) to use the correct path.
5. Set breakpoint in app.py
6. Debug function (using either of the default debug configurations).
7. Function launches, debugger attaches, but breakpoints are not respected

## Expected behaviour

Function launches, debugger attaches, and breakpoints are respected

## System details (run `AWS: About` and/or `Amazon Q: About`)
```
OS: Darwin arm64 23.5.0
Visual Studio Code extension host: 1.91.1
AWS Toolkit: 3.15.0
node: 20.9.0
electron: 29.4.0
```
Should it make a difference, I am using Colima instead of Docker.
```
colima version 0.6.9
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue using template.yaml, hello_world/Dockerfile, and app.py with DockerContext set to ./; start with the default VS Code debug configurations. Trace how the debugger maps the container and workspace paths, then verify that breakpoints in app.py are respected when the function launches through Colima or Docker.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, python, typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.