Repository navigation
Remote Debugger crash: TypeError: Cannot read property 'Threads' of undefined #126
Copy link
Copy link
Closed
Labels
area-debuggingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from posterIssue requires more information from poster
Description
From Alexander Bantyev (@balsoft) on June 3, 2017 14:45
Environment data
VS Code version: 1.12.2
Python Extension version: 0.6.4
Python Version: 3.6
OS and version: Arch Linux x86_64, Latest (All packages up-to-date)
Actual behavior
Remote debugger crashes when I try to attach it to remote app.
Message from devConsole:
Expected behavior
Remote debugger attaches
Steps to reproduce:
- Create a simple script on one Linux device (Ubuntu Linux 16.04 x86_64, Python3, ptvsd installed)
import ptvsd
ptvsd.enable_attach("secret", address=('0.0.0.0', 4000))
# Wait for debugger
ptvsd.wait_for_attach()
- Run it
- Switch to another Linux device (Arch Linux x86_64, Latest, ptvsd installed, VS Code Installed)
- Run VS Code, open the same script locally, debug with "Attach (Remote Debug)"
- Debugger crashes
Settings
Your launch.json (if dealing with debugger issues):
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach (Remote Debug)",
"type": "python",
"request": "attach",
"localRoot": "${workspaceRoot}",
"remoteRoot": "/home/balsoft/Documents/",
"port": 4000,
"secret": "secret",
"host": "192.168.1.67"
}
]
}Your settings.json:
{
"window.zoomLevel": 0,
"files.autoSave": "onFocusChange",
"debug.inlineValues": true,
"debug.hideActionBar": false,
"workbench.colorTheme": "One Dark Pro",
"auto-close-tag.enableAutoCloseTag": false,
"auto-close-tag.SublimeText3Mode": true
}Logs
Output from Python output panel
##########Linting Output - pylint##########
************* Module test
1,0,convention,C0111:Missing module docstring
---------------------------------------------------------------------
Your code has been rated at 6.67/10 (previous run: -13.33/10, +20.00)
No config file found, using default configuration
Output from Console window (Help->Developer Tools menu)
TypeError: Cannot read property 'Threads' of undefined
at PythonDebugger.threadsRequest (/home/balsoft/.vscode/extensions/donjayamanne.python-0.6.4/out/client/debugger/Main.js:340:27)
at PythonDebugger.DebugSession.dispatchRequest (/home/balsoft/.vscode/extensions/donjayamanne.python-0.6.4/node_modules/vscode-debugadapter/lib/debugSession.js:427:22)
at PythonDebugger.ProtocolServer._handleData (/home/balsoft/.vscode/extensions/donjayamanne.python-0.6.4/node_modules/vscode-debugadapter/lib/protocol.js:104:38)
at Socket.<anonymous> (/home/balsoft/.vscode/extensions/donjayamanne.python-0.6.4/node_modules/vscode-debugadapter/lib/protocol.js:24:60)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20): Error: TypeError: Cannot read property 'Threads' of undefined
at PythonDebugger.threadsRequest (/home/balsoft/.vscode/extensions/donjayamanne.python-0.6.4/out/client/debugger/Main.js:340:27)
at PythonDebugger.DebugSession.dispatchRequest (/home/balsoft/.vscode/extensions/donjayamanne.python-0.6.4/node_modules/vscode-debugadapter/lib/debugSession.js:427:22)
at PythonDebugger.ProtocolServer._handleData (/home/balsoft/.vscode/extensions/donjayamanne.python-0.6.4/node_modules/vscode-debugadapter/lib/protocol.js:104:38)
at Socket.<anonymous> (/home/balsoft/.vscode/extensions/donjayamanne.python-0.6.4/node_modules/vscode-debugadapter/lib/protocol.js:24:60)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
at file:////opt/visual-studio-code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:2217016
at Object.v [as _notify] (file:////opt/visual-studio-code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:68877)
at Object.enter (file:////opt/visual-studio-code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:72378)
at n.Class.derive._oncancel._run (file:////opt/visual-studio-code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:73699)
at n.Class.derive._oncancel._error (file:////opt/visual-studio-code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:73216)
at file:////opt/visual-studio-code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:1952866
at g.e.dispatch (file:////opt/visual-studio-code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:1954217)
at g.e.handleData (file:////opt/visual-studio-code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:1953725)
at Socket.<anonymous> (file:////opt/visual-studio-code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:1952726)
at emitOne (events.js:96:13)
Note
If I don't run my script on remote device and attempt to start remote debugger it fails as expected (ECONNREFUSED), so it's almost definetly a bug in debugger.
Copied from original issue: DonJayamanne/pythonVSCode#999
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-debuggingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from posterIssue requires more information from poster
Activity
DonJayamanne commentedon Nov 13, 2017
Please try using ptvsd 3.0.0 (temporary solution)
DonJayamanne commentedon Nov 13, 2017
From Derrick (@d4tech) on June 21, 2017 8:31
The issue still persists even after using ptvsd 3.0.0.
DonJayamanne commentedon Nov 13, 2017
From Andrew Holway (@mooperd) on July 18, 2017 8:18
+1
DonJayamanne commentedon Nov 13, 2017
From Wouter (@woutor) on July 28, 2017 22:3
For those using Django, try to run with the --nothreading argument:
python manage.py runserver 0.0.0.0:8000 --noreload --nothreadingDonJayamanne commentedon Nov 13, 2017
From Moeen Zamani (@moeenz) on August 11, 2017 18:17
Apparently there's an issue with port numbers. I changed it from 3xxx to 9xxx and everything's working fine.
DonJayamanne commentedon Nov 13, 2017
Alexander Bantyev (@balsoft) are you still experiencing this issue.
DonJayamanne commentedon Nov 13, 2017
From Waleed Abdulla (@waleedka) on October 16, 2017 0:51
I'm experiencing this issue as well while trying to debug a python script inside a Docker container. I tried using ptvsd 3.0.0 as recommended in one of the comments above but that didn't make a difference.
VS Code version: 1.17.1
Python Extension version: 0.7.0
Python Version: 3.5.2
OS and version: OSX 10.11.6
launch.json
Developer Tools Log:
DonJayamanne commentedon Nov 16, 2017
Could be related to #157 (even though that's local debugging)
DonJayamanne commentedon Jan 2, 2018
Alexander Bantyev (@balsoft) Waleed Abdulla (@waleedka) Are you still experiencing this issue with the latest version of the extension.
We've fixed a number of bugs in the debugger since then.
Please could you check and get back to me.
I've tested this at my end and it works as expected.
MikhailArkhipov commentedon Feb 12, 2018
It's been a while without more info, closing. Feel free to reactivate if this is still a problem. Thanks.