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

Python Language Server does not Restart #6405

Closed
CristopherH95 opened this issue Sep 16, 2024 · 1 comment
Closed

Python Language Server does not Restart #6405

CristopherH95 opened this issue Sep 16, 2024 · 1 comment
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@CristopherH95
Copy link

CristopherH95 commented Sep 16, 2024

Type: Bug

Behaviour

Attempting to restart the Python language server, when running inside a Dev Container, stops the server but never starts it again.

Note: I encountered this while using Dev Container volume mounting on Windows.

Steps to reproduce:

  1. Create a Dev Container where the Python extension is installed.
  2. Once the workspace is setup, attempt to restart the Python language server via the "Python: Restart Language Server" command in the Command Palette.
  3. Observe in the "Python Language Server" output, that the server processes has exited.
  4. Wait for server to start again, observe that it does not start.

Diagnostic data

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

2024-09-16 18:35:33.091 [info] Telemetry level is off
2024-09-16 18:35:33.091 [info] Experiments are disabled, only manually opted experiments are active.
2024-09-16 18:35:33.091 [warning] Dir "/workspace/.pixi/envs" is not watchable (directory does not exist)
2024-09-16 18:35:33.091 [info] Default formatter is set to ms-python.black-formatter for workspace /workspace
2024-09-16 18:35:33.092 [info] Python interpreter path: /usr/local/bin/python
2024-09-16 18:35:33.382 [info] > pyenv which python
2024-09-16 18:35:33.382 [info] cwd: .
2024-09-16 18:35:43.737 [info] Starting Pylance language server.
2024-09-16 18:36:52.899 [error] [
  'Failed to start language server, Class name = h, completed in 4ms, has a falsy return value, Arg 1: <Uri:/workspace>, Arg 2: {"id":"/usr/local/bin/python","sysPrefix":"/usr/local","envType":"Global","envName":"","envPath":"","path":"/usr/local/bin/python","architecture":3,"sysVersion":"3.9.19 (main, May 14 2024, 09:00:30) \\n[GCC 12.2.0]","version":{"raw":"3.9.19","major":3,"minor":9,"patch":19,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.9.19 64-bit","detailedDisplayName":"Python 3.9.19 64-bit"}, 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","jupyter.runStartupCommands"]},"outputChannel":{"name":"Python Language Server","logLevel":3},"revealOutputChannelOn":4,"initializationOptions":{"experimentationSupport":true,"trustedWorkspaceSupport":true},"middleware":{"serviceContainer":{"container":{"options":{"autoBindInjectable":false,"defaultScope":"Transient","skipBaseClassChecks":true},"id":0,"_bindingDictionary":{"_map":{}},"_snapshots":[],"_middleware":null,"_activations":{"_map":{}},"_deactivations":{"_map":{}},"parent":null,"_metadataReader":{},"_moduleActivationStore":{"_map":{}}}},"serverVersion":"2024.9.1","lastCaptured":{},"nextWindow":0,"eventCount":0,"workspace":{},"connectedPromise":{"scope":null,"_resolved":true,"_rejected":false,"_promise":{}},"notebooks":{},"eventName":"LANGUAGE_SERVER.REQUEST"}}, Return Value: undefined',
  [Error: LanguageStatusItem with id 'python.analysis.typeCheckingMode' ALREADY exists
  	at c.createLanguageStatusItem (/root/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/out/vs/workbench/api/node/extensionHostProcess.js:161:163942)
  	at Object.createLanguageStatusItem (/root/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/out/vs/workbench/api/node/extensionHostProcess.js:171:38483)
  	at _0xbcc266.createStatusItem (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:275986)
  	at _0xbcc266.updateStatusItem (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:289545)
  	at _0xbcc266.activate (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:273499)
  	at _0x31c314 (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:321112)
  	at _0x2858ed (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:246910)
  	at async _0xe3bdb8._startClient (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:193154)
  	at async _0xe3bdb8._createNewRequest (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:192675)
  	at async _0xe3bdb8._enqueueRequestAndWaitForRun (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191917)
  	at async _0xe3bdb8.startClient (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191380)
  	at async h.start (/root/.vscode-server/extensions/ms-python.python-2024.14.1-linux-x64/out/client/extension.js:2:39659)]
]
2024-09-16 18:36:52.899 [error] [
  'Starting language server, Class name = d, completed in 6ms, has a falsy return value, , Return Value: undefined',
  [Error: LanguageStatusItem with id 'python.analysis.typeCheckingMode' ALREADY exists
  	at c.createLanguageStatusItem (/root/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/out/vs/workbench/api/node/extensionHostProcess.js:161:163942)
  	at Object.createLanguageStatusItem (/root/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/out/vs/workbench/api/node/extensionHostProcess.js:171:38483)
  	at _0xbcc266.createStatusItem (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:275986)
  	at _0xbcc266.updateStatusItem (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:289545)
  	at _0xbcc266.activate (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:273499)
  	at _0x31c314 (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:321112)
  	at _0x2858ed (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:246910)
  	at async _0xe3bdb8._startClient (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:193154)
  	at async _0xe3bdb8._createNewRequest (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:192675)
  	at async _0xe3bdb8._enqueueRequestAndWaitForRun (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191917)
  	at async _0xe3bdb8.startClient (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191380)
  	at async h.start (/root/.vscode-server/extensions/ms-python.python-2024.14.1-linux-x64/out/client/extension.js:2:39659)]
]
2024-09-16 18:36:52.899 [error] [
  'Restarting language server, Class name = d, completed in 9ms, has a falsy return value, , Return Value: undefined',
  [Error: LanguageStatusItem with id 'python.analysis.typeCheckingMode' ALREADY exists
  	at c.createLanguageStatusItem (/root/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/out/vs/workbench/api/node/extensionHostProcess.js:161:163942)
  	at Object.createLanguageStatusItem (/root/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/out/vs/workbench/api/node/extensionHostProcess.js:171:38483)
  	at _0xbcc266.createStatusItem (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:275986)
  	at _0xbcc266.updateStatusItem (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:289545)
  	at _0xbcc266.activate (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:273499)
  	at _0x31c314 (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:321112)
  	at _0x2858ed (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:246910)
  	at async _0xe3bdb8._startClient (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:193154)
  	at async _0xe3bdb8._createNewRequest (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:192675)
  	at async _0xe3bdb8._enqueueRequestAndWaitForRun (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191917)
  	at async _0xe3bdb8.startClient (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191380)
  	at async h.start (/root/.vscode-server/extensions/ms-python.python-2024.14.1-linux-x64/out/client/extension.js:2:39659)]
]
2024-09-16 18:36:52.899 [error] [
  'Failed to restart language server, Class name = d, completed in 9ms, has a falsy return value, , Return Value: undefined',
  [Error: LanguageStatusItem with id 'python.analysis.typeCheckingMode' ALREADY exists
  	at c.createLanguageStatusItem (/root/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/out/vs/workbench/api/node/extensionHostProcess.js:161:163942)
  	at Object.createLanguageStatusItem (/root/.vscode-server/bin/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/out/vs/workbench/api/node/extensionHostProcess.js:171:38483)
  	at _0xbcc266.createStatusItem (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:275986)
  	at _0xbcc266.updateStatusItem (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:289545)
  	at _0xbcc266.activate (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:273499)
  	at _0x31c314 (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:321112)
  	at _0x2858ed (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:246910)
  	at async _0xe3bdb8._startClient (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:193154)
  	at async _0xe3bdb8._createNewRequest (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:192675)
  	at async _0xe3bdb8._enqueueRequestAndWaitForRun (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191917)
  	at async _0xe3bdb8.startClient (/root/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191380)
  	at async h.start (/root/.vscode-server/extensions/ms-python.python-2024.14.1-linux-x64/out/client/extension.js:2:39659)]
]

Extension version: 2024.14.1
VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2

  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.19
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
autopep8 ms-python.autopep8 2024.0.0
Black Formatter ms-python.black-formatter 2024.2.0
Django batisteo.vscode-django 1.15.0
ESLint dbaeumer.vscode-eslint 3.0.10
Flake8 ms-python.flake8 2023.10.0
JavaScript Debugger ms-vscode.js-debug 1.93.0
Pylance ms-python.vscode-pylance 2024.9.1
Python ms-python.python 2024.14.1
Python Debugger ms-python.debugpy 2024.10.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.9
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Sep 17, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 17, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Sep 17, 2024

This should be a dupe of #6378

Alternatively, Developer : Restart Extension Host should do the same thing as restart language server.

@rchiodo rchiodo closed this as completed Sep 17, 2024
@rchiodo rchiodo added duplicate This issue or pull request already exists and removed needs repro Issue has not been reproduced yet labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants