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.

Remote debug (PTVSD) path mapping

See original GitHub issue

Issue Type: Bug

I simply launch my script on the target device :

sudo python3 -m ptvsd --host 0.0.0.0 --port 5678 --wait script.py

and when I launch the debugger on VSCode, I get this on the console of the remote device :

pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/nvidia/c:/Users/omartin/OneDrive/Professionnel/Dev...

regarless of what the path mapping is (I’ve tried this :

"pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "/home/bob/" } ],

and it won’t match go to /home/bob at all. Looks like something changed on the vscode side (python version, I’ve gone up to 2018.12 this morning and back to 2018.11 to test if that would be the cause (this all worked very well until this morning). This didn’t solve the issue. Also vscode itself was updated but I’m not sure this has anything to do with this but clearly, something has changed…

Extension version: 2018.11.0 VS Code version: Code 1.30.0 (c6e592b2b5770e40a98cb9c2715a8ef89aec3d74, 2018-12-11T22:29:11.253Z) OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel® Core™ i7-8650U CPU @ 1.90GHz (8 x 2112)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.93GB (7.42GB free)
Process Argv
Screen Reader no
VM 0%

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tuhinkarmakarcommented, Jan 6, 2019

I am facing the same issue. In my case the remote code is inside a Docker container. It seems that the remoteRoot is being prepended to the localRoot. Like @omartin2010 mentioned, things were working fine up until recently. My configuration worked 2 months ago. I downgraded the extension to version 2018.10.0, I downgraded ptvsd to version 4.13.0. Still no luck. May be the issue lies with VS Code itself? The workaround works for me as well. But just like others have pointed out, the workaround only works when the drive letter is in lower case.

Note: Seems like the issue is Windows only. Things worked as expected on my Kubuntu machine.

1reaction
alexvy86commented, Dec 18, 2018

Having the same issue, and the workaround of replacing "localRoot": "${workspaceFolder}" with "localRoot": "c:\\path\\to\\my\\workspace\\folder" (lowercase drive letter) also works for me. I recall reading other issue threads that also had to do with the casing of the drive letter, I don’t remember if they were in the VSCode repo itself, or for the Python Extension, but hopefully this is just a matter of getting in line with whatever the convention is?

For the record: VS Code 1.30.0 Python extension 2018.12.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging configurations for Python apps in Visual Studio Code
This article mainly addresses Python-specific debugging configurations, including the necessary steps for specific app types and remote debugging.
Read more >
Remote Debugging with PyCharm - JetBrains
Using the Python remote debug server configuration. ... Map the path on the local machine to the path on the remote machine: Path...
Read more >
Add support to the Python Visual Studio Debugger - OpenDev
If using Visual Studio Code, simply install ptvsd in both environments: ... -48,23 +55,25 @@ a path mapping in the remote debug configuration....
Read more >
Remote Debugging Guide for Python | Codementor
The remote debugger IDE settings define the host, port, and path mappings. The path mapping maps the folder path from the server to...
Read more >
Containerized Python Development - Part 3 - Docker
For this we need an IDE with Python and remote debugging support. ... We need to make sure we update the path map...
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