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 crashed immediately after open VSCode #5009

Closed
XJTLUmedia opened this issue Oct 26, 2023 · 32 comments
Closed

Pylance crashed immediately after open VSCode #5009

XJTLUmedia opened this issue Oct 26, 2023 · 32 comments
Assignees
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@XJTLUmedia
Copy link

XJTLUmedia commented Oct 26, 2023

Environment data

  • Language Server version: v2023.10.41
  • OS and version: Windows_NT x64 10.0
  • VSCode Version: 1.84.0-insider
  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.5

Code Snippet

%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from pandas.plotting import lag_plot
import statsmodels.api as sm
from statsmodels.compat import lzip
sns.set_style("darkgrid")
plt.rc("figure", figsize=(16, 6))
plt.rc("savefig", dpi=90)
plt.rc("font", family="sans-serif")
plt.rc("font", size=14)

Note: this is just a sample notebook, however, in any python/ipython files opened with this VSCode, the results are the same

Repro Steps

  1. When opening VSCode, the pylance will crash

Expected behavior

Pylance should not crash

Actual behavior

Pylance crash

Logs

2023-10-26 09:39:31.505 [info] TypeError: _0x3a4bf3[(_0xb0a014(...) + _0xb0a014(...))] is not a function
    at _0x186756.dirExistsCached (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\server.bundle.js:1:779292)
    at _0x186756._resolveAbsoluteImport (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\pyright.bundle.js:1:303694)
    at _0x186756.resolveAbsoluteImport (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\pyright.bundle.js:1:296859)
    at _0x186756._resolveBestAbsoluteImport (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\pyright.bundle.js:1:305905)
    at _0x186756._resolveImportStrict (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\pyright.bundle.js:1:299332)
    at _0x186756.resolveImportInternal (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\pyright.bundle.js:1:294521)
    at _0x186756.resolveImport (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\pyright.bundle.js:1:290200)
    at _0x186756.resolveImport (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\server.bundle.js:1:775260)
    at _0x5a1281.<computed> (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\server.bundle.js:1:149880)
    at _0x1b11ed._enableJinjaTelemetry (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\server.bundle.js:1:954757)
    at _0x1b11ed.updateSettingsForWorkspace (c:\Users\ASUS\.vscode-insiders\extensions\ms-python.vscode-pylance-2023.10.41\dist\server.bundle.js:1:896870)
    at async Promise.all (index 0)

2023-10-26 09:39:31.511 [info] [Error - 9:39:31 AM] Server process exited with code 1.
2023-10-26 09:39:31.512 [info] [Error - 9:39:31 AM] The Pylance server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Oct 26, 2023
@danieleldjarn
Copy link

danieleldjarn commented Oct 26, 2023

Getting the same error

Environment data

Language Server version: v2023.10.41
OS and version: macOS Sonoma 14.0
VSCode Version: 1.84.0-insider

@rchiodo
Copy link
Contributor

rchiodo commented Oct 26, 2023

Ran into the same problem on Pylance v2023.10.50 and it seems to be due to some sort of corrupted cache?
I renamed my workspace directory to a different name and it's no longer crashing.
It would be helpful to know how to reset the cache in case something like this happens.

My cache would be here:
C:\Users\rchiodo.vscode\extensions\ms-python.vscode-pylance-2023.10.41\dist.cache (the dist/.cache folder wherever the extension is installed)

Worth a try to see if somehow that's breaking things, but the callstack on the original poster isn't indicating a read from the cache. So we're not sure what's happening.

@d0gkiller87
Copy link

d0gkiller87 commented Oct 26, 2023

Ran into the same error on Python 3.8.10, Pylance v2023.10.50.

Worth a try to see if somehow that's breaking things, but the callstack on the original poster isn't indicating a read from the cache. So we're not sure what's happening.

I removed my falsely concluded comment about how renaming workspace fixes it. Turned out it was due to that VSCode selected another Python interpreter on my system (3.11.4) by default, which Pylance runs fine with.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 27, 2023

Hmm, the failure indicates the return value of statSync (which is a call into the node fs library eventually) is not returning the correct type of object. This might happen if the site-packages folder has a zip/egg. Which might explain how it works in one environment and not another.

The weird part is we haven't changed that code in a long time, so not sure how it would have worked before. 6 months ago was the last update.

@nosas
Copy link

nosas commented Oct 27, 2023

Similar issue, although mine "restarts" instead of stopping. Pylance was working fine all day up until 2 hours ago:

2023-10-27 00:06:17.465 [info] TypeError: _0x2f33cc[(_0x1efd68(...) + _0x1efd68(...))] is not a function
    at _0xa6e677.dirExistsCached (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/server.bundle.js:1:902382)
    at _0xa6e677._resolveAbsoluteImport (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/pyright.bundle.js:1:303694)
    at _0xa6e677.resolveAbsoluteImport (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/pyright.bundle.js:1:296859)
    at _0xa6e677._resolveBestAbsoluteImport (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/pyright.bundle.js:1:305693)
    at _0xa6e677._resolveImportStrict (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/pyright.bundle.js:1:299332)
    at _0xa6e677.resolveImportInternal (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/pyright.bundle.js:1:294521)
    at _0xa6e677.resolveImport (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/pyright.bundle.js:1:290200)
    at _0xa6e677.resolveImport (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/server.bundle.js:1:898287)
    at _0x170d92.<computed> (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/server.bundle.js:1:272928)
    at _0x5e13d0._enableJinjaTelemetry (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/server.bundle.js:1:1078110)
    at _0x5e13d0.updateSettingsForWorkspace (/home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist/server.bundle.js:1:1019982)
    at async Promise.all (index 0)

2023-10-27 00:06:17.503 [info] [Info  - 12:06:17 AM] Connection to server got closed. Server will restart.
2023-10-27 00:06:17.503 [info] true
2023-10-27 00:06:17.942 [info] [Info  - 12:06:17 AM] (10539) Pylance language server 2023.10.50 (pyright cfe56bfb) starting
2023-10-27 00:06:17.942 [info] [Info  - 12:06:17 AM] (10539) Server root directory: /home/sason/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist

It works fine on my python environment with no egg package, but crashes in my pipenv environment which has an egg.

Any debugging advice?

@darynwhite
Copy link

This is happening for me as well, and I ensured it isn't anything else by removing all extensions and reinstalling. Here is a complete log of what happened after my last window reload:

2023-10-26 17:28:01.401 [info] [Error - 5:28:01 PM] Server process exited with code 1.
2023-10-26 17:28:01.402 [info] [Error - 5:28:01 PM] The Pylance server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
Complete output: Python Language Server

Python Language Server.log

@COOLIRON2311
Copy link

COOLIRON2311 commented Oct 27, 2023

Same error for me.
Can be temporarily fixed by rolling back the extension to v2023.10.40.

Environment data

Language Server version: v2023.10.50
OS and version: Windows 11 23H2
VSCode Version: 1.83.1

@XJTLUmedia
Copy link
Author

Hmm, the failure indicates the return value of statSync (which is a call into the node fs library eventually) is not returning the correct type of object. This might happen if the site-packages folder has a zip/egg. Which might explain how it works in one environment and not another.

The weird part is we haven't changed that code in a long time, so not sure how it would have worked before. 6 months ago was the last update.

I checked my site-package folder, I do have egg in that folder.

@WitherZuo
Copy link

me too, even if a simple python file...I use miniconda (Python 3.11.5, base environment).

For me, temporarily fixed by rolling back the extension to v2023.10.40 too.

QQ截图20231027101519

分析文件“C:\Users\withe\Downloads\waifu2x\process.py”时发生内部错误:TypeError: _0x2f33cc[(_0x1efd68(...) + _0x1efd68(...))] is not a function
    at _0xa6e677.dirExistsCached (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\server.bundle.js:1:902382)
    at _0xa6e677._resolveAbsoluteImport (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:303694)
    at _0xa6e677.resolveAbsoluteImport (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:296859)
    at _0xa6e677._resolveBestAbsoluteImport (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:305905)
    at _0xa6e677._resolveImportStrict (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:299332)
    at _0xa6e677.resolveImportInternal (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:294521)
    at _0xa6e677.resolveImport (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:290200)
    at _0xa6e677.resolveImport (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\server.bundle.js:1:898287)
    at i (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:510945)
    at _0x4c3a07._resolveImports (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:511197)
    at c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:499381
    at a.timeOperation (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:1130032)
    at c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:499348
    at t.LogTracker.log (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:1092230)
    at _0x4c3a07.parse (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:498098)
    at N._parseFile (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:434006)
    at N._bindFile (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:434964)
    at c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:436150
    at t.LogTracker.log (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:1092230)
    at N._checkTypes (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:435861)
    at c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:420596
    at runWithCancellationToken (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:843404)
    at a.timeOperation (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:1130032)
    at N._runEvaluatorWithCancellationToken (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:426484)
    at N.analyze (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:420355)
    at t.analyzeProgram (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:923)
    at _0x79f29.handleResumeAnalysis (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:1021122)
    at _0x79f29.handleAnalyze (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:1021046)
    at _0x79f29.handleAnalyze (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\server.bundle.js:1:139271)
    at _0x79f29.onMessage (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:1018726)
    at _0x79f29.onMessage (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\server.bundle.js:1:138679)
    at _0x79f29._onMessageWrapper (c:\Users\withe\Downloads\vscode\data\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:1023516)
版本: 1.83.1
提交: f1b07bd25dfad64b0167beb15359ae573aecd2cc
日期: 2023-10-10T23:48:05.904Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.25982

@debonte
Copy link
Contributor

debonte commented Oct 27, 2023

Thanks all. We're able to repro this and are working on a fix.

Repro steps:

  1. Create folder
  2. python -m venv .venv
  3. Add .egg file in .venv\lib\site-packages.
  4. Add .pth file in .venv\lib\site-packages that points to the .egg.
  5. Open folder in VS Code
  6. Add empty .py file to kick off Pylance.
  7. Crash

Here's a zip containing the .egg and .pth that I tested with. Change the path in the .pth file to match your test directory.
TestFiles.zip

@debonte debonte added bug Something isn't working and removed needs repro Issue has not been reproduced yet labels Oct 27, 2023
@heejaechang heejaechang added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Oct 27, 2023
@heejaechang
Copy link
Contributor

This issue has been fixed in prerelease version 2023.10.53, which we've just released. You can find the changelog here: CHANGELOG.md

@darynwhite
Copy link

This didn't seem to fix it for my system. Any steps I should take after installing the 2023.10.53 version?

Screenshot 2023-10-27 at 14 07 30

@debonte
Copy link
Contributor

debonte commented Oct 27, 2023

@darynwhite, based on your log above it looks like you're hitting a different error. Is this still what you're seeing? If so, can you open a new issue? And provide some details on your setup so we can try to repro this ourselves? Do you hit this with notebooks or normal python files? Are you using a remote environment of some sort -- WSL, SSH, dev container, etc?

2023-10-26 17:28:01.397 [info] Error: [UriError]: Scheme contains illegal characters.
    at l (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/vendor.bundle.js:2:1390846)
    at t (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/vendor.bundle.js:2:1391782)
    at new t (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/vendor.bundle.js:2:1393374)
    at Function.t.parse (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/vendor.bundle.js:2:1392677)
    at v (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:1099841)
    at w (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:1101719)
    at A (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:1101778)
    at /Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:1481888
    at Array.filter (<anonymous>)
    at o.readdirEntriesSync (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:1481840)
    at _0x311974.readdirEntriesSync (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/server.bundle.js:1:216358)
    at c (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:456960)
    at I.ensureDefaultExtraPaths (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:1064461)
    at k._getConfigOptions (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:472865)
    at k.setOptions (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:466884)
    at Function.runWithOptions (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:1165679)
    at _0x5ca583.updateOptionsAndRestartService (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:1143165)
    at _0x5ca583.updateSettingsForWorkspace (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/pyright.bundle.js:1:1142932)
    at _0x5ca583.updateSettingsForWorkspace (/Users/white/.vscode/extensions/ms-python.vscode-pylance-2023.10.52/dist/server.bundle.js:1:877024)
    at async Promise.all (index 0)

@darynwhite
Copy link

That is what I'm seeing, I'll open new issue based on what I'm seeing.

@ajromanelli
Copy link

I had the same issue, reverting to the .40 released fixed it

@wakusoftware
Copy link

same issue for me

@kaern
Copy link

kaern commented Nov 2, 2023

I had the same issue:
2023-11-02 08:22:44.224 [info] [Error - 8:22:44 AM] Server process exited with code 1.
2023-11-02 08:22:44.224 [info] TypeError: _0x2f33cc[(_0x1efd68(...) + _0x1efd68(...))] is not a function
even with .40 it seems to work, but language server indicate some error:
2023-11-02 08:26:20.470 [info] ERROR: The process "27548" not found.
reverting to .30 and no errors ..

@HenraL
Copy link

HenraL commented Nov 2, 2023

Python version: 3.11.4
OS and version: Windows_NT x64 10.0
vscode version:

Version: 1.84.0 (user setup)
Commit: d037ac076cee195194f93ce6fe2bdfe2969cc82d
Date: 2023-11-01T11:29:04.398Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

I have the same issue with the latest version (v2023.10.50) of pylance:
2023-11-02 12:04:19.744 [info] [Error - 12:04:19 PM] Server process exited with code 1.
2023-11-02 12:04:19.744 [info] TypeError: _0x2f33cc[(_0x1efd68(...) + _0x1efd68(...))] is not a function
at _0xa6e677.dirExistsCached (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\server.bundle.js:1:902382)
at _0xa6e677._resolveAbsoluteImport (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:303694)
at _0xa6e677.resolveAbsoluteImport (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:296859)
at _0xa6e677._resolveBestAbsoluteImport (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:305905)
at _0xa6e677._resolveImportStrict (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:299332)
at _0xa6e677.resolveImportInternal (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:294521)
at _0xa6e677.resolveImport (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\pyright.bundle.js:1:290200)
at _0xa6e677.resolveImport (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\server.bundle.js:1:898287)
at _0x170d92. (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\server.bundle.js:1:272928)
at _0x5e13d0._enableJinjaTelemetry (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\server.bundle.js:1:1078110)
at _0x5e13d0.updateSettingsForWorkspace (c:\Users<username>.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist\server.bundle.js:1:1019982)
at async Promise.all (index 0)

2023-11-02 12:04:19.748 [info] [Error - 12:04:19 PM] The Pylance server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

@debonte
Copy link
Contributor

debonte commented Nov 2, 2023

Just restating that this issue is fixed in our latest prerelease build -- 2023.10.53.

cc: @ajromanelli, @wakusoftware, @kaern, @HenraL

@HenraL
Copy link

HenraL commented Nov 2, 2023

How long does ir take for vscode to see the new version? Because currently, the latest version for them is v2023.10.50.

Edit: sorry, didn't see that we needed to switch to pre-release

@debonte
Copy link
Contributor

debonte commented Nov 2, 2023

Edit: sorry, didn't see that we needed to switch to pre-release

Here's a screenshot of that UI if others are having trouble finding it:

image

@RisingLiberty
Copy link

After using the pre-release version the language server errors out as soon as there's a change made to the file,
is this a known issue?
image

The line marked with a red arrow is a new line I've added

@rchiodo
Copy link
Contributor

rchiodo commented Nov 2, 2023

@RisingLiberty what's the error message that Pylance is giving?

@RisingLiberty
Copy link

It doesn't print anything to the console actually, the only thing I see at the end of a restart is the following
2023-11-02 17:06:35.630 [info] ERROR: The process "27076" not found.

there's also an error about a redundant open text document command for the file I'm editing, but I assume that's just warning?

after I've changed the file, notthing else gets emitted to the output console in vscode

@rchiodo
Copy link
Contributor

rchiodo commented Nov 2, 2023

hmm, Does hover over say 'print' work?

Like this:

image

The process 27076 not found shouldn't matter.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 2, 2023

You might also try setting this:

"python.analysis.logLevel": "Trace"

@RisingLiberty
Copy link

yep, print works
image

not sure if it helps but the code above the changed lines still highlights as expected, it's only the new code and the lines below that gets messed up.

In there I've found a few references like this
2023-11-02 17:25:23.734 [info] [Info - 5:25:23 PM] (31408) Attempting to resolve using root path '<my\user\path>.vscode\extensions\ms-python.vscode-pylance-2023.10.53\dist\typeshed-fallback\stdlib'
2023-11-02 17:25:23.734 [info] [Info - 5:25:23 PM] (31408) Typeshed path not found
2023-11-02 17:25:23.735 [info] [Info - 5:25:23 PM] (31408) Looking for typeshed third-party path
2023-11-02 17:25:23.735 [info] [Info - 5:25:23 PM] (31408) Looking for typeshed stubs path
2023-11-02 17:25:23.735 [info] [Info - 5:25:23 PM] (31408) Typeshed path not found

@wakusoftware
Copy link

It updated to prerelease and it worked. Thanks

@rchiodo
Copy link
Contributor

rchiodo commented Nov 2, 2023

@RisingLiberty, No that shouldn't affect this. Your problem sounds similar to this: microsoft/pyright#6280

We should probably open a new issue to investigate. I believe the crash is fixed, otherwise hover on print wouldn't work.

@RisingLiberty
Copy link

Alright, no problem, thanks for the help, great stuff :)

@kaern
Copy link

kaern commented Nov 2, 2023

Everything seems to work fine, but I am also getting some process error (this was not the case with .30):

2023-11-02 21:57:51.663 [info] [Info - 9:57:51 PM] (22156) Pylance language server 2023.10.53 (pyright d7012d0d) starting
2023-11-02 21:57:51.665 [info] [Info - 9:57:51 PM] (22156) Server root directory: C:\Users\xxx.vscode\extensions\ms-python.vscode-pylance-2023.10.53\dist
2023-11-02 21:57:51.666 [info] [Info - 9:57:51 PM] (22156) Starting service instance "xxx"
2023-11-02 21:57:51.755 [info] [Info - 9:57:51 PM] (22156) Setting pythonPath for service "xxx": ".venv\Scripts\python.exe"
2023-11-02 21:57:51.755 [info] [Info - 9:57:51 PM] (22156) Setting environmentName for service "xxx": "3.10.11 (.venv venv)"
2023-11-02 21:57:51.796 [info] [Info - 9:57:51 PM] (22156) Loading pyproject.toml file at \pyproject.toml
2023-11-02 21:57:51.797 [info] [Info - 9:57:51 PM] (22156) Pyproject file "\pyproject.toml" has no "[tool.pyright]" section.
2023-11-02 21:57:52.011 [info] [Info - 9:57:52 PM] (22156) Assuming Python version 3.10
2023-11-02 21:57:52.783 [info] [Info - 9:57:52 PM] (22156) Found 385 source files
2023-11-02 21:57:53.497 [info] ERROR: The process "17036" not found.

2023-11-02 21:57:56.650 [info] [Info - 9:57:56 PM] (22156) [BG(1)] Long operation: getSemanticTokens full at xxx.py (2834ms)

@rchiodo
Copy link
Contributor

rchiodo commented Nov 2, 2023

That error doesn't matter. It's because we're killing a child process a lot sooner than we used to in 2023.10.30. We should just skip logging the error if it's not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests