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 does not boot properly and fails to highlight text when used on an SSH remote #6710

Closed
xhluca opened this issue Nov 26, 2024 · 21 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@xhluca
Copy link

xhluca commented Nov 26, 2024

A follow up on #6442.

This issue still happens a lot to me, when i'm ssh'd to a remote. Using the "exclude" trick above doesn't help.

Usually i would change to pre-release then reload, sometimes that fixes it, but the next time I SSH to the remote the issue arises again (everything unhighlighted). I'm not sure what's the cause as I didn't change much from my workflow apart, this simply started happening a month or two ago.

I'm creating an issue based on advice from: #6442 (comment)

Environment data

  • Pylance version: v2024.8.2
  • OS and version: Ubuntu 22.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.13

Code Snippet

N/A

Repro Steps

  1. SSH to remote
  2. Install Pylance

Expected behavior

Pylance should work

Actual behavior

Pylance does not boot, there's no error message

Logs

I enabled traces but there are not traces that appear.

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Nov 26, 2024
@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

Is there any command I can run? After enabling traces, nothing appears in the terminal, "output", etc.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

The Python output tab should indicate whether or not it could load Pylance or not. Sounds like it's failing to load Pylance at all.

@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

That's interesting. I don't see anything in the "Python" tab.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

If you run 'Toggle Developer Tools', the console on that page might show something. The Python output tab should definitely be there though if the Python extension is installed.

Image

@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

Ah I didn't know that! After switching to Python, I found those logs:

2024-11-26 15:57:21.155 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-11-26 15:57:21.155 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-11-26 15:57:21.155 [info] Experiment 'pythonTestAdapter' is active
2024-11-26 15:57:21.156 [warning] Dir "/home/users/myname/myproject/.pixi/envs" is not watchable (directory does not exist)
2024-11-26 15:57:21.201 [info] Default formatter is set to ms-python.black-formatter for workspace /home/users/myname/myproject
2024-11-26 15:57:21.624 [info] > ./venv/bin/python -I ~/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/python_files/interpreterInfo.py
2024-11-26 15:57:21.665 [info] > ~/.pyenv/bin/pyenv which python
2024-11-26 15:57:21.666 [info] cwd: .
2024-11-26 15:57:21.758 [info] Python interpreter path: ./venv/bin/python
2024-11-26 15:57:21.902 [info] > pixi --version
2024-11-26 15:57:21.903 [warning] could not find a pixi interpreter for the interpreter at /home/users/myname/myproject/venv/bin/python
2024-11-26 15:57:21.927 [error] [
  `Failed to start language server, Class name = h, completed in 53ms, has a falsy return value, Arg 1: <Uri:/home/users/myname/myproject>, Arg 2: {"id":"/home/users/myname/myproject/venv/bin/python","sysPrefix":"/home/users/myname/myproject/venv","envType":"Venv","envName":"venv","envPath":"/home/users/myname/myproject/venv","path":"/home/users/myname/myproject/venv/bin/python","architecture":3,"sysVersion":"3.10.13 (main, Dec 15 2023, 18:32:57) [GCC 11.4.0]","version":{"raw":"3.10.13","major":3,"minor":10,"patch":13,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.10.13 ('venv')","detailedDisplayName":"Python 3.10.13 ('venv': venv)","type":"Virtual"}, 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.8.2","lastCaptured":{},"nextWindow":0,"eventCount":0,"workspace":{},"connectedPromise":{"scope":null,"_resolved":false,"_rejected":false,"_promise":{}},"notebooks":{},"eventName":"LANGUAGE_SERVER.REQUEST"}}, Return Value: undefined`,
  [Error: The language client requires VS Code version ^1.91.0 but received version 1.89.1
  	at P.checkVersion (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2307252)
  	at new P (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2306957)
  	at Object.createClient (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:52239)
  	at _0x500d80 (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:214309)
  	at async _0x5446db (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:218007)
  	at async _0x1d21da._startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:167298)
  	at async _0x1d21da._createNewRequest (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166823)
  	at async _0x1d21da._enqueueRequestAndWaitForRun (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166027)
  	at async _0x1d21da.startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:165543)
  	at async h.start (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)]
]
2024-11-26 15:57:21.927 [error] [
  'Starting language server, Class name = d, completed in 55ms, has a falsy return value, , Return Value: undefined',
  [Error: The language client requires VS Code version ^1.91.0 but received version 1.89.1
  	at P.checkVersion (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2307252)
  	at new P (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2306957)
  	at Object.createClient (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:52239)
  	at _0x500d80 (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:214309)
  	at async _0x5446db (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:218007)
  	at async _0x1d21da._startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:167298)
  	at async _0x1d21da._createNewRequest (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166823)
  	at async _0x1d21da._enqueueRequestAndWaitForRun (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166027)
  	at async _0x1d21da.startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:165543)
  	at async h.start (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)]
]
2024-11-26 15:57:21.927 [error] [
  `Failed to start language server, Class name = d, completed in 55ms, has a falsy return value, Arg 1: <Uri:/home/users/myname/myproject>, Arg 2: {"id":"/home/users/myname/myproject/venv/bin/python","sysPrefix":"/home/users/myname/myproject/venv","envType":"Venv","envName":"venv","envPath":"/home/users/myname/myproject/venv","path":"/home/users/myname/myproject/venv/bin/python","architecture":3,"sysVersion":"3.10.13 (main, Dec 15 2023, 18:32:57) [GCC 11.4.0]","version":{"raw":"3.10.13","major":3,"minor":10,"patch":13,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.10.13 ('venv')","detailedDisplayName":"Python 3.10.13 ('venv': venv)","type":"Virtual"}, Return Value: undefined`,
  [Error: The language client requires VS Code version ^1.91.0 but received version 1.89.1
  	at P.checkVersion (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2307252)
  	at new P (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2306957)
  	at Object.createClient (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:52239)
  	at _0x500d80 (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:214309)
  	at async _0x5446db (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:218007)
  	at async _0x1d21da._startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:167298)
  	at async _0x1d21da._createNewRequest (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166823)
  	at async _0x1d21da._enqueueRequestAndWaitForRun (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166027)
  	at async _0x1d21da.startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:165543)
  	at async h.start (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)]
]
2024-11-26 15:57:21.928 [error] [
  'Failed to activate a workspace, Class name = v, completed in 721ms, has a falsy return value, Arg 1: <Uri:/home/users/myname/myproject/launch_agent_xray.py>, Arg 2: {"started":1732654640994}, Return Value: undefined',
  [Error: The language client requires VS Code version ^1.91.0 but received version 1.89.1
  	at P.checkVersion (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2307252)
  	at new P (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2306957)
  	at Object.createClient (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:52239)
  	at _0x500d80 (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:214309)
  	at async _0x5446db (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:218007)
  	at async _0x1d21da._startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:167298)
  	at async _0x1d21da._createNewRequest (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166823)
  	at async _0x1d21da._enqueueRequestAndWaitForRun (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166027)
  	at async _0x1d21da.startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:165543)
  	at async h.start (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)]
]
2024-11-26 15:57:21.928 [error] Failure during activation. [Error: The language client requires VS Code version ^1.91.0 but received version 1.89.1
	at P.checkVersion (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2307252)
	at new P (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2306957)
	at Object.createClient (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:52239)
	at _0x500d80 (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:214309)
	at async _0x5446db (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:218007)
	at async _0x1d21da._startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:167298)
	at async _0x1d21da._createNewRequest (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166823)
	at async _0x1d21da._enqueueRequestAndWaitForRun (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166027)
	at async _0x1d21da.startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:165543)
	at async h.start (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)]
2024-11-26 15:57:21.928 [error] sendStartupTelemetry() failed. [Error: The language client requires VS Code version ^1.91.0 but received version 1.89.1
	at P.checkVersion (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2307252)
	at new P (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:2306957)
	at Object.createClient (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:52239)
	at _0x500d80 (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:214309)
	at async _0x5446db (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:218007)
	at async _0x1d21da._startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:167298)
	at async _0x1d21da._createNewRequest (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166823)
	at async _0x1d21da._enqueueRequestAndWaitForRun (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:166027)
	at async _0x1d21da.startClient (/home/users/myname/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.2/dist/extension.bundle.js:1:165543)
	at async h.start (/home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/out/client/extension.js:2:39659)]
2024-11-26 15:57:22.045 [info] > . ./venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/python_files/printEnvVariables.py
2024-11-26 15:57:22.045 [info] shell: bash
2024-11-26 15:57:22.115 [info] > /bin/python3 ~/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/python_files/printEnvVariables.py
2024-11-26 15:57:22.116 [info] shell: bash
2024-11-26 15:57:22.183 [info] Setting environment variable VIRTUAL_ENV in collection to /home/users/myname/myproject/venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-11-26 15:57:22.183 [info] Setting environment variable VIRTUAL_ENV_PROMPT in collection to (venv)  {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-11-26 15:57:22.183 [info] Prepending environment variable PS1 in collection with (venv)  {"applyAtShellIntegration":true,"applyAtProcessCreation":false}
2024-11-26 15:57:22.183 [info] Prepending environment variable PATH in collection with /home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/python_files/deactivate/bash:/home/users/myname/myproject/venv/bin: {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-11-26 15:57:22.184 [info] Send text to terminal: /bin/python3 /home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/python_files/printEnvVariablesToFile.py /home/users/myname/.vscode-server/extensions/ms-python.python-2024.14.0-linux-x64/python_files/deactivate/bash/envVars.txt

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

The error is this one:

The language client requires VS Code version ^1.91.0 but received version 1.89.1

You're using an older version of VS code. You can't install the latest pylance into it.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

How did you install pylance? The extension tab in VS code should only show versions that are supported.

@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

I'm using the "Extensions" tab, so not sure why vscode allowed me to install that. I will try to update vscode

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

It could be the remote machine needs to be updated. The extensions actually run on the remote box in SSH. I thought the remote SSH extension auto updated, but I could be wrong.

@rchiodo rchiodo closed this as completed Nov 26, 2024
@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

How can I check and update the version?

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

I don't use SSH myself, but in WSL it gets updated by just running code.

According to this, the Remote SSH extension is supposed to do it for you.
https://code.visualstudio.com/docs/remote/ssh

So maybe your local version is out of date too.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

SHould I open a different issue to say that the Remote SSH extension does not auto-update the vscode server?

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

Assuming your local VS code isn't 1.89, then yeah that sounds like a bug. Although I'd check that last link first to make sure it isn't because the remote server is locked down too tight.

@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

My local version is indeed 1.89 (took a while to figure out since mac zsh doesn't work well with the code command).

How do I update the local? I don't use WSL.

@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

Oh seems that "checking for update" gives me this error:

Cannot update while running on a read-only volume. The application is on a read-only volume. Please move the application and try again. If you're on macOS Sierra or later, you'll need to move the application out of the Downloads directory. This might mean the application was put on quarantine by macOS. See [this link](https://github.com/microsoft/vscode/issues/7426#issuecomment-425093469) for more information.

Except it's not a read-only volume, as I am capable of editing file on this volume.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

My guess would be to uninstall and reinstall VS code.

@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

Actually it was indeed in my downloads folder (I tried searching "Code" but it somehow didn't find it, had to manually look and move to "Applications" folder.

@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

Ok, using Cmd+P to find the update procedure seems to work ("Code: Check for updates..." and "Code: Restart to Update").

Never would have guessed but seems like i was 6 version behind the latest! So probably means vscode never updated since I installed it (given it was in Downloads rather than Applications).

I think it would be good to have a notification popup that says "Your VS code is X version behind. Auto-update did not work, consider moving the file "Visual Studio Code" from "~/Downloads" to "Applications"). I think this would be really be helpful!

@rchiodo
Copy link
Contributor

rchiodo commented Nov 26, 2024

I think it would be good to have a notification popup that says "Your VS code is X version behind. Auto-update did not work, consider moving the file "Visual Studio Code" from "~/Downloads" to "Applications"). I think this would be really be helpful!

If you wanted this to happen, I'd recommend logging this in the VS code issues. That wouldn't be something that Pylance would be able to do.

@xhluca
Copy link
Author

xhluca commented Nov 26, 2024

Makes sense! This seems indeed a vscode-specific issue. I will create one. THank you for debugging this with me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants