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 stops working in the middle of a debug session #11101

Closed
sriramgd opened this issue Apr 11, 2020 · 5 comments
Closed

Debugger stops working in the middle of a debug session #11101

sriramgd opened this issue Apr 11, 2020 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@sriramgd
Copy link

sriramgd commented Apr 11, 2020

Environment data

  • VS Code version: 1.44.0
  • Extension version (available under the Extensions sidebar): 2020.3.71659
  • OS and version: Darwin x64 19.3.0
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv 16.6.0
  • Relevant/affected Python packages and their versions:
  • Relevant/affected Python-related VS Code extensions and their versions:
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): Language Server
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

Debugging Celery task code which runs within a Django web server process. The celery task_always_eager flag is set, so the code still runs in Django (not in separate Celery process).
Debugger should not stop working during a debug session.

Actual behaviour

Occasionally, but frequently enough, the debugger stops working after stepping through a few steps. The debugger step/continue/run buttons are all enabled, but clicking on them or using shortcuts has no effect, the debugger seems to be stuck on a line of code. The behavior does not seem to have any pattern I can perceive. It occurs at different points on different occasions. Usually when the problem starts, it seems to occur more frequently till I restart VS code, though I am not sure about this.

The + plus to add breakpoints in the watch dropdown of debug tab gets disabled when this condition occurs.

I keep the Raised Exceptions and Uncaught Exceptions checkboxes are unchecked.

This problem re-occurred when I removed all other extensions.

My launch.json is:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Django",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/manage.py",
            "console": "integratedTerminal",
            "justMyCode": false,
            "pythonPath": "/Users/myusername/git/django-api/virtual_environment/bin/python",
            "args": [
                "runsslserver",
                "--noreload",
                "--nothreading",
                "--certificate",
                "./certs/my-local-server.crt",
                "--key",
                "./certs/my-local-server.key"
            ],
            "django": true
        }
    ]
}

The other log which may be of interest is Output -> log (window). I am not sure if this time coincides with when the particular instance of the problem occurred, but it was at least within a couple of minutes:

[2020-04-10 19:50:04.364] [renderer2] [error] timeout after 1000 ms: Error: timeout after 1000 ms
    at t.RawDebugSession.handleErrorResponse (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:3044:67)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:3043:339
    at async t.RawDebugSession.shutdown (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:3041:336)

Steps to reproduce:

I am not able to create a minimal repro of this. It happens while debugging the project and is not predictable. Let me know if there is anything I can try or generate on my side, which could be helpful.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'Reload - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'WebHostNotebook - control'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'CollectLSRequestTiming - experiment'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
> conda --version
> conda info --json
> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> ~/git/django-api/virtual_environment/bin/python -c "import sys;print(sys.executable)"
> pipenv --version
cwd: ~/git/django-api
> pipenv --version
cwd: ~/git/django-api
> pipenv --venv
cwd: ~/git/django-api
> ~/git/django-api/virtual_environment/bin/python -c "import jupyter"
> ~/git/django-api/virtual_environment/bin/python -c "import jupyter"
> ~/git/django-api/virtual_environment/bin/python -c "import notebook"
> ~/git/django-api/virtual_environment/bin/python -c "import notebook"
> pipenv --venv
cwd: ~/git/django-api
> ~/git/django-api/virtual_environment/bin/python -m jupyter kernelspec --version
> ~/git/django-api/virtual_environment/bin/python -m jupyter kernelspec --version
> pipenv --py
cwd: ~/git/django-api
> pipenv --py
cwd: ~/git/django-api
Starting Microsoft Python language server.
> ~/git/django-api/virtual_environment/bin/python -c "
import unittest
loader = unittest.TestLoader()
suites = loader.discover("./whitemamba", pattern="test*.py")
print("start") #Don't remove this line
for suite in suites._tests:
    for cls in suite._tests:
        try:
            for m in cls._tests:
                print(m.id())
        except:
            pass"
cwd: ~/git/django-api
> ~/git/django-api/virtual_environment/bin/python -c "
import unittest
loader = unittest.TestLoader()
suites = loader.discover("./whitemamba", pattern="test*.py")
print("start") #Don't remove this line
for suite in suites._tests:
    for cls in suite._tests:
        try:
            for m in cls._tests:
                print(m.id())
        except:
            pass"
cwd: ~/git/django-api
> conda --version

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

Attached in separate file:
[console-devtools.txt](https://github.com/microsoft/vscode-python/files/4463833/console-devtools.txt)

@sriramgd sriramgd added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Apr 11, 2020
@sriramgd
Copy link
Author

sriramgd commented Apr 11, 2020

One more thing I noticed, the languageServerVersion in package.json is 0.5.30, while the language server version installed on my machine is 0.5.45. The same version keeps getting installed when I delete it from local drive.

@karthiknadig
Copy link
Member

Likely microsoft/debugpy#108

@sriramgd
Copy link
Author

sriramgd commented Apr 11, 2020

Thanks @karthiknadig , that is helpful. To add from my side, the problem started occurring a few days (weeks?) back.
Last night in desperation, I went looking for python related settings and among other things turned off

"python.experiments.enabled": false

Have not had the problem since, but was not sure it was this setting or just randomness since I had turned off a few other things and it was only a few hours.

Will report back again in a couple of days.

@sriramgd
Copy link
Author

I am quite sure I am past the problem for my local debugging needs. The workaround in my case was turning off the A/B tests setting for the time being.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Apr 12, 2020
@int19h
Copy link

int19h commented Apr 13, 2020

Yep, all symptoms indicate it's the same thing.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants