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

Server crashes and cannot restart #5085

Closed
robertmaxton42 opened this issue Nov 5, 2023 · 4 comments
Closed

Server crashes and cannot restart #5085

robertmaxton42 opened this issue Nov 5, 2023 · 4 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@robertmaxton42
Copy link

robertmaxton42 commented Nov 5, 2023

Environment data

  • Language Server version: 2023.11.11
  • OS and version: linux x64
  • Python version (and distribution if applicable, e.g. Anaconda):
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: basic

Code Snippet

Not applicable; happens with all ipynb in my current window.

Repro Steps

My precise setup involves running VSCode over WSL, on Ubuntu. I'm not entirely sure this is required for the crash to occur. Other than that, open an ipynb, enter some code to get Pylance running, then just wait a little while.

Expected behavior

Pylance should run continuously in the background, providing various IDE/intellisense features.

Actual behavior

Pylance crashes within a few minutes, leaving the error listed below in the Python Language Server window. A few pushes then pop up saying "Pylance client: couldn't create connection to server." and "Restarting server failed." As far as I can tell, the server can only be fixed by reopening VS Code.

Logs

Error: Debug Failure. Cell path not found for cell vscode-notebook-cell://wsl%2Bubuntu/home/rmaxton-wsl/Coding/Python/jaxSampleVariety_dblprec.ipynb#Y205sdnNjb2RlLXJlbW90ZQ%3D%3D
    at _0x5e8922.getNotebookCellPath (/home/rmaxton-wsl/.vscode-server/extensions/ms-python.vscode-pylance-2023.11.11/dist/server.bundle.js:1:261668)
    at _0x8f195a.decodeTextDocumentUri (/home/rmaxton-wsl/.vscode-server/extensions/ms-python.vscode-pylance-2023.11.11/dist/server.bundle.js:1:230980)
    at _0x45a7e7.onDidCloseTextDocument (/home/rmaxton-wsl/.vscode-server/extensions/ms-python.vscode-pylance-2023.11.11/dist/server.bundle.js:1:901599)
    at /home/rmaxton-wsl/.vscode-server/extensions/ms-python.vscode-pylance-2023.11.11/dist/pyright.bundle.js:1:1144202
    at /home/rmaxton-wsl/.vscode-server/extensions/ms-python.vscode-pylance-2023.11.11/dist/vendor.bundle.js:2:1234062
    at oe (/home/rmaxton-wsl/.vscode-server/extensions/ms-python.vscode-pylance-2023.11.11/dist/vendor.bundle.js:2:1234284)
    at /home/rmaxton-wsl/.vscode-server/extensions/ms-python.vscode-pylance-2023.11.11/dist/vendor.bundle.js:2:1230224
    at Immediate.<anonymous> (/home/rmaxton-wsl/.vscode-server/extensions/ms-python.vscode-pylance-2023.11.11/dist/vendor.bundle.js:2:1230244)
    at processImmediate (node:internal/timers:476:21)

2023-11-05 07:15:23.074 [info] [Error - 7:15:23 AM] Server process exited with code 1.
2023-11-05 07:15:23.075 [info] [Info  - 7:15:23 AM] Connection to server got closed. Server will restart.
2023-11-05 07:15:23.075 [info] true
2023-11-05 07:15:23.383 [info] [Info  - 7:15:23 AM] (3785) Pylance language server 2023.11.11 (pyright 64c9c3ff) starting
2023-11-05 07:15:23.383 [info] [Info  - 7:15:23 AM] (3785) Server root directory: /home/rmaxton-wsl/.vscode-server/extensions/ms-python.vscode-pylance-2023.11.11/dist
2023-11-05 07:15:23.387 [info] [Error - 7:15:23 AM] Server initialization failed.
2023-11-05 07:15:23.387 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.

----- [07ab3947f14b83b265030b91c106c2a1ff08f4c3720d2f1c0970e5f7ed8c382a]

  Code: -32603 
2023-11-05 07:15:23.388 [info] [Error - 7:15:23 AM] Pylance client: couldn't create connection to server.
2023-11-05 07:15:23.388 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.

----- [07ab3947f14b83b265030b91c106c2a1ff08f4c3720d2f1c0970e5f7ed8c382a]

  Code: -32603 
2023-11-05 07:15:23.388 [info] [Error - 7:15:23 AM] Restarting server failed
2023-11-05 07:15:23.388 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.

----- [07ab3947f14b83b265030b91c106c2a1ff08f4c3720d2f1c0970e5f7ed8c382a]

  Code: -32603
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Nov 5, 2023
@robertmaxton42
Copy link
Author

robertmaxton42 commented Nov 5, 2023

... Actually, I might have to take this back; it happened with the first two notebooks I tried, but when I made a fresh ipynb and copied over most of my code it doesn't seem to have happened again. Still strange, though.

Edit: Nope. Happened again with the new notebook. Took much longer, though.

@robertmaxton42
Copy link
Author

robertmaxton42 commented Nov 5, 2023

... Okay, after reading the logs myself and experimenting, it seems that (most of the time?) deleting a cell after Pylance has had a chance to look at it (e.g. if I define a function and evaluate the cell) crashes the server. Some other factor causes this to be fatal/the server to fail to restart, so after deleting enough cells the server just crashes and stays down.

@garawaa
Copy link

garawaa commented Nov 6, 2023

I also have same issue. How fix it. Is there workaround?

@rchiodo
Copy link
Contributor

rchiodo commented Nov 6, 2023

This should be a dupe of #5071. There's no workaround (other than not deleting a cell). I'd recommend switching to the stable version for now. The fix for 5071 should be in our next prerelease.

@rchiodo rchiodo closed this as completed Nov 6, 2023
@debonte debonte added duplicate This issue or pull request already exists and removed needs repro Issue has not been reproduced yet labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants