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 has crashed. Would you like to try using a Node.js executable to run the language server? #6154

Closed
GXY0116 opened this issue Jul 17, 2024 · 19 comments
Assignees
Labels
needs repro Issue has not been reproduced yet waiting for user response Requires more information from user

Comments

@GXY0116
Copy link

GXY0116 commented Jul 17, 2024

Pylance has crashed. Would you like to try using a Node.js executable to run the language server?

2024-07-17 14:56:44.584 [info] [Error - 2:56:44 PM] Sending document notification textDocument/didSave failed.
2024-07-17 14:56:44.597 [info] Error: Connection is disposed.
at de (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:1948291)
at Object.sendNotification (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:1949134)
at S.sendNotification (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:1992950)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async t (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:2073066)
2024-07-17 14:56:44.901 [info] [Error - 2:56:44 PM] Notify file events failed.
2024-07-17 14:56:44.901 [info] Error: Connection is disposed.
at de (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:1948291)
at Object.sendNotification (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:1949134)
at S.sendNotification (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:1992950)
at async t.Delayer. (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:2004892)
2024-07-17 14:56:44.964 [info] [Error - 2:56:44 PM] Sending document notification textDocument/didSave failed.
2024-07-17 14:56:44.964 [info] Error: Connection is disposed.
at de (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:1948291)
at Object.sendNotification (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:1949134)
at S.sendNotification (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:1992950)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async t (/dssg/home/acct-seeshb/seeshb-user1/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:2073066)
2024-07-17 14:56:45.322 [info] [Error - 2:56:45 PM] Notify file events failed.

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jul 17, 2024
@debonte
Copy link
Contributor

debonte commented Jul 17, 2024

The log above looks like the log from the Python extension. Assuming that you are using Pylance as your language server (that's the default), could you please provide the Pylance log. It appears as "Python Language Server" in the Output pane.

@debonte debonte added the waiting for user response Requires more information from user label Jul 17, 2024
@umarbutler
Copy link

+1 Pylance has been crashing and short circuiting much more than normal and I am now getting the error 'Pylance has crashed. Would you like to try using a Node.js executable to run the language server?'.

I've noticed that a variable will grey out of a sudden and then this error may come later.

@umarbutler
Copy link

umarbutler commented Jul 18, 2024

For others who have been experiencing this issue, it seems to correlate with the release of 2024.7.1, so I have downgraded to 2024.6.1.

@debonte
Copy link
Contributor

debonte commented Jul 18, 2024

@umarbutler, can you provide a "Python Language Server" log from a case where Pylance crashed?

@GXY0116
Copy link
Author

GXY0116 commented Jul 18, 2024

The log above looks like the log from the Python extension. Assuming that you are using Pylance as your language server (that's the default), could you please provide the Pylance log. It appears as "Python Language Server" in the Output pane.
1721292703629
Thanks, that's the log of python language server

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Jul 18, 2024
@debonte
Copy link
Contributor

debonte commented Jul 18, 2024

@GXY0116, can you provide the entire log? Drag it into the log as an attachment, assuming it's large.

@debonte debonte added waiting for user response Requires more information from user and removed user responded Was "waiting for user response" and they responded labels Jul 18, 2024
@GXY0116
Copy link
Author

GXY0116 commented Jul 19, 2024

@GXY0116, can you provide the entire log? Drag it into the log as an attachment, assuming it's large.

Thanks, that's the entire log.
log.txt

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Jul 19, 2024
@debonte
Copy link
Contributor

debonte commented Jul 19, 2024

2024-07-19 00:23:45.268 [info] [Info - 12:23:45 AM] (2577591) Heap stats: total_heap_size=289MB, used_heap_size=256MB, cross_worker_used_heap_size=256MB, total_physical_size=289MB, total_available_size=3882MB, heap_size_limit=4144MB
...
2024-07-19 00:24:15.581 [info] [Error - 12:24:15 AM] Server process exited with signal SIGKILL.

Our best guess based on the log output above is that Pylance was killed by the Linux kernel when the machine ran low on memory. You could confirm that by checking dmesg after Pylance is killed. Here's dmesg output from my machine after I forced a process to be killed by Linux's OOM killer:

erikd@ERIKD:~$ (echo "li = []" ; echo "for r in range(9999999999999999): li.append(str(r))") | python3
Killed
erikd@ERIKD:~$ dmesg | tail -7
[146590.568889] [ 223208]     0 223208      572        0    40960       29             0 SessionLeader
[146590.568892] [ 223209]     0 223209      576        0    40960       31             0 Relay(183022)
[146590.568894] [ 223212]  1000 223212     2411        2    49152     1316             0 bash
[146590.568919] [ 223967]  1000 223967 10228732  7976248 81420288  2042808             0 python3
[146590.568921] [ 224465]     0 224465      509       19    36864        0             0 systemctl
[146590.568924] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,task=python3,pid=223967,uid=1000
[146590.568954] Out of memory: Killed process 223967 (python3) total-vm:40914928kB, anon-rss:31904992kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:79512kB oom_score_adj:0

Given that the total available physical memory is so small, I assume this is a container or virtual machine of some sort? Can you allocate more memory to the machine?

We have some guidance on ways to reduce the amount of memory that Pylance uses here: https://github.com/microsoft/pylance-release/wiki/Pylance-Configuration-Tips.

@umarbutler
Copy link

I have 64GB of RAM.

@debonte
Copy link
Contributor

debonte commented Jul 20, 2024

@umarbutler we don't have any evidence yet that the two of you are hitting the same issue. Can you file a new issue and attach a log file? We can always resolve one of them as a duplicate of the other if we determine that they are the same.

@umarbutler
Copy link

@debonte I'll be building a new PC within the next week or two so it makes more sense for me to use the older version, however, if the issue appears again (which would be on a completely new, more powerful build), I'll create a new ticket.

@otavio-silva
Copy link

Had the same error today. The language server was randomly disconnecting when running a Jupyter notebook. After installing the Pylance extension in the WSL distro instead of running in Windows, I got this:
image

@otavio-silva
Copy link

I could reproduce the error running the notebook again, here's the log:
pylance_wsl_log.txt

@rchiodo
Copy link
Contributor

rchiodo commented Jul 22, 2024

@otavio-silva's problem is this:
Error: Debug Failure. False expression: Chained file path undefined doesn't match cellFilePaths file:///home/azakun/Documents/Code/Python/notebooks/Stable%20Diffusion%20XL/StableDiffisionXL.ipynb.py#X14sdnNjb2RlLXJlbW90ZQ%3D%3D
at _0x2ee97f (/home/azakun/.vscode-server/extensions/ms-python.vscode-pylance-2024.7.1/dist/server.bundle.js:1:888452)
at /home/azakun/.vscode-server/extensions/ms-python.vscode-pylance-2024.7.1/dist/server.bundle.js:1:817188

Not likely the same issue as the original poster. I'll link a new bug.

@rhuanbarros
Copy link

I have the same issue running in a devcontainer

@debonte debonte added waiting for user response Requires more information from user and removed user responded Was "waiting for user response" and they responded labels Jul 25, 2024
@heejaechang
Copy link
Contributor

@rhuanbarros can you open new issue. that error message is generic message for any crash. so having your own issue will help us to track your issue better.

@wujhsu
Copy link

wujhsu commented Aug 2, 2024

I hope the method in this picture can help you.
image

Copy link
Contributor

github-actions bot commented Sep 2, 2024

Hey @debonte, this issue might need further attention.

@GXY0116, you can help us out by closing this issue if the problem no longer exists, or adding more information.

Copy link
Contributor

github-actions bot commented Oct 2, 2024

This issue has been closed automatically because it needs more information and has not had recent activity. If the issue still persists, please reopen with the information requested. Thanks.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
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 waiting for user response Requires more information from user
Projects
None yet
Development

No branches or pull requests

8 participants