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

Python language server from Pylance is crashing #1417

Closed
sarthakpati opened this issue Jun 9, 2021 · 10 comments
Closed

Python language server from Pylance is crashing #1417

sarthakpati opened this issue Jun 9, 2021 · 10 comments
Labels
waiting for user response Requires more information from user

Comments

@sarthakpati
Copy link

Environment data

  • Language Server version: 2021.6.0
  • OS and version: Windows 10 x64 10.0.19043
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.12, Anaconda

Expected behaviour

Intellisense, code completion/highlighting and ctrl+click should work.

Actual behaviour

None of the smart features of Pylance are working correctly. I keep getting the following notification:

The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted.

I have tried following the steps in microsoft/vscode-python#12286 and microsoft/python-language-server#909 but unable to fix this. Probably because I am using Pylance [ref].

Logs

[Info  - 1:36:54 PM] Pylance language server 2021.6.0 (pyright 209c8040) starting
[Info  - 1:36:54 PM] Server root directory: c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist
[Info  - 1:36:54 PM] Background analysis(1) root directory: c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist
[Info  - 1:36:54 PM] Background analysis(1) started
[Info  - 1:36:55 PM] No configuration file found.
[Info  - 1:36:55 PM] No pyproject.toml file found.
[Info  - 1:36:55 PM] Setting pythonPath for service "GANDLF": "C:\Projects\GENERIC\venv\python.exe"
[Warn  - 1:36:55 PM] stubPath c:\Projects\GENERIC\typings is not a valid directory.
[Info  - 1:36:55 PM] Assuming Python version 3.6
[Info  - 1:36:55 PM] Assuming Python platform Windows
Search paths for c:\Projects\GENERIC
  c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\typeshed-fallback\stdlib
  c:\Projects\GENERIC
  c:\Projects\GENERIC\typings
  c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\typeshed-fallback\stubs\...
  c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\bundled\stubs
  c:\projects\generic\venv\python36.zip
  c:\projects\generic\venv\dlls
  c:\projects\generic\venv\lib
  c:\projects\generic\venv
  c:\Users\usr\appdata\roaming\python\python36\site-packages
  c:\projects\generic\venv\lib\site-packages
  c:\projects\generic
[Info  - 1:36:55 PM] Searching for source files
Background analysis message: setConfigOptions
Background analysis message: ensurePartialStubPackages
Loading ONNX runtime...
Loaded ONNX runtime. Creating IntelliCode session...
Created IntelliCode session.

Code Snippet / Additional information

Not applicable

@github-actions github-actions bot added the triage label Jun 9, 2021
@jakebailey
Copy link
Member

I'm confused; normally if we crash there would be an exception. Is this the entire set of logs?

@judej judej added the waiting for user response Requires more information from user label Jun 9, 2021
@github-actions github-actions bot removed the triage label Jun 9, 2021
@sarthakpati
Copy link
Author

Yup, let me know what else you need and I can run it...

@jakebailey
Copy link
Member

If your workspace folder were generic and not GENERIC, does it work as expected by chance?

@sarthakpati
Copy link
Author

So, my actual folder is C:\Projects\GENERIC. I am not sure how I can change the workspace folder?

@jakebailey
Copy link
Member

I mean to quite literally rename the folder; I think this may be related to a casing mismatch (see how the logs have the same thing multiple times but lowercased).

@sarthakpati
Copy link
Author

Okay, I renamed, and I tried a debugging session and I got this output:

Background analysis message: invalidateAndForceReanalysis
Background analysis message: markFilesDirty
Background analysis message: markFilesDirty
Background analysis message: invalidateAndForceReanalysis
Background analysis message: invalidateAndForceReanalysis
[Info  - 2:13:07 PM] Searching for source files
Libzip Error: Not a zip archive
    at makeLibzipError (c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\node_modules\@yarnpkg\fslib\lib\ZipFS.js:149:29)
    at new m (c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\node_modules\@yarnpkg\fslib\lib\ZipFS.js:121:28)
    at getZipSync (c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\node_modules\@yarnpkg\fslib\lib\ZipOpenFS.js:784:28)
    at g.makeCallSync (c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\node_modules\@yarnpkg\fslib\lib\ZipOpenFS.js:665:21)
    at g.existsSync (c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\node_modules\@yarnpkg\fslib\lib\ZipOpenFS.js:232:21)
    at c.existsSync (c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\node_modules\@yarnpkg\fslib\lib\ProxiedFS.js:71:28)
    at r.existsSync (c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\node_modules\@yarnpkg\fslib\lib\ProxiedFS.js:71:28)
    at T.existsSync (c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\src\common\fileSystem.ts:213:23)
    at t.PyrightFileSystem.existsSync (c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\src\pyrightFileSystem.ts:63:29)
    at c:\Users\usr\.vscode\extensions\ms-python.vscode-pylance-2021.6.0\dist\pyright-internal\src\analyzer\service.ts:1027:53
[Info  - 2:13:08 PM] Connection to server got closed. Server will restart.
[Error - 2:13:08 PM] Request textDocument/semanticTokens/full failed.
Error: Connection got disposed.

The intellisense is still not working.

@jakebailey
Copy link
Member

That's a known bug that'll be fixed in today's release. #1397

After that is closed, we can retry and see if your original issue goes away.

@jakebailey
Copy link
Member

We've just released 2021.6.1; can you retry and see if your issue is fixed?

@JaredVargason
Copy link

I can confirm it is fixed. I was having the same issue.

@sarthakpati
Copy link
Author

We've just released 2021.6.1; can you retry and see if your issue is fixed?

YES, this fixed it! Thank you so much!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for user response Requires more information from user
Projects
None yet
Development

No branches or pull requests

4 participants