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

pylance can't restart: Error: LanguageStatusItem with id 'python.analysis.typeCheckingMode' ALREADY exists #6378

Open
WarmongeringBeaver opened this issue Sep 11, 2024 · 5 comments
Assignees
Labels
bug Something isn't working regression

Comments

@WarmongeringBeaver
Copy link

WarmongeringBeaver commented Sep 11, 2024

Environment data

  • Pylance version: v2024.9.1
  • VScode "About" pannel:
Version: 1.93.0
Commit: 4849ca9bdf9666755eb463db297b69e5385090e3
Date: 2024-09-04T13:02:38.431Z
Electron: 30.4.0
ElectronBuildId: 10073054
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Linux x64 6.10.6-10-MANJARO
  • Python version: 3.12.5 from Anaconda.
  • I'm running VSCode Remote.

Note that I remember encountering the situation of pylance being unable to restart from quite a while back (multiple vscode / pylance versions), but I can't tell the exact error(s) I've encountered before.

Repro Steps

  1. Hit the "Python: Restart Language Server" command after a pylance slowdown (might be the key point because restarting pylance when no slowdown has been observed usually works).
    EDIT: actually I am currently able to reproduce this very crash (same error) every time I restart pylance now.
  2. Observe pylance dying and not restarting.

Expected behavior

Restarted pylance.

Actual behavior

No pylance anymore.

Restarting VSCode or reloading the window fixes this issue.

Logs

"python.analysis.logLevel": "Trace" is set in my user settings.

Output of the "Python" tab

2024-09-11 16:14:37.555 [error] [
  'Failed to start language server, Class name = h, completed in 20ms, has a falsy return value, Arg 1: <Uri:/workspaces/biocomp/tboyer/sources/GaussianProxy>, Arg 2: {"id":"/bin/python3.9","sysPrefix":"/usr","envType":"Global","envName":"","envPath":"","path":"/bin/python3.9","architecture":3,"sysVersion":"3.9.5 (default, Nov 23 2021, 15:27:38) \\n[GCC 9.3.0]","version":{"raw":"3.9.5","major":3,"minor":9,"patch":5,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.9.5 64-bit","detailedDisplayName":"Python 3.9.5 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":1},"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 createLanguageStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/cli/servers/Stable-4849ca9bdf9666755eb463db297b69e5385090e3/server/out/vs/workbench/api/node/extensionHostProcess.js:161:163942)
      at Object.createLanguageStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/cli/servers/Stable-4849ca9bdf9666755eb463db297b69e5385090e3/server/out/vs/workbench/api/node/extensionHostProcess.js:171:38483)
      at _0xbcc266.createStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:275986)
      at _0xbcc266.updateStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:289545)
      at _0xbcc266.activate (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:273499)
      at _0x31c314 (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:321112)
      at _0x2858ed (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:246910)
      at _0xe3bdb8._startClient (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:193154)
      at _0xe3bdb8._createNewRequest (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:192675)
      at _0xe3bdb8._enqueueRequestAndWaitForRun (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191917)
      at _0xe3bdb8.startClient (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191380)
      at h.start (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)
]
2024-09-11 16:14:37.556 [error] [
  'Starting language server, Class name = d, completed in 22ms, has a falsy return value, , Return Value: undefined',
  Error: LanguageStatusItem with id 'python.analysis.typeCheckingMode' ALREADY exists
      at createLanguageStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/cli/servers/Stable-4849ca9bdf9666755eb463db297b69e5385090e3/server/out/vs/workbench/api/node/extensionHostProcess.js:161:163942)
      at Object.createLanguageStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/cli/servers/Stable-4849ca9bdf9666755eb463db297b69e5385090e3/server/out/vs/workbench/api/node/extensionHostProcess.js:171:38483)
      at _0xbcc266.createStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:275986)
      at _0xbcc266.updateStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:289545)
      at _0xbcc266.activate (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:273499)
      at _0x31c314 (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:321112)
      at _0x2858ed (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:246910)
      at _0xe3bdb8._startClient (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:193154)
      at _0xe3bdb8._createNewRequest (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:192675)
      at _0xe3bdb8._enqueueRequestAndWaitForRun (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191917)
      at _0xe3bdb8.startClient (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191380)
      at h.start (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)
]
2024-09-11 16:14:37.565 [error] [
  'Restarting language server, Class name = d, completed in 32ms, has a falsy return value, , Return Value: undefined',
  Error: LanguageStatusItem with id 'python.analysis.typeCheckingMode' ALREADY exists
      at createLanguageStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/cli/servers/Stable-4849ca9bdf9666755eb463db297b69e5385090e3/server/out/vs/workbench/api/node/extensionHostProcess.js:161:163942)
      at Object.createLanguageStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/cli/servers/Stable-4849ca9bdf9666755eb463db297b69e5385090e3/server/out/vs/workbench/api/node/extensionHostProcess.js:171:38483)
      at _0xbcc266.createStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:275986)
      at _0xbcc266.updateStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:289545)
      at _0xbcc266.activate (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:273499)
      at _0x31c314 (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:321112)
      at _0x2858ed (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:246910)
      at _0xe3bdb8._startClient (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:193154)
      at _0xe3bdb8._createNewRequest (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:192675)
      at _0xe3bdb8._enqueueRequestAndWaitForRun (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191917)
      at _0xe3bdb8.startClient (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191380)
      at h.start (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)
]
2024-09-11 16:14:37.565 [error] [
  'Failed to restart language server, Class name = d, completed in 33ms, has a falsy return value, , Return Value: undefined',
  Error: LanguageStatusItem with id 'python.analysis.typeCheckingMode' ALREADY exists
      at createLanguageStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/cli/servers/Stable-4849ca9bdf9666755eb463db297b69e5385090e3/server/out/vs/workbench/api/node/extensionHostProcess.js:161:163942)
      at Object.createLanguageStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/cli/servers/Stable-4849ca9bdf9666755eb463db297b69e5385090e3/server/out/vs/workbench/api/node/extensionHostProcess.js:171:38483)
      at _0xbcc266.createStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:275986)
      at _0xbcc266.updateStatusItem (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:289545)
      at _0xbcc266.activate (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:273499)
      at _0x31c314 (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:321112)
      at _0x2858ed (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:246910)
      at _0xe3bdb8._startClient (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:193154)
      at _0xe3bdb8._createNewRequest (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:192675)
      at _0xe3bdb8._enqueueRequestAndWaitForRun (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191917)
      at _0xe3bdb8.startClient (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.vscode-pylance-2024.9.1/dist/extension.bundle.js:1:191380)
      at h.start (/import/bc_users/biocomp/tboyer/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)
]
2024-09-11 16:14:37.595 [debug] Extension ms-python.vscode-pylance accessed onDidChangeActiveEnvironmentPath with args: undefined
2024-09-11 16:14:37.598 [debug] Extension ms-python.vscode-pylance accessed onDidEnvironmentVariablesChange with args: undefined
2024-09-11 16:15:26.391 [debug] Found cached env for /bin/python3.9
2024-09-11 16:15:26.393 [debug] Found cached env for /bin/python3.9

The "Python Language Server" tab has no output since pylance crashed (it ends with 2024-09-11 16:14:37.725 [info] [Info - 16:14:37] Server process exited successfully

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 11, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Sep 11, 2024

I can reproduce the issue. Just run "Python Restart Language Server".

An alternative that does work is run "Developer: Restart Extension Host". This accomplishes the same thing as restarting the language server (it restarts the python extension as well).

I believe the root cause must be something in the new LSP language client that we recently updated to. It likely isn't handling shutdown correctly.

@rchiodo rchiodo added bug Something isn't working regression and removed needs repro Issue has not been reproduced yet labels Sep 11, 2024
@AlexanderPodorov
Copy link

@rchiodo , this does not work for my case.
I've updated the pylance from v2024.8.2 to v2024.9.1 and file analysis is running and never completed.
I've tried to run "Python Restart Language Server" and "Developer: Restart Extension Host", but none of them worked.
Once I downgraded back to v2024.8.2 it got back to normal.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 12, 2024

@AlexanderPodorov can you open a new issue? I'm guessing we're crashing for some reason. Restarting won't fix the crash as it will just repro over and over again.

@AlexanderPodorov
Copy link

@rchiodo , done!
#6386

@braindevices
Copy link

affect me also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression
Projects
None yet
Development

No branches or pull requests

5 participants