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

Language server stuck in Checking for updates for <lang> language server status #4628

Closed
1 task done
baspinarenes opened this issue Jul 13, 2023 · 55 comments
Closed
1 task done
Labels
defect [core label] language server failure Language server doesn't work as expected language server An umbrella label for all language servers

Comments

@baspinarenes
Copy link

baspinarenes commented Jul 13, 2023

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I downloaded Zed and entered my workspace. The status bar was shown the download log of the typescript and json language servers. Then the "Checking for updates to TSX language server" log was shown and it's not progressing. When I look at the Zed's language folder, the contents of the folders are empty. I have deleted folders multiple times and tried again but I am still in the same place.

Environment

Zed: v0.94.4 (stable)
OS: macOS 13.3.1
Memory: 32 GiB
Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

$ ls -la ~/Library/Application\ Support/Zed/languages/json-language-server
total 0
drwxr-xr-x@ 2 enes.baspinar  staff   64 Jul 13 08:30 .
drwxr-xr-x@ 6 enes.baspinar  staff  192 Jul 13 08:30 ..

$ ls -la ~/Library/Application\ Support/Zed/languages/typescript-language-server
total 0
drwxr-xr-x@ 2 enes.baspinar  staff   64 Jul 13 08:37 .
drwxr-xr-x@ 6 enes.baspinar  staff  192 Jul 13 08:30 ..

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

Zed.log

@baspinarenes baspinarenes added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Jul 13, 2023
@JosephTLyons JosephTLyons added language server failure Language server doesn't work as expected and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 17, 2023
@ForLoveOfCats
Copy link
Contributor

Hey there 👋 If you delete ~/Library/Application Support/Zed/node and restart the editor does the issue persist?

@fxsalazar
Copy link
Contributor

Yes, it's still blocked at Checking for updates to TSX language server

@brandonweiss
Copy link

brandonweiss commented Jul 20, 2023

I’ve got the same problem with the JavaScript language server. It starts checking for updates and then hangs. Sometimes the language server then stops working, and sometimes it keeps working—I can’t quite figure out why.

@jfrazier-eth
Copy link

jfrazier-eth commented Jul 25, 2023

I had this same issue. For anyone else that wants to use Zed while waiting for a fix - I was able to get around this issue by installing 0.93.4 (releases). It installed the TS language server then auto updated to 0.95.3.

@ForLoveOfCats
Copy link
Contributor

Hey folks 👋

Just a little update on where we're at with this, we've been able to reproduce the issue but only intermittently, and it always resolves upon restarting Zed. However it sounds like you've been having the issue persist through an editor restart which concerns me as that doesn't match my expectations of how our language server downloading mechanisms may fail.

Next time one of you encounters this issue can you fully quit (cmd-q) Zed, restart the editor, and then let us know if the issue persists. That will help me rule some stuff out and make sure we can know if our reproductions are even the same issue or not.

@joebno
Copy link

joebno commented Jul 28, 2023

I have just run into this issue myself (Elixir Language Server) - it looped through the checking/downloading/checking cycle rapidly a few times, then stoped on checking.

It did persist through several restarts. I managed to clear it by:

  1. Open a different project
  2. Close the initial project
  3. Fully quit Zed
  4. Restart Zed
  5. Open initial project
  6. Close the other project

Of note is that I had the initial project and a file on the desktop open in the same instance. It seems stable with just the initial project.

@JosephTLyons JosephTLyons added the language server An umbrella label for all language servers label Aug 18, 2023
@andrejikonikov
Copy link

Guys to me it looks like a major issue with language servers download mechanism, same result with:
Javascript language server
Typescript language server
Json language server
all update checks/downloads get stuck, worst thing that cmd-click don't work with this...
tried versions 0.102.1, 0.96.2 with same sad results.

@JosephTLyons
Copy link
Contributor

For the team, there is more information in these other closed issues:

@JosephTLyons JosephTLyons changed the title Language server download problem Language server stuck in Checking for updates to <lang> language server status Sep 18, 2023
@JosephTLyons JosephTLyons changed the title Language server stuck in Checking for updates to <lang> language server status Language server stuck in Checking for updates for <lang> language server status Sep 18, 2023
@caleb654
Copy link

I was able to fix this issue running sudo npm cache clean --force according to this Stack Overflow issue. I was having problems specifically with the Typescript language server.

@adanselm
Copy link

I was able to fix this issue running sudo npm cache clean --force according to this Stack Overflow issue. I was having problems specifically with the Typescript language server.

Made no difference for me with ElixirLS unfortunately ☹️

@JFOC
Copy link

JFOC commented Sep 22, 2023

I was able to fix this issue running sudo npm cache clean --force according to this Stack Overflow issue. I was having problems specifically with the Typescript language server.

not working here still had an issue with JS and PHP

@nikolubbe
Copy link

nikolubbe commented Sep 22, 2023

I got around this for typescript by manually cloning and building the typescript-language-server repo:

  1. Quit Zed completely
  2. Delete ~/Library/Application\ Support/Zed/languages/typescript-language-server
  3. git clone git@github.com:typescript-language-server/typescript-language-server.git ~/Library/Application\ Support/Zed/languages/typescript-language-server
  4. *cd ~/Library/Application\ Support/Zed/languages/typescript-language-server && rm yarn.lock && yarn && yarn build
  5. Start Zed

* In 4 I delete the yarn.lock file because yarn wouldn't install with the repo's lockfile 🤷

Edit: Similar for json:
follow 1 & 2 from above
3. git clone git@github.com:zed-industries/json-language-server.git ~/Library/Application\ Support/Zed/languages/json-language-server
4. cd ~/Library/Application\ Support/Zed/languages/json-language-server && ./script/build

@manurana
Copy link

I will add a python issue to the mix too :)
Zed 0.104.4

The status message is stuck between
image
and
image

Log here
2023-09-22T11:44:57 [INFO] starting language server "pyright", path: "/Users/manu/developer/knab/@old/las_2.0_kredit_manager", id: 1731
2023-09-22T11:44:57 [INFO] Node runtime install_if_needed
2023-09-22T11:44:58 [INFO] Node runtime install_if_needed
2023-09-22T11:44:59 [INFO] Node runtime install_if_needed
2023-09-22T11:44:59 [ERROR] invalid LSP message header ""
2023-09-22T11:44:59 [ERROR] failed to start language server "pyright": oneshot canceled
2023-09-22T11:44:59 [ERROR] server shut down
2023-09-22T11:44:59 [ERROR] Broken pipe (os error 32)
2023-09-22T11:44:59 [ERROR] missing executable in directory "/Users/manu/Library/Application Support/Zed/languages/pyright/node_modules/pyright/langserver.index.js"
2023-09-22T11:44:59 [INFO] About to spawn test binary
2023-09-22T11:44:59 [WARN] test binary failed to launch
2023-09-22T11:44:59 [WARN] test binary check failed
2023-09-22T11:44:59 [INFO] beginning to reinstall server
2023-09-22T11:44:59 [INFO] deleting server container
2023-09-22T11:44:59 [INFO] starting language server "pyright", path: "/Users/manu/developer/knab/@old/las_2.0_kredit_manager", id: 1732
2023-09-22T11:44:59 [INFO] Node runtime install_if_needed
2023-09-22T11:45:00 [INFO] Node runtime install_if_needed
2023-09-22T11:45:00 [INFO] Node runtime install_if_needed
2023-09-22T11:45:01 [ERROR] invalid LSP message header ""
2023-09-22T11:45:01 [ERROR] failed to start language server "pyright": oneshot canceled
2023-09-22T11:45:01 [ERROR] Broken pipe (os error 32)
2023-09-22T11:45:01 [ERROR] server shut down
2023-09-22T11:45:01 [ERROR] missing executable in directory "/Users/manu/Library/Application Support/Zed/languages/pyright/node_modules/pyright/langserver.index.js"
2023-09-22T11:45:01 [INFO] About to spawn test binary
2023-09-22T11:45:01 [WARN] test binary failed to launch
2023-09-22T11:45:01 [WARN] test binary check failed
2023-09-22T11:45:01 [INFO] beginning to reinstall server
2023-09-22T11:45:01 [INFO] deleting server container
2023-09-22T11:45:01 [INFO] starting language server "pyright", path: "/Users/manu/developer/knab/@old/las_2.0_kredit_manager", id: 1733
2023-09-22T11:45:01 [INFO] Node runtime install_if_needed

@nikolubbe
Copy link

I will add a python issue to the mix too :) Zed 0.104.4

@manurana This workaround (as mentioned above for TS and JSON) worked for me:

  1. Quit Zed completely
  2. Delete ~/Library/Application\ Support/Zed/languages/pyright
  3. git clone git@github.com:microsoft/pyright.git ~/Library/Application\ Support/Zed/languages/pyright
  4. cd ~/Library/Application\ Support/Zed/languages/pyright && npm install
  5. Start Zed

It looks like when Zed goes into this "Downloading / Checking for updates" loop, it keeps deleting the language folder in question and then recreating it (which is why you need to quit Zed completely before manually installing the LSPs)

@manurana
Copy link

Gracias, @nikolubbe
That worked for me!

@ForLoveOfCats
Copy link
Contributor

To give an update on this issue, we've been able to figure out that in this specific situation we're stuck in a loop installing the language server, getting a significantly fatal error on attempting to launch it, launching a test executable to see if the server install is borked, that fails to launch too, we clear the installation folder, and attempt again.

We don't know why this is happening, it doesn't seem to be restricted to any singular language server, or even kind of language server. All of the language servers we've seen issues with work fine for countless other folks so we know that the installation process for all these do work, and the process of installation for most is a simple as a download and unpack or an npm invocation so there's not a lot to go wrong there anyway.

As such we've yet to figure out why we're consistently getting borked copies of these servers on some folks' systems. Some permissions error, drive corruption, or what we don't know. It's been very frustrating to figure out and it pains me that we haven't been able to resolve it properly yet.

I hope this can give a bit of insight into where we're at right now with this issue

@manurana
Copy link

Hi @ForLoveOfCats , thanks for the update.
This is very interesting
On my machine, I first had this error with the typescript language server. This got resolved in one of the version updates. Then had the same issue with python.
OTOH, I have multiple other language servers (json, eslint, yaml) which did not have the issue

Let me know if I can help in any debugging.

@4rc0s
Copy link

4rc0s commented Sep 24, 2023

I will add a python issue to the mix too :) Zed 0.104.4

The status message is stuck between image and image

Log here

Same issue here with Python on MacOS.

Edit: Looks like the @nikolubbe workaround may have worked for me as well.

@Spikeysanju
Copy link

I had the same issue and I found that for some reason I have a package.json in my home directory, so probably Zed was installing everything there instead of ~/Library/Application Support/Zed.

I closed Zed and deleted everything from my home dir (~/package.json, ~/package.lock.json, ~/node_modules/) and everything works!

This worked for me. Thanks @11bit

@TwanLuttik
Copy link

I had the same issue and I found that for some reason I have a package.json in my home directory, so probably Zed was installing everything there instead of ~/Library/Application Support/Zed.

I closed Zed and deleted everything from my home dir (~/package.json, ~/package.lock.json, ~/node_modules/) and everything works!

Thank you so much @11bit, this solved my issue right away

@jamescary
Copy link

I had the same issue and I found that for some reason I have a package.json in my home directory, so probably Zed was installing everything there instead of ~/Library/Application Support/Zed.

I closed Zed and deleted everything from my home dir (~/package.json, ~/package.lock.json, ~/node_modules/) and everything works!

This also worked for me. Thanks @11bit!

@DarthMarino
Copy link

Try updating to the latest stable release they just released today (v0.111.6). The issue seems to be fixed

@ForLoveOfCats
Copy link
Contributor

As much as I wish we had, we haven't fixed anything in the past few releases. In 0.111.4 we did change some things so that this won't go on endlessly, but on systems where a particular language server is failing to install it will still fail to install.

I am personally looking into what might cause our downloaded copy of NPM to install Node based language servers into the home directory which is what quite a few folks in this thread have reported happening.

Our new understanding of the situation is that there's nothing "broken" about our mechanisms for installing these failing servers. Trying to find some bug in that code is why we've spent so much time spinning our tires. What we think now is that individual servers have specific configuration issues on some systems which all result in failures which look the same from how Zed reacts. A few weeks ago we shipped some logging improvements which should allow us to track down individual failures a bit better.

We're in the middle of a big UI library rewrite which impacts a lot of internal systems so we have been slower to respond than usual but that should wrap up sometime soonish. We're also going Open Source soon™️ and I hope folks will be able to discover these configuration failures on their systems and help us figure out how to get affected servers running :)

@marcotterra
Copy link

I had the same issue and I found that for some reason I have a package.json in my home directory, so probably Zed was installing everything there instead of ~/Library/Application Support/Zed.

I closed Zed and deleted everything from my home dir (~/package.json, ~/package.lock.json, ~/node_modules/) and everything works!

Thank you so much @11bit!

@yocontra
Copy link

Still an issue as of latest release today with TS + TSX servers. Running this fixed it for me:

rm -rf ~/package-lock.json ~/package.json ~/node_modules
npm cache clean --force
  • a reboot of zed.

@ForLoveOfCats
Copy link
Contributor

Thanks to an awesome community contribution this issue should now be fixed for Node-based language servers! Please let us know if you continue to experience this issue once the fix goes out in a release :)

@arthurgeron-work
Copy link

Still an issue as of latest release today with TS + TSX servers. Running this fixed it for me:

rm -rf ~/package-lock.json ~/package.json ~/node_modules
npm cache clean --force
  • a reboot of zed.

This is what finally worked for me; I've had the issue out of the box, even on the latest version available today. I only find it crazy that there was no indication in the UI that typescript-language-server had crashed, nor did it show up as an option when listing logs for language servers.

@ForLoveOfCats
I'll leave here my suggestion: a menu option in the IDE to open ZED.log and a clearer way to display language servers' statuses on the UI.

@div002123
Copy link

div002123 commented Feb 6, 2024

Why do people continue to use Zed despite this fatal bug?

It's simply a waste of time.

@murdahl
Copy link

murdahl commented Feb 27, 2024

Hey, I'm having the same issue now with the CSharp language server, and there are no rouge files in my home directory.

@dturazzini
Copy link

I've tried everything mentioned on this page but I just can't install Node based LSP, at least not the ones I've tried (Pyright and JSON). As soon as I start Zed, the manual installs are deleted.

Non-Node based LSP like Clangd and Rust-Analyzer work like a charm.

Zed 0.125.4
Chip: Apple M2 Pro
Memory: 32GB
macOS: 13.6 Ventura

zed.log

@zxch3n
Copy link

zxch3n commented Mar 14, 2024

It is still happening on Rust
CleanShot 2024-03-14 at 16 40 46@2x

Related logs

2024-03-14T16:38:48+08:00 [INFO] fetching latest version of language server "rust-analyzer"
2024-03-14T16:38:48+08:00 [ERROR] failed to start language server "rust-analyzer": status error 403, response: "{\"message\":\"API rate limit exceeded for 172.234.90.111. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\"documentation_url\":\"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting\"}\n"
2024-03-14T16:38:48+08:00 [ERROR] server stderr: Some("")
2024-03-14T16:38:48+08:00 [ERROR] Hit 4 reinstallation attempts for "rust-analyzer"

Zed 0.126.2

@AdamSchinzel
Copy link

I got around this for typescript by manually cloning and building the typescript-language-server repo:

  1. Quit Zed completely
  2. Delete ~/Library/Application\ Support/Zed/languages/typescript-language-server
  3. git clone git@github.com:typescript-language-server/typescript-language-server.git ~/Library/Application\ Support/Zed/languages/typescript-language-server
  4. *cd ~/Library/Application\ Support/Zed/languages/typescript-language-server && rm yarn.lock && yarn && yarn build
  5. Start Zed
  • In 4 I delete the yarn.lock file because yarn wouldn't install with the repo's lockfile 🤷

Edit: Similar for json: follow 1 & 2 from above 3. git clone git@github.com:zed-industries/json-language-server.git ~/Library/Application\ Support/Zed/languages/json-language-server 4. cd ~/Library/Application\ Support/Zed/languages/json-language-server && ./script/build

Happened to me today with TypeScript and this help. I assume this will help with any language server. I guess Zed is still to early for anyone that is not willing to find these solutions.

@krischal111
Copy link

I had the Zig extension installed but features like code autocompletions were not working. Apparently installing the Zed's CLI fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] language server failure Language server doesn't work as expected language server An umbrella label for all language servers
Projects
None yet
Development

No branches or pull requests