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

Debugger doesn't stop at breakpoint with remote debug #4456

Closed
ruselcmplx opened this issue Feb 20, 2019 · 11 comments
Closed

Debugger doesn't stop at breakpoint with remote debug #4456

ruselcmplx opened this issue Feb 20, 2019 · 11 comments
Assignees
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug windows

Comments

@ruselcmplx
Copy link

Environment data

  • VS Code version: 1.31.1
  • Extension version (available under the Extensions sidebar): 2019.1.0
  • OS and version: Windows_NT x64 6.1.7601
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.2 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: None

Expected behaviour

VSCode debugger stops at the breakpoint with access to the code

Actual behaviour

VSCode pauses, but nothing happens, no visual "stopping", not even tries to create cmd-tab with connection cmd-line

Steps to reproduce:

  1. trigger some method on a remote server (actually it is the same PC with linked py files from my sources)
  2. hit "Start debugging" button in the editor with prepared attach config
  3. "Remote" server starts waiting, but nothing happens in the editor

Logs

debug18628.log

200219

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Feb 20, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Feb 20, 2019
@d3r3kk
Copy link

d3r3kk commented Feb 22, 2019

Thanks for the report @ruselcmplx.

I think I will need a bit more information to reproduce your issue. Here's what I've done so far, maybe you can use this to reproduce the issue on your machine to see what we might be able to sort out.

Reproduction, Setup

  1. Download this workspace, and unzip it someplace (for example, C:\dev\4456_test).
  2. Open the workspace in VS Code, and open the terminal (I'm using the Powershell terminal window, adjust for your local setup).
  3. Select an appropriate Python interpreter for your workspace (the system Python 3.6 should work fine).
  4. Create another directory outside of the workspace. From the terminal (for example): mkdir C:\dev\4456_remote
  5. Copy the file list.py from the workspace to this new folder. From the terminal (for example): cp C:\dev\4456_test\sources\modules\list.py C:\dev\4456_remote\
  6. In the terminal, CD to the new directory: cd C:\dev\4456_remote
  7. Add a virtual environment by issuing this command: py -3.6 -m venv .venv
  8. Activate the virtual environment by issuing this command: .venv\Scripts\Activate.ps1
  9. Install necessary dependencies for the workspace. Issue this command: python -m pip install -U ptvsd
  10. Start the script (which will make it begin to wait for connections): python list.py
  11. Add a breakpoint at line 5 of line.py inside of VS Code.
  12. Start the debugger in the VS Code editor.

Expected results

The VS Code editor will break at line 5 of list.py.

Observed Results

The VS Code editor opens a different read-only window with the content of list.py in it, and breaks on line 5. (This is due to a related bug reported here #4166).


Please use this reproduction as an example that we can use to figure out what your specific problem is. Alter my repro and see if you can supply us with a minimum reproduction case. Thanks!

@d3r3kk d3r3kk added bug Issue identified by VS Code Team member as probable bug area-debugging info-needed Issue requires more information from poster labels Feb 22, 2019
@ruselcmplx
Copy link
Author

Everything is done well with this case

debug10196.log

But still doesn't work with the symlinked src files to server

@ruselcmplx
Copy link
Author

env

@ruselcmplx
Copy link
Author

ruselcmplx commented Feb 26, 2019

Comparing logs shows that in my case process stops at "setBreakpoints" command From Client not followed by anything (To Client commands, setExceptionBreakpoints, process/attach etc.). Code.exe loads some CPU for a second and nothing happens.
debug12116.log

@d3r3kk
Copy link

d3r3kk commented Mar 11, 2019

I cannot reproduce your issue, as I cannot get the remote/local debugging to even start when using soft linked files on Windows, which I believe is what you are describing with this setup.

Question:

If you do not use a linked file, but instead copy the file (or deploy it) to the server folder, does it correct the problem?

@d3r3kk d3r3kk assigned ericsnowcurrently and unassigned d3r3kk Mar 19, 2019
@brettcannon brettcannon removed the info-needed Issue requires more information from poster label Mar 26, 2019
@ericsnowcurrently
Copy link
Member

@ruselcmplx, please reply with an answer to @d3r3kk's question. Thanks!

@ericsnowcurrently ericsnowcurrently added info-needed Issue requires more information from poster windows labels Apr 1, 2019
@ruselcmplx
Copy link
Author

Question:

If you do not use a linked file, but instead copy the file (or deploy it) to the server folder, does it correct the problem?

Nope, nothing changed with copy. Perhaps the problem in Cyrillic symbols in remote path? But it was working just in January.

@ericsnowcurrently ericsnowcurrently removed the info-needed Issue requires more information from poster label Apr 2, 2019
@ericsnowcurrently
Copy link
Member

@ruselcmplx, thanks for giving that a try. So thus far possible causes have been symlinks (on Windows) and Cyrillic symbols, right?

Let's simplify things and try to avoid those two issues at the same time. Do you see the problem with a minimal project, not using symlinks, but using the same launch.json (with "localRoot" adjusted appropriately)? Here's an example:

# local
<workspace root>/
    spam.py
# remote
# Assuming there is no __init__.py in the "modules" folder...
C:/server/modules/
    spam.py
# spam.py
print('before')
print('during')
print('after')

@ericsnowcurrently ericsnowcurrently added the info-needed Issue requires more information from poster label Apr 2, 2019
@ruselcmplx
Copy link
Author

I tried to reproduce the scenario with HTTPServer and everything went OK:

#local
<workspace root>/
    spam.py
#remote 
C:/servers/modules/cgi-bin/
    spam.py
#spam.py
#!/usr/bin/env python3

def test():
    import ptvsd
    ptvsd.enable_attach(address=('127.0.0.1', 1010), redirect_output=True)
    ptvsd.wait_for_attach()
    print('before')
    print('during')
    print('after')

print("Content-type: text/html")
print()
test()
print('Ready')

debug19428.log

So I suppose the problem is in the complexity of my working server and perhaps some implicit consequences.

@ericsnowcurrently
Copy link
Member

@ruselcmplx, we'd still like to find the cause of the problem. :) Would you mind trying that simple project but add a Cyrillic character to the module's filename?

@DonJayamanne
Copy link

Its been a month since the information was requested. Closing due to inactivity.
We'll be happy to reopen the issue once the requested information has been provided.

@ghost ghost removed info-needed Issue requires more information from poster triage labels May 20, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug windows
Projects
None yet
Development

No branches or pull requests

5 participants