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

too many notifications when pylance crashes #6056

Open
amunger opened this issue Jun 25, 2024 · 6 comments
Open

too many notifications when pylance crashes #6056

amunger opened this issue Jun 25, 2024 · 6 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

@amunger
Copy link

amunger commented Jun 25, 2024

Recording 2024-06-25 at 07 22 12

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jun 25, 2024
@amunger
Copy link
Author

amunger commented Jun 25, 2024

also, pylance is constantly crashing

@rchiodo
Copy link
Contributor

rchiodo commented Jun 25, 2024

Can you upload the log from the Python Language Server tab? It should show the callstack for the crash.

@amunger
Copy link
Author

amunger commented Jun 25, 2024

2024-06-25 10:13:15.764 [info] (Client) Pylance async client (2024.6.1) started with python extension (2024.9.2024062506)
2024-06-25 10:13:17.622 [info] c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1

{the entire contents of that bundle? (2.6m characters)}

TypeError: Cannot read properties of undefined (reading 'split')
    at x (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1:1381535)
    at _0x987c9 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:569922)
    at _0x3bce49 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:569261)
    at e.autoImportDetail (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1:1438456)
    at 94576 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1:1288606)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 87472 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1:1265878)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 68968 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:915625)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 71880 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:956284)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 3740 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:418670)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 78268 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:3246)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 80332 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:582858)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 47100 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1096126)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1122070
    at _0x48e40e.O (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1123085)
    at _0x48e40e.x (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1122120)
    at _0x48e40e.x (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1125636)
    at c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1125684
    at Object.<anonymous> (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1125724)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
    at Module.load (node:internal/modules/cjs/loader:1098:32)
    at Module._load (node:internal/modules/cjs/loader:945:12)
    at c._load (node:electron/js2c/node_init:2:13672)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:96:12)

Node.js v20.9.0

2024-06-25 10:13:18.376 [info] [Error - 10:13:18 AM] Server process exited with code 1.
2024-06-25 10:13:18.380 [info] [Error - 10:13:18 AM] Server initialization failed.
2024-06-25 10:13:18.380 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-06-25 10:13:18.381 [info] [Error - 10:13:18 AM] Pylance client: couldn't create connection to server.
2024-06-25 10:13:18.381 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 

@rchiodo
Copy link
Contributor

rchiodo commented Jun 25, 2024

Thanks. That's this line of code here:
https://github.com/microsoft/pyright/blob/1168be715e64961106b6cd18c01db87ed285d715/packages/pyright-internal/src/localization/localize.ts#L178

What's your locale set to? I don't know how the locale can be undefined but it looks like that's the problem.

@amunger
Copy link
Author

amunger commented Jun 25, 2024

I'm not sure how to check that - I don't have any settings for locale set

@rchiodo
Copy link
Contributor

rchiodo commented Jun 25, 2024

Looking up the callstack, I'm guessing it's coming from a VSCODE env var?
https://github.com/microsoft/pyright/blob/1168be715e64961106b6cd18c01db87ed285d715/packages/pyright-internal/src/localization/localize.ts#L121

VSCODE_NLS_CONFIG might be set? And then it just assumes that's a json file and it blindly loads the 'locale' setting in the json file.

@rchiodo rchiodo assigned rchiodo and unassigned StellaHuang95 Jun 25, 2024
@rchiodo rchiodo added bug Something isn't working and removed needs repro Issue has not been reproduced yet labels Jun 25, 2024
@bschnurr bschnurr added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Jun 25, 2024
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

4 participants