-
Notifications
You must be signed in to change notification settings - Fork 68
Remote debugging failed with warning "pydev debugger: warning: try to add breakpoint to file that does not exist" #1311
Comments
@xiaofeng0123 From the paths it looks like the remote root might not be correct.
If that does not work, can you provide more details about your project layout local and remote. |
@karthiknadig Could be a dup of #1297 |
I have the exact same problem. Tried using ptvsd 3.0.0, 4.2.6 and 4.2.7. After extensive troubleshooting trying out all manner off different values for the two path mappings I can report that it seems as if ptvsd just concatenates both path values. I am running a Flask app in a docker container. I am exposing port 8000 for the Flask app as well as port 5678 for ptvsd. My app resides in /app inside the docker container and on my host machine in a different path altogether. My launch.json entry looks like:
If I run my container I can start the
I have also noticed that no matter what I set the For instance, if I change my launch.json entry to the following:
One would expect the error message to at least reflect the new remoteRoot value of
I have tried removing the pathMappings collection entirely, changing the *Root values to absolute paths, making both ".", making one "." and the other absolute, making both blank, one blank and the other either absolute or "." and all combinations of the aforementioned without any luck. Those values are happily ignored. I have no idea if the VS Code extension is sending the incorrect information to the remote server or if the remote server's ptvsd is incorrectly interpreting the values it receives. Any help will be greatly appreciated. |
I'll take a look at this. |
I've been able to reproduce this. The problem I found is that if the This means that if the path mapping
and later a breakpoint is sent as:
then there will be no translation applied and when the debugger goes on to make that path absolute it'll end up concatenating the result with the working directory generating something as:
The workaround for this would be making sure that the i.e.: if it fails with -- it seems that the The fix I'll make so that this doesn't happen anymore is taking into account that the client is on Windows and then normalizing the cases of the paths sent from the client and in the path mapping (I don't know why on some cases VSCode sends the case for the |
Thank you so much for taking the time to look into this. I have made the changes that you have suggested and it works like a charm! Thanks again. |
Can't we somehow try to do this on behalf of the user. E.g. piggy back to editor via an event or the like, along the editors for more information if necessary... Horrible workaround, basically thinking out loud to solve on behalf of user.. |
@DonJayamanne this is already fixed in the master branch (in: 9ec0b7a). I'm not sure why this is happening so much now. My guess is that VSCode previously passed the drive with the same case for breakpoints and for the |
Thanks for working on this! BTW, when current workaround will be available in the ptvsd release? |
@xiaofeng0123 commented on Tue Apr 02 2019
Visual Studio Code - Insiders: 1.33.0-insider
python-insider: 2019.4.6365-alpha
ptvsd version: 4.2.6
Repro step:
import ptvsd
ptvsd.enable_attach(('IP of unbuntu',5678))
ptvsd.wait_for_attach()
for i in range(1,10,2):
print(i)
print('demo done')
python3 remote_debug.py
Actual Result:
Fail to hit breakpoint with warning "pydev debugger: warning: trying to add breakpoint to file that does not exist..."
Expect Result:
It should hit breakpoint
The text was updated successfully, but these errors were encountered: