question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debugging inside a container: debugger does not hit breakpoints anymore

See original GitHub issue

Type: Bug

Behaviour

Expected vs. Actual

Context: Debugging code inside a container

Expected: breakpoint are hit when code is executed. Actual: breakpoints are not hit, and when the debug session the Debug Console shows:

pydev debugger: unable to find translation for: "c:\dev\qxc\model-sample\qxc\app\run.py" in ["C:\dev\qxc\model-sample/qxc/", "C:\dev\qxc\model-sample/qxc"] (please revise your path mappings).

Worth mentioning: rolling back to version v2022.18.2 of the extension fixes the problem without any change in the path mappings. Those mappings were defined weeks ago, and just stopped working with the latest release.

Steps to reproduce:

  1. Configure a project to run and debug inside a container
  2. Set some breakpoints
  3. Run the project
  4. Observe the warning describe above in the Debug Console, and verify that breakpoints are not hit

What seems strange from the message above is that the path inside the container c:\dev\qxc\model-sample\qxc\app\run.py looks like a Windows path, but the container I’m running is from a Linux-based image. I’m on a Windows box with Docker Desktop on WSL2.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.4
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

Extension version: 2022.18.2 VS Code version: Code 1.74.0 (5235c6bb189b60b01b1f49062f4ffa42384f8c91, 2022-12-05T16:38:16.075Z) OS version: Windows_NT x64 10.0.19044 Modes: Sandboxed: No

System Info
Item Value
CPUs Intel® Core™ i7-8650U CPU @ 1.90GHz (8 x 2112)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 31.86GB (11.04GB free)
Process Argv –folder-uri file:///c%3A/dev/qxc/model-sample --crash-reporter-id d3ea3600-8e75-4ca7-a1d1-6a498426b4ab
Screen Reader no
VM 0%

Issue Analytics

  • State:open
  • Created 9 months ago
  • Reactions:1
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wasphubcommented, Dec 16, 2022

I confirm that adding "clientOS": "Windows" fixes the issue even with v2022.20.0. The clientOS attribute is underlined with a squiggly by VS Code, but it does work.

1reaction
fabiozcommented, Dec 16, 2022
{
    "configurations": [
        {
            "name": "App Local",
            "type": "docker",
            "request": "launch",
            "preLaunchTask": "docker-run-app-local",
            "clientOS": "Windows", 
            "python": {
                "pathMappings": [
                    {
                        "localRoot": "${workspaceFolder}/qxc",
                        "remoteRoot": "/qxc",
                    }
                ],
                "projectType": "general"
            }
        }
    ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging inside a container: debugger does not hit ... - GitHub
Configure a project to run and debug inside a container; Set some breakpoints; Run the project; Observe the warning describe above in the...
Read more >
Troubleshoot Breakpoints in the Visual Studio Debugger
"No Symbols have been loaded for this document" ... Go to the Modules window (Debug > Windows > Modules) and check whether your...
Read more >
Breakpoints not hit when using docker-compose for asp.net ...
I am trying to wrap my head around on how to debug an application, when I am using docker. I found this documentation,...
Read more >
Docker debugging does not work - Visual Studio Feedback
Hence, I am unable to debug my code and it does not hit the breakpoints. I have tried to use the docker -it...
Read more >
Breakpoint not hit in debug mode when Dockerfile contains ...
Breakpoint not hit in debug mode when Dockerfile contains ENTRYPOINT, works with CMD · 1. Have a docker-compose remote interpreter set · 2....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found