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

Something wrong with launching Python Debugger in 3.10 #3364

Closed
CT702-7 opened this issue May 12, 2021 · 10 comments
Closed

Something wrong with launching Python Debugger in 3.10 #3364

CT702-7 opened this issue May 12, 2021 · 10 comments

Comments

@CT702-7
Copy link

CT702-7 commented May 12, 2021

OS/Web Information

图片

Steps to Reproduce

  1. Update code-server from 3.9.3 to 3.10
  2. Update Jupyter and python extension to the latest version
  3. Run a python file

Expected

Everything should be as usual.

Actual

图片
It said that there is something wrong in my configuration, which works perfectly in 3.9.3.
I found that it could be fixed by degrading the extension of jupyter to 2021.3. In this way, I can run python files corretctly. However, jupyter notebooks cannot be shown correctly in this way, what I get is a blank page. The following section is the log of jupyter.
It seems that the support for python is down in coder-server 3.10.

Logs

User belongs to experiment group 'pythonJediLSP'
User belongs to experiment group 'jupyterTest'
User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
User belongs to experiment group 'pythonFindInterpreter'
User belongs to experiment group 'pythonSurveyNotification'
User belongs to experiment group 'jupyterEnhancedDataViewer'

/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py pip list
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py pip list
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import jupyter"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import jupyter"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import notebook"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import notebook"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
Error 2021-05-12 03:51:56: Jupyter Kernel Spec not found for a local connection
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
Error 2021-05-12 03:52:01: Failed to start the Daemon, StdErr: Traceback (most recent call last):
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/daemon/main.py", line 126, in main
daemon_module = importlib.import_module(args.daemon_module)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/kernel_launcher_daemon.py", line 16, in
from vscode_datascience_helpers.daemon.daemon_python import (
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/daemon/daemon_python.py", line 18, in
from pyls_jsonrpc.dispatchers import MethodDispatcher
ModuleNotFoundError: No module named 'pyls_jsonrpc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py", line 26, in
runpy.run_module(module, run_name="main", alter_sys=True)
File "/usr/lib/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/daemon/main.py", line 137, in
main()
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/daemon/main.py", line 133, in main
raise Exception("Failed to start daemon")
Exception: Failed to start daemon

Error 2021-05-12 03:52:01: Failed to start the Daemon, ProcEndEx [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]
Error 2021-05-12 03:52:01: Failed to start the Daemon, Ex [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]
Error 2021-05-12 03:52:01: Pinging Daemon Failed, Class name = d, completed in 5005ms, has a falsy return value, Arg 1: {}, Return Value: undefined [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]
Error 2021-05-12 03:52:01: Failed to create daemon, Class name = d, completed in 5086ms, has a falsy return value, , Return Value: undefined [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]
Error 2021-05-12 03:52:01: Failed to create the daemon service, defaulting to activated environment [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]

/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"02aaa2e2-0231-4c29-bd96-767cc12369d9" --shell=9002 --transport="tcp" --iopub=9004 --f=/tmp/tmp-3320nn7XXl6heJhe.json
cwd: /home/ubuntu/python3/cv
/usr/bin/python3 ~/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"02aaa2e2-0231-4c29-bd96-767cc12369d9" --shell=9002 --transport="tcp" --iopub=9004 --f=/tmp/tmp-3320nn7XXl6heJhe.json
cwd: /home/ubuntu/python3/cv
Error 2021-05-12 03:52:05: Failed to start the Daemon, StdErr: Traceback (most recent call last):
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/daemon/main.py", line 126, in main
daemon_module = importlib.import_module(args.daemon_module)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/kernel_launcher_daemon.py", line 16, in
from vscode_datascience_helpers.daemon.daemon_python import (
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/daemon/daemon_python.py", line 18, in
from pyls_jsonrpc.dispatchers import MethodDispatcher
ModuleNotFoundError: No module named 'pyls_jsonrpc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/pyvsc-run-isolated.py", line 26, in
runpy.run_module(module, run_name="main", alter_sys=True)
File "/usr/lib/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/daemon/main.py", line 137, in
main()
File "/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/pythonFiles/vscode_datascience_helpers/daemon/main.py", line 133, in main
raise Exception("Failed to start daemon")
Exception: Failed to start daemon

Error 2021-05-12 03:52:05: Failed to start the Daemon, ProcEndEx [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]
Error 2021-05-12 03:52:05: Failed to start the Daemon, Ex [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]
Error 2021-05-12 03:52:05: Pinging Daemon Failed, Class name = d, completed in 5003ms, has a falsy return value, Arg 1: {}, Return Value: undefined [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]
Error 2021-05-12 03:52:05: Failed to create daemon, Class name = d, completed in 5041ms, has a falsy return value, , Return Value: undefined [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]
Error 2021-05-12 03:52:05: Failed to create the daemon service, defaulting to activated environment [Error: Timeout waiting for daemon to start
at Timeout._onTimeout (/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/client/extension.js:32:199033)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)]

Notes

This issue can be reproduced in VS Code: No

@oxy
Copy link

oxy commented May 12, 2021

This was an issue with the auto-compiled version of the Jupyter extension, most likely: I have manually fixed the version on the extension gallery.

Can you reinstall the latest versions of both ms-python.python and ms-toolsai.jupyter?

@CT702-7
Copy link
Author

CT702-7 commented May 12, 2021

@oxy
I have reinstalled the latest version of those extensions serveral times, but the problem remains.

@oxy
Copy link

oxy commented May 12, 2021

Can you provide logs when you have the latest version of both extensions?

@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label May 12, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented May 12, 2021

FWIW, I tested out the Python extension yesterday and it seemed to be working: #2675 (comment)

@CT702-7
Copy link
Author

CT702-7 commented May 13, 2021

@jsjoeio
I fully underderstand those operations in your sreemshot at bottom. And yes, in that way everything makes perfect sense. You just code in the editing area and run the file through terminal commands. However, when I press F5 in the editing area to execute the file, I got the following result:
图片
There aren't any details in the output section in code-server, where I believe prints logs. In my pointer of view, it is saying that the configuration file of my python extension is not correct.
This is launch.json of my python extension:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "python",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"console": "integratedTerminal"
}
]
}
I copy those contents directly from vscode, and work perfectly there.
This is wierd because it never happened in the 3.9.3. What's more, when I degrade ms-toolsai.jupyter to 2021.3.0, everything is ok. So maybe it is not something in ms-python.python but ms-toolsai.jupyter cause the result.

@CT702-7
Copy link
Author

CT702-7 commented May 13, 2021

@oxy
Sorry, I am not following with you. When I encounter this issue, there isn't any information in the output section in code-server, as far as I am concerned, where prints log. The picture above is all I got. If it is inadequate, could you please tell me where shall I find those logs?

@CT702-7
Copy link
Author

CT702-7 commented May 13, 2021

@oxy
I reinstalled the extension of jupyter and found out something may be involved in this issue.
It seems that something happened during the installation or initialization of ms-toolsai.jupyter.
Hope it will be helpful.

`[2021-05-13 13:14:41.344] [exthost] [info] extension host terminating: received terminate message from renderer
[2021-05-13 13:14:42.388] [exthost] [info] exiting with code 0
[2021-05-13 13:14:46.393] [exthost] [info] extension host started
[2021-05-13 13:14:46.496] [exthost] [info] ExtensionService#_doActivateExtension ms-toolsai.jupyter {"startup":false,"extensionId":{"value":"ms-toolsai.jupyter","_lower":"ms-toolsai.jupyter"},"activationEvent":"onCustomEditor:jupyter.notebook.ipynb"}
[2021-05-13 13:14:46.497] [exthost] [info] ExtensionService#loadCommonJSModule file:///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.6.0/out/client/extension
[2021-05-13 13:14:46.500] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":""}
[2021-05-13 13:14:46.501] [exthost] [info] ExtensionService#loadCommonJSModule file:///usr/lib/code-server/lib/vscode/extensions/debug-auto-launch/dist/extension
[2021-05-13 13:14:46.516] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"
"}
[2021-05-13 13:14:46.517] [exthost] [info] ExtensionService#loadCommonJSModule file:///usr/lib/code-server/lib/vscode/extensions/git/dist/main
[2021-05-13 13:14:46.681] [exthost] [error] Activating extension ms-toolsai.jupyter failed due to an error:
[2021-05-13 13:14:46.681] [exthost] [error] Error: Cannot find module '/root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.6.0/out/client/extension'
Require stack:

  • /usr/lib/code-server/lib/vscode/out/vs/loader.js
  • /usr/lib/code-server/lib/vscode/out/bootstrap-amd.js
  • /usr/lib/code-server/lib/vscode/out/bootstrap-fork.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.i._load (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:27950)
    at Function.S._load (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:24660)
    at Function.a._load (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:96:58822)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Function.t [as __$__nodeRequire] (/usr/lib/code-server/lib/vscode/out/vs/loader.js:5:101)
    at u._loadCommonJSModule (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:106:26069)
    at u._doActivateExtension (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:92:12457)
    at u._activateExtension (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:92:11516)
    at Object.actualActivateExtension (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:92:9174)
    at f._activateExtension (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:84988)
    at /usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:84670
    at Array.map ()
    at f._activateExtensions (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:84658)
    at f.activateByEvent (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:82002)
    at u._activateByEvent (/usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:92:10074)
    at /usr/lib/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:92:19411
    at processTicksAndRejections (internal/process/task_queues.js:97:5)`

@gogobd
Copy link

gogobd commented May 13, 2021

I just downgraded my cdr code-server docker because jupyter was broken, what works for me is cdr code-server 3.9.3 and https://github.com/microsoft/vscode-python/releases/download/2020.10.332292344/ms-python-release.vsix

@jsjoeio
Copy link
Contributor

jsjoeio commented May 13, 2021

I fully underderstand those operations in your sreemshot at bottom. And yes, in that way everything makes perfect sense. You just code in the editing area and run the file through terminal commands. However, when I press F5 in the editing area to execute the file, I got the following result:

Ah, my apologies. I didn't realize it was specifically with pressing F5 which sounds like it's specifically with the debugging

@jsjoeio jsjoeio changed the title Something wrong with python in 3.10 Something wrong with launching Python Debugger in 3.10 May 13, 2021
@oxy
Copy link

oxy commented Jun 18, 2021

Hey there; I just tested a clean install of 3.10.2 by installing the Python/Jupyter extensions, and it works fine (setting breakpoints, F5 for debug, autocomplete, variable/stack inspection/etc.); I'm closing this for now.

@oxy oxy closed this as completed Jun 18, 2021
@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants