question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted." as I switch to the extension's 'Changelog' tab

See original GitHub issue

VS Code version

1.62.0

Extension version

2021.11.1422169775

OS type

Windows

OS version

11 x64

Python distribution

python.org

Python version

3.10.0 x86 and x64, 2.7.18 x64,

Language server

Default

Expected behaviour

As I updated Python extension to todays version, v2021.11.1422169775, in today’s updated VSCode 1.62.0, I switched to the ‘Extensions’ panel and its “Changelog” tab.

Actual behaviour

I got the title error in statusbar:

The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted.

I also notice high cpu usage during that time.

Steps to reproduce

Simply open VSCode, without opening any specific folder, and open the ‘Extensions’ panel and its “Changelog” tab.

Here is a screen capture to show what I mean:

Logs

Click to expand:
Experiment 'pythonaa' is active
Experiment 'pythonTensorboardExperiment' is active
Experiment 'pythonSurveyNotificationcf' is active
Experiment 'PythonPyTorchProfiler' is active
Experiment 'pythonDeprecatePythonPath' is active
Experiment 'pythonRunFailedTestsButtonDisplayed' is active
Experiment 'pythonRefreshTestsButtonDisplayed' is active
Experiment 'pythonRememberDebugConfig' is active
> conda info --json
> ~\AppData\Local\Programs\Python\Python38-32\python.exe -c "import sys;print(sys.executable)"
> ~\AppData\Local\Programs\Python\Python310\python.exe ~\.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\interpreterInfo.py
> ~\AppData\Local\Programs\Python\Python310-32\python.exe ~\.vscode\extensions\ms-python.python-2021.11.1422169775\pythonFiles\interpreterInfo.py
> ~\AppData\Local\Programs\Python\Python38-32\python.exe -c "import sys;print(sys.executable)"
> ~\AppData\Local\Programs\Python\Python38-32\python.exe -c "import sys;print(sys.executable)"
> ~\AppData\Local\Programs\Python\Python38-32\python.exe -c "import sys;print(sys.executable)"
Starting Jedi language server.
> ~\AppData\Local\Programs\Python\Python38-32\python.exe -c "import sys;print(sys.executable)"
Error 2021-11-04 21:16:31: Failed to start language server, Class name = r, completed in 596ms, has a falsy return value, Arg 1: undefined, Arg 2: undefined, Arg 3: {"documentSelector":[{"scheme":"file","language":"python"},{"scheme":"untitled","language":"python"},{"scheme":"vscode-notebook","language":"python"},{"scheme":"vscode-notebook-cell","language":"python"},{"scheme":"vscode-interactive-input","language":"python"}],"synchronize":{"configurationSection":"python"},"outputChannel":{"name":"Python Language Server","_channel":{}},"revealOutputChannelOn":4,"initializationOptions":{"markupKindPreferred":"markdown","completion":{"resolveEagerly":false,"disableSnippets":false},"diagnostics":{"enable":true,"didOpen":true,"didSave":true,"didChange":true},"workspace":{"extraPaths":[],"symbols":{"maxSymbols":0}}},"middleware":{"serviceContainer":{"container":{"options":{"autoBindInjectable":false,"defaultScope":"Transient","skipBaseClassChecks":true},"id":0,"_bindingDictionary":{"_map":{}},"_snapshots":[],"_middleware":null,"parent":null,"_metadataReader":{}}},"serverVersion":"0.34.6","lastCaptured":{},"nextWindow":0,"eventCount":0,"workspace":{},"connectedPromise":{"scope":null,"_resolved":false,"_rejected":false,"_promise":{}},"eventName":"JEDI_LANGUAGE_SERVER.REQUEST","notebookAddon":{}},"connectionOptions":{"cancellationStrategy":{"_sender":{"folderName":"cdbc37254a7d33e3df0b296c6f345e7384f67ec951"}}}}, Return Value: undefined Error: Connection to server got closed. Server will not be restarted.
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:146083)
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:17:10273)
    at t (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:143862)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at X (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:230363)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at g.fireClose (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:220432)
    at Socket.<anonymous> (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:222012)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
Error 2021-11-04 21:16:31: Starting language server, Class name = r, completed in 597ms, has a falsy return value, , Return Value: undefined Error: Connection to server got closed. Server will not be restarted.
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:146083)
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:17:10273)
    at t (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:143862)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at X (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:230363)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at g.fireClose (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:220432)
    at Socket.<anonymous> (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:222012)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
Error 2021-11-04 21:16:31: Failed to start language server, Class name = r, completed in 601ms, has a falsy return value, Arg 1: undefined, Arg 2: undefined, Return Value: undefined Error: Connection to server got closed. Server will not be restarted.
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:146083)
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:17:10273)
    at t (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:143862)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at X (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:230363)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at g.fireClose (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:220432)
    at Socket.<anonymous> (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:222012)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
Error 2021-11-04 21:16:31: Failed to activate language server, Class name = a, completed in 602ms, has a falsy return value, Arg 1: undefined, Arg 2: undefined, Return Value: undefined Error: Connection to server got closed. Server will not be restarted.
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:146083)
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:17:10273)
    at t (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:143862)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at X (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:230363)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at g.fireClose (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:220432)
    at Socket.<anonymous> (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:222012)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
Error 2021-11-04 21:16:31: Failed to activate a workspace, Class name = m, completed in 1312ms, has a falsy return value, Arg 1: undefined, Return Value: undefined Error: Connection to server got closed. Server will not be restarted.
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:146083)
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:17:10273)
    at t (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:143862)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at X (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:230363)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at g.fireClose (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:220432)
    at Socket.<anonymous> (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:222012)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
Error 2021-11-04 21:16:31: Failure during activation. Error: Connection to server got closed. Server will not be restarted.
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:146083)
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:17:10273)
    at t (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:143862)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at X (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:230363)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at g.fireClose (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:220432)
    at Socket.<anonymous> (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:222012)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
Error 2021-11-04 21:16:31: sendStartupTelemetry() failed. Error: Connection to server got closed. Server will not be restarted.
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:146083)
    at S.handleConnectionClosed (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:17:10273)
    at t (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:143862)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at X (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:230363)
    at invoke (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:264940)
    at o.fire (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:9:265701)
    at g.fireClose (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:220432)
    at Socket.<anonymous> (c:\Users\Kostas\.vscode\extensions\ms-python.python-2021.11.1422169775\out\client\extension.js:52:222012)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
> ~\AppData\Local\Programs\Python\Python38-32\python.exe -c "import sys;print(sys.executable)"

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
karthiknadigcommented, Nov 5, 2021

defaultInterpreterValue is not updated by selecting python interpreters for the selector. It has to be manually set. As the description suggests we use it as a fall back if nothing is selected for a given workspace.

0reactions
darkredcommented, Nov 5, 2021

we should probably update the text for defaultInterpreterValue to let users know that it has to be manually set.

Updating the description would be useful, but I hope there’s more room for improvement:

The python.defaultInterpreterPath description is as follows:

Path to Python, you can use a custom version of Python by modifying this setting to include the full path. This default setting is used as a fallback if no interpreter is selected for the workspace. The extension will also not set nor change the value of this setting, it will only read from it.

My suggestion is, if possible, to make the extension validate the python.defaultInterpreterPath value (=whether it points to an existing python.exe executable or it’s just python, or it’s invalid). And additionally, when first/clean installing the extension, to have a default/initial value (maybe python or to be just empty).

I am suggesting this because, currently, this setting works as if it’s a setting of VSCode itself and not of an extension, which is not the case. And, as it is (i.e. that the extension doesn’t set nor change its value, but only reads it), if for some some reason it gets an invalid value, or its value becomes invalid after uninstalling some old Python version (like it occurred to me), it will permanently get stuck with that wrong value until the user manually sets it (or resets it to python).

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Python Tools server crashed 5 times in the last 3 minutes ...
Uninstall Python extension (if you have pylance uninstall it first). · Close all instances of VS Code. · Go to, %USERPROFILE%/. · Delete...
Read more >
The Python Tools server crashed 5 times in the last 3 minutes ...
Uninstall Python extension (if you have pylance uninstall it first).\ · Close all instances of VS Code.\ · Go to, %USERPROFILE%/. · Delete...
Read more >
Python with remote session: "The isort server crashed 5 times ...
So I just set up a remote connection to a linux server in vscode, and installed the Python extension. I immediately get the...
Read more >
Changelog — Python 3.11.1 documentation
server no longer allows terminal control characters sent within a garbage request to be printed to the stderr server log. This is done...
Read more >
Visual Studio 2022 version 17.0 Release Notes | Microsoft Learn
Get the latest features, bug fixes, and support for Visual Studio 2022 version ... breaking changes and Visual Studio 2019 extensions will not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found