question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors when multiple workspaces simultaneously try to install a new Python Language Server version

See original GitHub issue

Updated description

If there is a new Python Language Server version available and multiple Python workspaces are restored when Visual Studio Code is opened (i.e. if “window.restoreWindows” is set to “all”), then all of the workspaces will try to install the new version simultaneously. All but one of the workspace will fail and display

We encountered an issue extracting the Language Server.  Reverting to the alternate, Jedi.  Check the Python output panel for details.

Source: Python (Extension)               Show output

in a popup, with something similar to

Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-win-x64.0.4.24.nupkg...
Language server dowload complete
Unpacking archive... Language server extraction failed
Error: UNKNOWN: unknown error, open 'c:\Users\keating\.vscode\extensions\ms-python.python-2019.9.34911\languageServer.0.4.24\System.ComponentModel.Annotations.dll'

appearing in the Python Language Server log. It is then necessary to restart Visual Studio Code in order to use the Python Language Server instead of Jedi. As @karrtikr noted, It’s possible to continue using the Python Language Server on all workspaces even without restarting Visual Studio Code.

Original description:

Occasionally (maybe 10% of the time?), when I open Visual Studio Code I get the following error popping up in the lower-right corner:

We encountered an issue extracting the Language Server.  Reverting to the alternate, Jedi.  Check the Python output panel for details.

Source: Python (Extension)               Show output

If I click on the “Show output” button, then the output panel is opened with the following:

Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-win-x64.0.4.24.nupkg...
Language server dowload complete
Unpacking archive... Language server extraction failed
Error: UNKNOWN: unknown error, open 'c:\Users\keating\.vscode\extensions\ms-python.python-2019.9.34911\languageServer.0.4.24\System.ComponentModel.Annotations.dll'

If I close Visual Studio Code and reopen it, then the error doesn’t happen again and I can use the language server. The file that’s mentioned in the error message (System.ComponentModel.Annotations.dll) exists on my hard drive and I can open it in Notepad++ with no problems (although it just displays a bunch of gibberish since it’s a binary file). Windows reports the file size as 162,384 bytes.

In case it’s relevant, I have multiple Visual Studio Code windows that I created using “Duplicate Workspace in New Window” and “window.restoreWindows” is set to “all”, so all workspaces open at the same time when I start Visual Studio Code.

Environment data

  • VS Code version: 1.38.1
  • Extension version (available under the Extensions sidebar): XXX
  • OS and version: Windows 10, 1903
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.2 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): virtualenv
  • Relevant/affected Python packages and their versions: XXX
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info #3977): Language Server

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
KevKeatingcommented, Oct 3, 2019

One thing to note here is that regardless of the errors, I was still able to use LS for all workspaces in the current session itself, no need to reload. So you can probably just ignore the errors.

Interesting! I admit that I never actually checked whether those workspaces had switched back to Jedi or not; I just assumed the error message was accurate and restarted. Good to know. I’ll update my edit to the initial comment.

1reaction
KevKeatingcommented, Oct 3, 2019

I just ran into this issue again when VSCode upgraded the Python Language Server from 0.4.24 to 0.4.38. I opened VSCode and four workspaces were restored, all with Python files. Three of the workspace gave me the “We encountered an issue extracting the Language Server” error, but one workspace succeeded in installing the new language server. When I restarted VSCode, all four workspaces successfully used language server version 0.4.38. I think it’s safe to assume that a race condition from multiple workspaces trying to install the same language server at once is the correct underlying issue here. I’ll update the issue title and add a note to the initial comment clarifying things.

Thanks for the help, @karrtikr!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Settings Reference for Python - Visual Studio Code
Specifies what code files the language server analyzes for problems. Available values are workspace and openFilesOnly . include, [], Paths of directories or ......
Read more >
Visual Studio Code: Intellisense not working - Stack Overflow
Solution: Configure the path to the python executable in settings.json . Remember to restart vscode after. The module is located in a non- ......
Read more >
fortls - PyPI
Common installation problems. It is NOT recommended having fortls and fortran-language-server simultaneously installed, since they use the same binary name. If ...
Read more >
Announcing Pylance: Fast, feature-rich language support for ...
Pylance is a new language server for Python, which uses the Language ... If you have the Python extension installed, you can try...
Read more >
Amazon WorkSpaces FAQs | Persistent Desktop Virtualization
Q: Can users install applications on their Amazon WorkSpace? ... In addition, migrate attempts to move data from the old user profile to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found