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 server connection errors when signing in to use GitHub Copilot #6850

Open
luabud opened this issue Jan 14, 2025 · 3 comments
Open

Pylance server connection errors when signing in to use GitHub Copilot #6850

luabud opened this issue Jan 14, 2025 · 3 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@luabud
Copy link
Member

luabud commented Jan 14, 2025

Environment data

  • Language Server version: 2024.12.1
  • OS and version: win32 x64
  • Python version (and distribution if applicable, e.g. Anaconda): 3.13
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: off

Code Snippet

import os
os. # to invoke completion

Repro Steps

  1. Create a new blank profile (Gear icon on the bottom left -> Profiles -> Profiles -> New Profile -> Create)
  2. Open new window using the blank profile
  3. Create a Python file, no need to save it.
  4. Install Python extension
  5. Invoke a completion to make sure Pylance is working
  6. Open the Copilot view (Copilot icon on the top, next to the command center and select View/Open Chat)
  7. Click on the button to get Copilot
  8. Once the Copilot extensions are installed, you'll see an error notification about Pylance erroring to connect

Image

Logs

ExtensionHostLogs01142025.txt
PythonLanguageServerLogs01142025.txt
PythonLogs01142025.txt

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jan 14, 2025
@rchiodo
Copy link
Contributor

rchiodo commented Jan 14, 2025

Looking at the logs I think I can guess what's happening.

Installing copilot is attempting to restart the language server (for some reason) and the shutdown of Pylance isn't working so it just force exits it.

This message here is happening:

https://github.com/microsoft/vscode-languageserver-node/blob/dadd73f7fc283b4d0adb602adadcf4be16ef3a7b/client/src/common/client.ts#L1585

That would happen if the shutdown message for pylance doesn't get through, and that's happening because Pylance is busy with startup.

The question is why Pylance is being shutdown. I don't see that happening in the Python log or extension host log.

@luabud
Copy link
Member Author

luabud commented Jan 14, 2025

@rchiodo I still have the session open, any idea on what other channels could have helpful info?

Image

@rchiodo
Copy link
Contributor

rchiodo commented Jan 14, 2025

I guess look at them all and see if there's anything about restarting the extension host or restarting the language server.

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