microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.7k stars 769 forks source link

Unhandled method python/isTrustedWorkspace #4318

Closed zzzeek closed 1 year ago

zzzeek commented 1 year ago

Environment data

pylance v2023.5.11

$ python Python 3.10.0 (default, Nov 5 2021, 17:23:47) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux

this happens when I run vscode on the repository for alembic: https://github.com/sqlalchemy/alembic/

however I'm not sure if it's local environment or what, I tried deleting the .vscode directory and starting clean, etc. I suspect vscode had an update recently and I just have some stale files or whatever but I can't seem to get this working. lots of messages in the log hopefully point to the problem:

Error: Unhandled method python/isTrustedWorkspace
    at /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.11/dist/vendor.bundle.js:2:748110
    at ie (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.11/dist/vendor.bundle.js:2:748404)
    at /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.11/dist/vendor.bundle.js:2:743163
    at Immediate.<anonymous> (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.11/dist/vendor.bundle.js:2:743183)
    at processImmediate (node:internal/timers:466:21)
[Info  - 3:05:29 PM] (2262053) Pylance language server 2023.5.11 (pyright 009aef31) starting
[Info  - 3:05:29 PM] (2262053) Server root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.11/dist
[Info  - 3:05:29 PM] Connection to server got closed. Server will restart.
[Info  - 3:05:29 PM] (2262053) Starting service instance "alembic"
[Info  - 3:05:29 PM] (2262053) Auto format for strings enabled
[Info  - 3:05:30 PM] (2262053) Setting pythonPath for service "alembic": "/home/classic/dev/conferences/sqla_mini_tutorial/.venv/bin/python"
[Info  - 3:05:30 PM] (2262053) Loading pyproject.toml file at /home/classic/dev/alembic/pyproject.toml
[Error - 3:05:30 PM] (2262053) Pyproject file "/home/classic/dev/alembic/pyproject.toml" is missing "[tool.pyright]" section.
[Warn  - 3:05:30 PM] (2262053) stubPath /home/classic/dev/alembic/typings is not a valid directory.
[Info  - 3:05:30 PM] (2262053) Assuming Python version 3.10
[Info  - 3:05:30 PM] (2262089) Pylance language server 2023.5.11 (pyright 009aef31) starting
[Info  - 3:05:30 PM] (2262089) Server root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.11/dist
[Info  - 3:05:30 PM] (2262089) Starting service instance "alembic"
[Error - 3:05:30 PM] Server initialization failed.
Error: command 'pyright.createtypestub' already exists
    at m.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:124270)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:22984)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144657)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144236)
    at w.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2096147)
    at w.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2083696)
    at async w.start (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2080711)
[Error - 3:05:30 PM] Pylance client: couldn't create connection to server.
Error: command 'pyright.createtypestub' already exists
    at m.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:124270)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:22984)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144657)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144236)
    at w.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2096147)
    at w.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2083696)
    at async w.start (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2080711)
[Error - 3:05:30 PM] Sending notification textDocument/didOpen failed.
Error: command 'pyright.createtypestub' already exists
    at m.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:124270)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:22984)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144657)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144236)
    at w.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2096147)
    at w.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2083696)
    at async w.start (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2080711)
[Error - 3:05:30 PM] Restarting server failed
Error: command 'pyright.createtypestub' already exists
    at m.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:124270)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:22984)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144657)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144236)
    at w.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2096147)
    at w.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2083696)
    at async w.start (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2080711)
[Error - 3:05:30 PM] Sending document notification textDocument/didOpen failed
Error: command 'pyright.createtypestub' already exists
    at m.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:124270)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:22984)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144657)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2144236)
    at w.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2096147)
    at w.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2083696)
    at async w.start (/home/classic/.vscode/extensions/ms-python.python-2023.6.1/out/client/extension.js:2:2080711)
[Info  - 3:05:30 PM] (2262053) Found 375 source files
[Info  - 3:05:31 PM] (2262053) Background analysis(1) root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.11/dist
[Info  - 3:05:31 PM] (2262053) Background analysis(1) started
[Info  - 3:05:31 PM] (2262053) Indexer background runner(2) root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.11/dist (index)
[Info  - 3:05:31 PM] (2262053) Indexing(2) started
[Info  - 3:05:32 PM] (2262053) scanned(2) 29 files over 1 exec env
[Info  - 3:05:33 PM] (2262053) indexed(2) 16 files over 1 exec env
[Info  - 3:05:33 PM] (2262053) Indexing finished(2).
[Info  - 3:05:34 PM] (2262053) [BG(1)] Long operation: checking: /home/classic/dev/alembic/alembic/operations/ops.py (2162ms)
[Info  - 3:05:34 PM] (2262053) [BG(1)] Long operation: analyzing: /home/classic/dev/alembic/alembic/operations/ops.py (2659ms)
rchiodo commented 1 year ago

Thanks for the issue.

I believe the root cause of your problem is you're using a Prerelease Pylance, but an older Python extension. You should either use an older Pylance extension or upgrade your Python extension to the latest one.

zzzeek commented 1 year ago

great! switched to prerelease python and back in business

zzzeek commented 1 year ago

I am still getting this error and similar ones quite often, using any combination of pylance / python releases (release, pre-release), but I am not getting it consistently. It still seems like something changed maybe in one of my other plugins and I will continue investigating.

zzzeek commented 1 year ago

I will note that when I fully close out vscode, I still have a lot of zombie processes running that I have to kill -9 manually:

$ ps -ef | grep code
classic  2414306    2848  0 09:51 pts/0    00:00:00 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
classic  2414309    2848  0 09:51 pts/1    00:00:00 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
classic  2424116    2848  0 11:29 pts/2    00:00:00 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
classic  2440000    2848  0 15:31 pts/5    00:00:00 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
classic  2440003    2848  0 15:31 pts/7    00:00:00 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
classic  2440008    2848  0 15:31 pts/8    00:00:00 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
classic  2440757    2848  0 15:31 pts/9    00:00:00 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
classic  2440761    2848  0 15:31 pts/10   00:00:00 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
classic  2440764    2848  0 15:31 pts/11   00:00:00 /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
rchiodo commented 1 year ago

Those would be from VS code itself, not pylance or python. You could probably log an issue on VS code.

zzzeek commented 1 year ago

this is the log, i would think vscode devs would think this is quite specific to pylance, how should I phrase this to note that this is not actually a pylance issue when it's all pylance stack traces?

what would be helpful here would be more specifics over exactly the origins of this message so that its true source can be more accurately identified

Error: Unhandled method python/isTrustedWorkspace
    at /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/vendor.bundle.js:2:743994
    at ie (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/vendor.bundle.js:2:744288)
    at /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/vendor.bundle.js:2:739047
    at Immediate.<anonymous> (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/vendor.bundle.js:2:739067)
    at processImmediate (node:internal/timers:466:21)

2023-05-09 08:29:55.530 [info] [Info  - 8:29:55 AM] (58100) Server root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist
2023-05-09 08:29:55.549 [info] [Info  - 8:29:55 AM] (58100) Starting service instance "sqlalchemy"
2023-05-09 08:29:55.568 [info] [Info  - 8:29:55 AM] Connection to server got closed. Server will restart.
2023-05-09 08:29:55.626 [info] [Info  - 8:29:55 AM] (58100) Auto format for strings enabled
2023-05-09 08:29:55.913 [info] [Info  - 8:29:55 AM] (58100) Background analysis(1) root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist
2023-05-09 08:29:56.042 [info] [Info  - 8:29:56 AM] (58100) Background analysis(1) started
2023-05-09 08:29:56.088 [info] [Info  - 8:29:56 AM] (58100) Setting pythonPath for service "sqlalchemy": "/home/classic/dev/record/.venv/bin/python"
2023-05-09 08:29:56.095 [info] [Info  - 8:29:56 AM] (58100) Loading pyproject.toml file at /home/classic/dev/sqlalchemy/pyproject.toml
2023-05-09 08:29:56.169 [info] [Info  - 8:29:56 AM] (58100) Assuming Python version 3.11
2023-05-09 08:29:56.169 [info] [Info  - 8:29:56 AM] (58100) No include entries specified; assuming /home/classic/dev/sqlalchemy
2023-05-09 08:29:56.169 [info] [Info  - 8:29:56 AM] (58100) Auto-excluding **/node_modules
2023-05-09 08:29:56.212 [info] [Info  - 8:29:56 AM] (58100) Auto-excluding **/__pycache__
2023-05-09 08:29:56.280 [info] [Info  - 8:29:56 AM] (58100) Auto-excluding **/.*
2023-05-09 08:29:56.353 [info] [Warn  - 8:29:56 AM] (58100) stubPath /home/classic/dev/sqlalchemy/typings is not a valid directory.
2023-05-09 08:29:56.364 [info] [Info  - 8:29:56 AM] (58142) Pylance language server 2023.5.10 (pyright c400d889) starting
2023-05-09 08:29:56.366 [info] [Info  - 8:29:56 AM] (58142) Server root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist
2023-05-09 08:29:56.366 [info] [Info  - 8:29:56 AM] (58142) Starting service instance "sqlalchemy"
2023-05-09 08:29:56.369 [info] [Error - 8:29:56 AM] Server initialization failed.
2023-05-09 08:29:56.369 [info] Error: command 'pyright.createtypestub' already exists
    at e.ExtHostCommands.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:123788)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:23226)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2106325)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2105904)
    at S.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2057815)
    at S.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2045364)
    at async S.start (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2042379)
2023-05-09 08:29:56.369 [info] [Error - 8:29:56 AM] Pylance client: couldn't create connection to server.
2023-05-09 08:29:56.369 [info] Error: command 'pyright.createtypestub' already exists
    at e.ExtHostCommands.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:123788)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:23226)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2106325)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2105904)
    at S.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2057815)
    at S.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2045364)
    at async S.start (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2042379)
2023-05-09 08:29:56.369 [info] [Error - 8:29:56 AM] Sending notification textDocument/didOpen failed.
2023-05-09 08:29:56.369 [info] Error: command 'pyright.createtypestub' already exists
    at e.ExtHostCommands.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:123788)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:23226)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2106325)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2105904)
    at S.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2057815)
    at S.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2045364)
    at async S.start (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2042379)
2023-05-09 08:29:56.369 [info] [Error - 8:29:56 AM] Restarting server failed
2023-05-09 08:29:56.369 [info] Error: command 'pyright.createtypestub' already exists
    at e.ExtHostCommands.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:123788)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:23226)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2106325)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2105904)
    at S.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2057815)
    at S.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2045364)
    at async S.start (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2042379)
2023-05-09 08:29:56.369 [info] [Error - 8:29:56 AM] Sending document notification textDocument/didOpen failed
2023-05-09 08:29:56.369 [info] Error: command 'pyright.createtypestub' already exists
    at e.ExtHostCommands.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:123788)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:23226)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2106325)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2105904)
    at S.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2057815)
    at S.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2045364)
    at async S.start (/home/classic/.vscode/extensions/ms-python.python-2023.9.11251005/out/client/extension.js:2:2042379)
2023-05-09 08:29:56.570 [info] [Info  - 8:29:56 AM] (58100) Found 1678 source files
2023-05-09 08:29:57.508 [info] [Info  - 8:29:57 AM] (58100) Indexer background runner(2) root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist (index)
2023-05-09 08:29:57.509 [info] [Info  - 8:29:57 AM] (58100) Indexing(2) started
2023-05-09 08:29:58.341 [info] [Info  - 8:29:58 AM] (58100) scanned(2) 48 files over 1 exec env
2023-05-09 08:29:59.841 [info] [Info  - 8:29:59 AM] (58100) indexed(2) 29 files over 1 exec env
2023-05-09 08:29:59.850 [info] [Info  - 8:29:59 AM] (58100) Indexing finished(2).
2023-05-09 08:30:00.403 [info] [Info  - 8:30:00 AM] (58100) [BG(1)] Long operation: checking: /home/classic/dev/sqlalchemy/examples/asyncio/greenlet_orm.py (2530ms)
2023-05-09 08:30:00.403 [info] [Info  - 8:30:00 AM] (58100) [BG(1)] Long operation: analyzing: /home/classic/dev/sqlalchemy/examples/asyncio/greenlet_orm.py (2539ms)
zzzeek commented 1 year ago

for that one I had pre-release Python and current release pylance (the opposite of the previous arrangement). I've now set them both to "Current release", pylance v2023.5.10 and python v2023.8.0 . vscode is code-1.78.0-1683145689.el7.x86_64 on Fedora. Error continues to reproduce (see below).

I'm trying to pin down if the error is things like, more than one vscode is running, is it a particular environment that needs to be running etc., but it seems to just be sporadic and not dependent on any one environment or pre-condition.

Still seems like something that is going to be really silly, some file somewhere, some fedora thing, not really sure.

2023-05-09 08:58:02.998 [info] [Info  - 8:58:02 AM] (60690) Pylance language server 2023.5.10 (pyright c400d889) starting
2023-05-09 08:58:02.999 [info] [Info  - 8:58:02 AM] (60718) Pylance language server 2023.5.10 (pyright c400d889) starting
2023-05-09 08:58:03.135 [info] [Info  - 8:58:03 AM] (60690) Server root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist
2023-05-09 08:58:03.135 [info] [Info  - 8:58:03 AM] (60718) Server root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist
2023-05-09 08:58:03.198 [info] [Info  - 8:58:03 AM] (60690) Starting service instance "record"
2023-05-09 08:58:03.198 [info] [Info  - 8:58:03 AM] (60718) Starting service instance "record"
2023-05-09 08:58:03.224 [info] [Info  - 8:58:03 AM] (60690) Auto format for strings enabled
2023-05-09 08:58:03.269 [info] [Error - 8:58:03 AM] Server initialization failed.
2023-05-09 08:58:03.269 [info] Error: command 'pyright.createtypestub' already exists
    at e.ExtHostCommands.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:123788)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:23226)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2106221)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2105800)
    at S.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2057711)
    at S.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2045260)
    at runNextTicks (node:internal/process/task_queues:61:5)
    at process.processImmediate (node:internal/timers:437:9)
    at async S.start (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2042275)
    at async Object.start (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:82191)
    at async _0x21f608.<computed>._startClient (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:32634)
    at async _0x21f608.<computed>._createNewRequest (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:32082)
    at async _0x21f608.<computed>._enqueueRequestAndWaitForRun (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:31281)
    at async _0x21f608.<computed>.startClient (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:30619)
    at async h.start (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:36834)
2023-05-09 08:58:03.269 [info] [Error - 8:58:03 AM] Pylance client: couldn't create connection to server.
2023-05-09 08:58:03.269 [info] Error: command 'pyright.createtypestub' already exists
    at e.ExtHostCommands.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:123788)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:23226)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2106221)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2105800)
    at S.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2057711)
    at S.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2045260)
    at runNextTicks (node:internal/process/task_queues:61:5)
    at process.processImmediate (node:internal/timers:437:9)
    at async S.start (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2042275)
    at async Object.start (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:82191)
    at async _0x21f608.<computed>._startClient (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:32634)
    at async _0x21f608.<computed>._createNewRequest (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:32082)
    at async _0x21f608.<computed>._enqueueRequestAndWaitForRun (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:31281)
    at async _0x21f608.<computed>.startClient (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:30619)
    at async h.start (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:36834)
2023-05-09 08:58:03.269 [info] [Error - 8:58:03 AM] Sending notification textDocument/didOpen failed.
2023-05-09 08:58:03.269 [info] Error: command 'pyright.createtypestub' already exists
    at e.ExtHostCommands.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:123788)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:23226)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2106221)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2105800)
    at S.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2057711)
    at S.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2045260)
    at runNextTicks (node:internal/process/task_queues:61:5)
    at process.processImmediate (node:internal/timers:437:9)
    at async S.start (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2042275)
    at async Object.start (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:82191)
    at async _0x21f608.<computed>._startClient (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:32634)
    at async _0x21f608.<computed>._createNewRequest (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:32082)
    at async _0x21f608.<computed>._enqueueRequestAndWaitForRun (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:31281)
    at async _0x21f608.<computed>.startClient (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:30619)
    at async h.start (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:36834)
2023-05-09 08:58:03.270 [info] [Error - 8:58:03 AM] Sending document notification textDocument/didOpen failed
2023-05-09 08:58:03.270 [info] Error: command 'pyright.createtypestub' already exists
    at e.ExtHostCommands.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:123788)
    at Object.registerCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:23226)
    at t.ExecuteCommandFeature.register (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2106221)
    at t.ExecuteCommandFeature.initialize (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2105800)
    at S.initializeFeatures (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2057711)
    at S.doInitialize (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2045260)
    at runNextTicks (node:internal/process/task_queues:61:5)
    at process.processImmediate (node:internal/timers:437:9)
    at async S.start (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:2042275)
    at async Object.start (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:82191)
    at async _0x21f608.<computed>._startClient (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:32634)
    at async _0x21f608.<computed>._createNewRequest (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:32082)
    at async _0x21f608.<computed>._enqueueRequestAndWaitForRun (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:31281)
    at async _0x21f608.<computed>.startClient (/home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist/extension.bundle.js:1:30619)
    at async h.start (/home/classic/.vscode/extensions/ms-python.python-2023.8.0/out/client/extension.js:2:36834)
2023-05-09 08:58:03.543 [info] [Info  - 8:58:03 AM] (60718) Background analysis(1) root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist
2023-05-09 08:58:03.555 [info] [Info  - 8:58:03 AM] (60718) Background analysis(1) started
2023-05-09 08:58:03.725 [info] [Info  - 8:58:03 AM] (60718) Setting pythonPath for service "record": "/home/classic/.venv3/bin/python"
2023-05-09 08:58:03.726 [info] [Info  - 8:58:03 AM] (60718) Loading pyproject.toml file at /home/classic/dev/record/pyproject.toml
2023-05-09 08:58:03.763 [info] [Error - 8:58:03 AM] (60718) Pyproject file "/home/classic/dev/record/pyproject.toml" is missing "[tool.pyright]" section.
2023-05-09 08:58:03.763 [info] [Warn  - 8:58:03 AM] (60718) stubPath /home/classic/dev/record/typings is not a valid directory.
2023-05-09 08:58:03.771 [info] [Info  - 8:58:03 AM] (60718) Assuming Python version 3.10
2023-05-09 08:58:03.904 [info] [Info  - 8:58:03 AM] (60718) Found 10 source files
2023-05-09 08:58:04.681 [info] [Info  - 8:58:04 AM] (60718) Indexer background runner(2) root directory: /home/classic/.vscode/extensions/ms-python.vscode-pylance-2023.5.10/dist (index)
2023-05-09 08:58:04.684 [info] [Info  - 8:58:04 AM] (60718) Indexing(2) started
2023-05-09 08:58:05.880 [info] [Info  - 8:58:05 AM] (60718) scanned(2) 414 files over 1 exec env
2023-05-09 08:58:06.642 [info] [Info  - 8:58:06 AM] (60718) [BG(1)] Long operation: analyzing: /home/classic/dev/record/record/app.py (2090ms)
2023-05-09 08:58:09.171 [info] [Info  - 8:58:09 AM] (60718) [IDX(2)] Long operation: index execution environment /home/classic/dev/record (3170ms)
2023-05-09 08:58:09.181 [info] [Info  - 8:58:09 AM] (60718) [IDX(2)] Long operation: index packages /home/classic/dev/record (3189ms)
2023-05-09 08:58:09.181 [info] [Info  - 8:58:09 AM] (60718) indexed(2) 263 files over 1 exec env
2023-05-09 08:58:09.216 [info] [Info  - 8:58:09 AM] (60718) Indexing finished(2).
zzzeek commented 1 year ago

same issue at #2765 and is still opened.

zzzeek commented 1 year ago

am testing the undocumented option python.analysis.pylanceLspClientEnabled with prerelease versions. Not sure why i didn't locate that issue when I first searched.

rchiodo commented 1 year ago

The running processes after shutdown are a VS code problem. The pyright.createTypeStub error is a pylance issue. Two separate problems.

The log you have is just for the Pylance extension. There's separate logging for VS code itself in multiple spots. If you click the Help | Report Issue menu item, I believe it will create a bug on VS code with some of that logging information in it.