Remote extension host terminates unexpectedly
Type: Bug
I am remote SSHing into a Linux server from a Windows machine using VSCode. I have the pylance extension, but as soon as I login to the server it restarts the remote extension host several times before giving up and occasionally kicking me out of the server. I used the extension bisect tool in VSCode, which determined that pylance was the cause. Disabling the extension fixes the problem. I have also tried downgrading the extension which has allowed me to remain connected for slightly longer, but not forever. (Apologies if this is not descriptive enough, I am happy to supply more information.)
Extension version: 2024.5.1 VS Code version: Code 1.89.0 (b58957e67ee1e712cebf466b995adf4c5307b2bd, 2024-05-01T02:09:22.859Z) OS version: Windows_NT x64 10.0.22631 Modes: Connection to 'ssh-remote+ap2002.chtc.wisc.edu' could not be established
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
| Load (avg) | undefined |
| Memory (System) | 15.88GB (2.88GB free) |
| Process Argv | --crash-reporter-id d100a373-6af0-4ce5-92e5-3770ea91b189 |
| Screen Reader | no |
| VM | 0% |
Connection to 'ssh-remote+ap2002.chtc.wisc.edu' could not be established
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
tftest:31042121
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
g316j359:31013175
a69g1124:31038041
pythonprt:31039817
dwnewjupytercf:31039676
Can you provide us some logs as described in the troubleshooting guide?
Can you provide us some logs as described in the troubleshooting guide?
I tried to enable the trace log level (at the User, Remote Server, and Workspace levels) but the Python Language Server output contains nothing at all. Is there another log I can provide that would contain the needed information?
When you say "contains nothing at all", do you mean there's no output at all in the Python Language Server output? Not sure how could that happen. Can you share a screenshot of that? and your settings.json?
When you say "contains nothing at all", do you mean there's no output at all in the Python Language Server output? Not sure how could that happen. Can you share a screenshot of that? and your
settings.json?
Here is a screenshot of the Python Language Server output:
And here is a screenshot of the Python output just to show that this is not a more general output problem:
Here is the text of the settings.json file:
{
"editor.minimap.enabled": false,
"jupyter.askForKernelRestart": false,
"python.autoComplete.extraPaths": [],
"python.analysis.extraPaths": [],
"remote.SSH.remotePlatform": {
"ap2002.chtc.wisc.edu": "linux"
},
"python.defaultInterpreterPath": "C:\\ProgramData\\anaconda3\\envs\\<USER'S NAME>\\python.exe",
"git.ignoreLegacyWarning": true,
"remote.SSH.useExecServer": false,
"python.analysis.logLevel": "Trace",
"python.analysis.packageIndexDepths": [
{
"name": "sklearn",
"depth": 2
},
{
"name": "matplotlib",
"depth": 2
},
{
"name": "scipy",
"depth": 2
},
{
"name": "django",
"depth": 2
},
{
"name": "flask",
"depth": 2
},
{
"name": "fastapi",
"depth": 2
}
]
}
if you are using remote and multi root workspace, make sure you are putting settings in right place and share the right setting files.
you should have settings section similar to this for your remote/workspace/folder
the precedence of setting will be folder > workspace > remote
and some setting can only applied to certain scope. for example, you can't put logLevel to folder but in workspace and up and etc.
since it looks like pylance is crashing even before starting server, you probably can't use https://github.com/microsoft/pylance-release/wiki/Collecting-data-for-an-investigation.#collecting-trace-logs-using-commands but if you somehow could manage to make server to start you could use the command to get log we need.
if you are using remote and multi root workspace, make sure you are putting settings in right place and share the right setting files.
you should have settings section similar to this for your remote/workspace/folder
the precedence of setting will be folder > workspace > remote
and some setting can only applied to certain scope. for example, you can't put
logLeveltofolderbut inworkspaceand up and etc.
I have set the loglevel setting to Trace at the User, Remote, and Workspace levels just to make sure I had the right one. The Folder option does not have this setting available as far as I can tell.
since it looks like
pylanceis crashing even before starting server, you probably can't use https://github.com/microsoft/pylance-release/wiki/Collecting-data-for-an-investigation.#collecting-trace-logs-using-commands but if you somehow could manage to make server to start you could use the command to get log we need.
I have used slightly downgraded versions of pylance recently that will successfully load/connect for a while before restarting the remote extension host. I just connected with v2024.2.3 and was able to get output in the Python Language Server. I will wait to see if the restart issue occurs and report back with the output.
After downgrading to v2024.2.1, I was able to connect to my remote ssh with pylance functioning properly, but after waiting some time in the editor pylance seemed to stutter and disconnect. It attempted to reconnect a couple times before successfully doing so. I am attaching the python language server output starting at the moment it initially disconnected.
Please note: this is NOT the exact issue I have with newer versions of pylance. If I use the most recent version, it fails to connect at all upon logging in through the ssh process. pylance python language server output v2024.2.1.txt
I can not see any issue on pylance log, it looks like pylance extension suddenly restarted. can you look other logs in the output window and see whether it contains error message such as remote got disconnected? if you see one, can you share that log with us? it might be an issue with vscode remote and we just happen to restarted since vscode-server got re-initialized.
I can not see any issue on pylance log, it looks like pylance extension suddenly restarted. can you look other logs in the output window and see whether it contains error message such as remote got disconnected? if you see one, can you share that log with us? it might be an issue with vscode remote and we just happen to restarted since
vscode-servergot re-initialized.
I monitored a couple of the logs while trying to recreate the issue, but I could not seem to identify any that would provide useful information as to what is happening. Here is the list of logs available:
For example, Extension Host (Remote) seemed promising, but it appears to clear/restart whenever this occurs, so I cannot see what happened prior to the issue occurring.
Are there any you would like to see specifically?
how about remote - SSH log? does it contain anything interesting there?
how about
remote - SSHlog? does it contain anything interesting there?
Nothing is very interesting in that log either. For example, here is all the additional output produced by this issue occurring once:
[16:17:13.840] [Forwarding server port 52873] Got connection 9
The integer at the end increases every time this happens (starts at 1).
could it be something related to something like this? https://stackoverflow.com/questions/64172004/vscode-ssh-extension-keeps-disconnecting-after-moving-to-a-new-location
could it be something related to something like this? https://stackoverflow.com/questions/64172004/vscode-ssh-extension-keeps-disconnecting-after-moving-to-a-new-location
I tried the suggested solution of removing the .vscode-server and .vscode-remote (this second one did not exist in my case, so I only removed the first one), but it did not fix the issue. The Remote Extension host still terminates upon logging in via ssh when using the most recent version of pylance.
Were there any fixes for this? It's rather annoying hehe.
Were there any fixes for this? It's rather annoying hehe.
Ultimately, I found no solution other than downgrading pylance to a version that didn't cause the issue. However, after more recent updates to pylance, the issue stopped occurring. I'm not sure what was changed, but I haven't had the issue since (knock on wood).
Thanks for the prompt response!
I have latest, but it's happening all the time. What version are you using right now?
v2025.4.1
@SKra00 I have the same version, and am on the latest vscode version. Then it's something else I guess.
Here's my log (I reproduced the crash)
2025-04-19 19:02:38.405 [info] (Client) Pylance async client (2025.4.1) started with python extension (2025.4.0)
2025-04-19 19:02:38.553 [info] [Info - 7:02:38 PM] (7068) Loading pyproject.toml file at /home/ace07/Documents/GitHub/QICKIT/pyproject.toml
2025-04-19 19:02:38.560 [info] [Info - 7:02:38 PM] (7068) Setting environmentName for service "QICKIT": "3.11.11 (.venv venv)"
2025-04-19 19:02:38.563 [info] [Info - 7:02:38 PM] (7068) Setting pythonPath for service "QICKIT": "/home/ace07/Documents/GitHub/QICKIT/.venv/bin/python"
2025-04-19 19:02:38.570 [info] [Info - 7:02:38 PM] (7068) No include entries specified; assuming /home/ace07/Documents/GitHub/QICKIT
2025-04-19 19:02:38.574 [info] [Info - 7:02:38 PM] (7068) Auto-excluding **/node_modules
2025-04-19 19:02:38.575 [info] [Info - 7:02:38 PM] (7068) Auto-excluding **/__pycache__
2025-04-19 19:02:38.587 [info] [Info - 7:02:38 PM] (7068) Auto-excluding **/.*
2025-04-19 19:02:38.588 [info] [Info - 7:02:38 PM] (7068) Assuming Python version 3.11.11.final.0
2025-04-19 19:02:38.769 [info] [Info - 7:02:38 PM] (7068) Found 187 source files
2025-04-19 19:02:38.944 [info] [Info - 7:02:38 PM] (7068) Loading pyproject.toml file at /home/ace07/Documents/GitHub/QICKIT/pyproject.toml
2025-04-19 19:02:39.063 [info] [Info - 7:02:39 PM] (7068) Setting environmentName for service "QICKIT": "3.11.11 (.venv venv)"
2025-04-19 19:02:39.071 [info] [Info - 7:02:39 PM] (7068) Setting pythonPath for service "QICKIT": "/home/ace07/Documents/GitHub/QICKIT/.venv/bin/python"
2025-04-19 19:02:39.072 [info] [Info - 7:02:39 PM] (7068) No include entries specified; assuming /home/ace07/Documents/GitHub/QICKIT
2025-04-19 19:02:39.073 [info] [Info - 7:02:39 PM] (7068) Auto-excluding **/node_modules
2025-04-19 19:02:39.073 [info] [Info - 7:02:39 PM] (7068) Auto-excluding **/__pycache__
2025-04-19 19:02:39.073 [info] [Info - 7:02:39 PM] (7068) Auto-excluding **/.*
2025-04-19 19:02:39.074 [info] [Info - 7:02:39 PM] (7068) Assuming Python version 3.11.11.final.0
2025-04-19 19:02:39.074 [info] [Info - 7:02:39 PM] (7068) Found 187 source files
2025-04-19 19:02:39.116 [info] [Info - 7:02:39 PM] (7068) BG: Priority queue background worker(2) root directory: file:///home/ace07/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist
2025-04-19 19:02:39.120 [info] [Info - 7:02:39 PM] (7068) BG: Priority queue background worker(2) started
2025-04-19 19:02:39.346 [info] [Info - 7:02:39 PM] (7068) BG: Indexer background runner(3) root directory: file:///home/ace07/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist (index)
2025-04-19 19:02:39.347 [info] [Info - 7:02:39 PM] (7068) BG: Indexing(3) started
2025-04-19 19:02:40.240 [info] [Info - 7:02:40 PM] (7068) BG: scanned(3) 361 files over 1 exec env
2025-04-19 19:02:40.444 [info] [Info - 7:02:40 PM] (7068) BG: indexed(3) 361 files over 1 exec env
2025-04-19 19:02:40.561 [info] [Info - 7:02:40 PM] (7068) BG: Indexing finished(3).
2025-04-19 19:02:52.636 [info] [Info - 7:02:52 PM] (7068) BG: [BG(1)] Long operation: checking: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_cirq_circuit.py (2960ms)
2025-04-19 19:02:52.637 [info] [Info - 7:02:52 PM] (7068) BG: [BG(1)] Long operation: analyzing: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_cirq_circuit.py (2960ms)
2025-04-19 19:02:55.585 [info] [Info - 7:02:55 PM] (7068) BG: [BG(1)] Long operation: checking: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_pennylane_circuit.py (2824ms)
2025-04-19 19:02:55.585 [info] [Info - 7:02:55 PM] (7068) BG: [BG(1)] Long operation: analyzing: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_pennylane_circuit.py (2825ms)
2025-04-19 19:02:58.287 [info] [Info - 7:02:58 PM] (7068) BG: [BG(1)] Long operation: checking: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_qiskit_circuit.py (2653ms)
2025-04-19 19:02:58.287 [info] [Info - 7:02:58 PM] (7068) BG: [BG(1)] Long operation: analyzing: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_qiskit_circuit.py (2654ms)
2025-04-19 19:03:00.216 [info] [Info - 7:03:00 PM] (7068) Starting service instance "<default>" for workspace ""
2025-04-19 19:03:00.239 [info] [Info - 7:03:00 PM] (7068) Setting environmentName for service "<default>": "3.11.11 (.venv venv)"
2025-04-19 19:03:00.239 [info] [Info - 7:03:00 PM] (7068) Setting pythonPath for service "<default>": "/home/ace07/Documents/GitHub/QICKIT/.venv/bin/python"
2025-04-19 19:03:00.239 [info] [Info - 7:03:00 PM] (7068) No include entries specified; assuming /<default workspace root>
2025-04-19 19:03:00.239 [info] [Info - 7:03:00 PM] (7068) Auto-excluding **/node_modules
2025-04-19 19:03:00.239 [info] [Info - 7:03:00 PM] (7068) Auto-excluding **/__pycache__
2025-04-19 19:03:00.239 [info] [Info - 7:03:00 PM] (7068) Auto-excluding **/.*
2025-04-19 19:03:00.256 [info] [Info - 7:03:00 PM] (7068) Assuming Python version 3.11.11.final.0
2025-04-19 19:03:00.302 [info] [Error - 7:03:00 PM] (7068) File or directory "/<default workspace root>" does not exist.
2025-04-19 19:03:00.302 [info] [Info - 7:03:00 PM] (7068) No source files found.
2025-04-19 19:03:00.679 [info] [Info - 7:03:00 PM] (7068) BG: Priority queue background worker(5) root directory: file:///home/ace07/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist
2025-04-19 19:03:00.679 [info] [Info - 7:03:00 PM] (7068) BG: Priority queue background worker(5) started
2025-04-19 19:03:19.956 [info] (Client) Pylance async client (2025.4.1) started with python extension (2025.4.0)
2025-04-19 19:03:20.350 [info] [Info - 7:03:20 PM] (7873) Server root directory: file:///home/ace07/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist
2025-04-19 19:03:20.351 [info] [Info - 7:03:20 PM] (7873) Pylance language server 2025.4.1 (pyright version 1.1.398, commit 4f24eccc) starting
2025-04-19 19:03:20.352 [info] [Info - 7:03:20 PM] (7873) Starting service instance "QICKIT" for workspace "/home/ace07/Documents/GitHub/QICKIT"
2025-04-19 19:03:20.668 [info] [Info - 7:03:20 PM] (7873) Loading pyproject.toml file at /home/ace07/Documents/GitHub/QICKIT/pyproject.toml
2025-04-19 19:03:20.670 [info] [Info - 7:03:20 PM] (7873) Setting environmentName for service "QICKIT": "3.11.11 (.venv venv)"
2025-04-19 19:03:20.671 [info] [Info - 7:03:20 PM] (7873) Setting pythonPath for service "QICKIT": "/home/ace07/Documents/GitHub/QICKIT/.venv/bin/python"
2025-04-19 19:03:20.672 [info] [Info - 7:03:20 PM] (7873) No include entries specified; assuming /home/ace07/Documents/GitHub/QICKIT
2025-04-19 19:03:20.672 [info] [Info - 7:03:20 PM] (7873) Auto-excluding **/node_modules
2025-04-19 19:03:20.672 [info] [Info - 7:03:20 PM] (7873) Auto-excluding **/__pycache__
2025-04-19 19:03:20.672 [info] [Info - 7:03:20 PM] (7873) Auto-excluding **/.*
2025-04-19 19:03:20.691 [info] [Info - 7:03:20 PM] (7873) Assuming Python version 3.11.11.final.0
2025-04-19 19:03:20.799 [info] [Info - 7:03:20 PM] (7873) Found 187 source files
2025-04-19 19:03:20.817 [info] [Info - 7:03:20 PM] (7873) Loading pyproject.toml file at /home/ace07/Documents/GitHub/QICKIT/pyproject.toml
2025-04-19 19:03:20.817 [info] [Info - 7:03:20 PM] (7873) Setting environmentName for service "QICKIT": "3.11.11 (.venv venv)"
2025-04-19 19:03:20.818 [info] [Info - 7:03:20 PM] (7873) Setting pythonPath for service "QICKIT": "/home/ace07/Documents/GitHub/QICKIT/.venv/bin/python"
2025-04-19 19:03:20.818 [info] [Info - 7:03:20 PM] (7873) No include entries specified; assuming /home/ace07/Documents/GitHub/QICKIT
2025-04-19 19:03:20.819 [info] [Info - 7:03:20 PM] (7873) Auto-excluding **/node_modules
2025-04-19 19:03:20.819 [info] [Info - 7:03:20 PM] (7873) Auto-excluding **/__pycache__
2025-04-19 19:03:20.819 [info] [Info - 7:03:20 PM] (7873) Auto-excluding **/.*
2025-04-19 19:03:20.839 [info] [Info - 7:03:20 PM] (7873) Assuming Python version 3.11.11.final.0
2025-04-19 19:03:20.918 [info] [Info - 7:03:20 PM] (7873) Found 187 source files
2025-04-19 19:03:21.214 [info] [Info - 7:03:21 PM] (7873) BG: Priority queue background worker(2) root directory: file:///home/ace07/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist
2025-04-19 19:03:21.214 [info] [Info - 7:03:21 PM] (7873) BG: Priority queue background worker(2) started
2025-04-19 19:03:21.872 [info] [Info - 7:03:21 PM] (7873) BG: Indexer background runner(3) root directory: file:///home/ace07/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist (index)
2025-04-19 19:03:21.873 [info] [Info - 7:03:21 PM] (7873) BG: Indexing(3) started
2025-04-19 19:03:22.202 [info] [Info - 7:03:22 PM] (7873) BG: scanned(3) 361 files over 1 exec env
2025-04-19 19:03:22.481 [info] [Info - 7:03:22 PM] (7873) BG: indexed(3) 361 files over 1 exec env
2025-04-19 19:03:22.604 [info] [Info - 7:03:22 PM] (7873) BG: Indexing finished(3).
2025-04-19 19:03:36.153 [info] [Info - 7:03:36 PM] (7873) BG: [BG(1)] Long operation: checking: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_cirq_circuit.py (3000ms)
2025-04-19 19:03:36.153 [info] [Info - 7:03:36 PM] (7873) BG: [BG(1)] Long operation: analyzing: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_cirq_circuit.py (3000ms)
2025-04-19 19:03:39.111 [info] [Info - 7:03:39 PM] (7873) BG: [BG(1)] Long operation: checking: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_pennylane_circuit.py (2840ms)
2025-04-19 19:03:39.111 [info] [Info - 7:03:39 PM] (7873) BG: [BG(1)] Long operation: analyzing: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_pennylane_circuit.py (2840ms)
2025-04-19 19:03:42.045 [info] [Info - 7:03:42 PM] (7873) BG: [BG(1)] Long operation: checking: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_qiskit_circuit.py (2884ms)
2025-04-19 19:03:42.045 [info] [Info - 7:03:42 PM] (7873) BG: [BG(1)] Long operation: analyzing: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_qiskit_circuit.py (2884ms)
2025-04-19 19:03:44.894 [info] [Info - 7:03:44 PM] (7873) BG: [BG(1)] Long operation: checking: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_quimb_circuit.py (2846ms)
2025-04-19 19:03:44.894 [info] [Info - 7:03:44 PM] (7873) BG: [BG(1)] Long operation: analyzing: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_quimb_circuit.py (2846ms)
2025-04-19 19:03:47.763 [info] [Info - 7:03:47 PM] (7873) BG: [BG(1)] Long operation: checking: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_tket_circuit.py (2865ms)
2025-04-19 19:03:47.763 [info] [Info - 7:03:47 PM] (7873) BG: [BG(1)] Long operation: analyzing: file:///home/ace07/Documents/GitHub/QICKIT/tests/circuit/test_tket_circuit.py (2865ms)
Here's where it exactly crashed
2025-04-19 19:03:19.956 [info] (Client) Pylance async client (2025.4.1) started with python extension (2025.4.0)
