zed icon indicating copy to clipboard operation
zed copied to clipboard

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

Open baspinarenes opened this issue 1 year ago • 47 comments

Check for existing issues

  • [X] 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 avatar Jul 13 '23 05:07 baspinarenes

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

ForLoveOfCats avatar Jul 17 '23 13:07 ForLoveOfCats

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

fxsalazar avatar Jul 17 '23 17:07 fxsalazar

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.

brandonweiss avatar Jul 20 '23 19:07 brandonweiss

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.

jfrazier-eth avatar Jul 25 '23 17:07 jfrazier-eth

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.

ForLoveOfCats avatar Jul 26 '23 19:07 ForLoveOfCats

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.

joebno avatar Jul 28 '23 13:07 joebno

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.

andrejikonikov avatar Sep 07 '23 14:09 andrejikonikov

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

  • https://github.com/zed-industries/zed/issues/6280
  • https://github.com/zed-industries/zed/issues/6304

JosephTLyons avatar Sep 18 '23 13:09 JosephTLyons

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.

caleb654 avatar Sep 19 '23 23:09 caleb654

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 ☹️

adanselm avatar Sep 20 '23 10:09 adanselm

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

JFOC avatar Sep 22 '23 04:09 JFOC

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 [email protected]: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 [email protected]: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

nikolubbe avatar Sep 22 '23 09:09 nikolubbe

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

manurana avatar Sep 22 '23 11:09 manurana

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 [email protected]: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)

nikolubbe avatar Sep 22 '23 12:09 nikolubbe

Gracias, @nikolubbe That worked for me!

manurana avatar Sep 23 '23 01:09 manurana

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

ForLoveOfCats avatar Sep 23 '23 14:09 ForLoveOfCats

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.

manurana avatar Sep 23 '23 15:09 manurana

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.

4rc0s avatar Sep 24 '23 16:09 4rc0s

Just to add some information. The Elixir Server now fails with:

Language server error: Elixir

error deserializing latest release

kevinschweikert avatar Sep 25 '23 14:09 kevinschweikert

I finally fixed it for me by switching back from rtx to asdf!

kevinschweikert avatar Sep 25 '23 15:09 kevinschweikert

I finally fixed it for me by switching back from rtx to asdf!

What versions of Elixir/Erlang do you have in your asdf current ?

adanselm avatar Sep 25 '23 17:09 adanselm

Pretty up to date

$ asdf current
elixir          1.15.6-otp-26  
erlang          26.1           

kevinschweikert avatar Sep 26 '23 09:09 kevinschweikert

@nikolubbe Thanks very much for sharing the workaround. I tried to get the JSON language server working on MacOS but am getting this error during the build script:


~/Library/Application Support/Zed/languages/json-language-server/node_modules/vscode-json-languageserver ~/Library/Application Support/Zed/languages/json-language-server
> [email protected]
node:internal/child_process:421
    throw errnoException(err, 'spawn');
    ^

Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at spawn (node:child_process:761:9)
    at fabricate (/Users/foo/Library/Application Support/Zed/languages/json-language-server/node_modules/pkg/lib-es5/fabricator.js:55:51)
    at fabricateTwice (/Users/foo/Library/Application Support/Zed/languages/json-language-server/node_modules/pkg/lib-es5/fabricator.js:120:5)
    at MultiStream._queue (/Users/foo/Library/Application Support/Zed/languages/json-language-server/node_modules/pkg/lib-es5/producer.js:266:68)
    at MultiStream._next (/Users/foo/Library/Application Support/Zed/languages/json-language-server/node_modules/multistream/index.js:86:12)
    at Meter.onEnd (/Users/foo/Library/Application Support/Zed/languages/json-language-server/node_modules/multistream/index.js:129:12)
    at Object.onceWrapper (node:events:628:28)
    at Meter.emit (node:events:514:28)
    at endReadableNT (node:internal/streams/readable:1376:12) {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'
}

Node.js v20.7.0

4rc0s avatar Sep 28 '23 21:09 4rc0s

New user here. I downloaded the latest version (0.106.2) today and the CPU fans are having a field day with downloading the TSX language server in an endless loop. MacOS 14.0 (Sonoma), Mac mini 2018, 3,2 GHz 6-Core Intel Core i7. Looks like a promising editor, but as such completely unusable for me. Anything I can do to debug the issue?

pehagg avatar Oct 05 '23 12:10 pehagg

  1. Quit Zed completely
  2. Delete ~/Library/Application\ Support/Zed/languages/pyright
  3. git clone [email protected]: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)

@nikolubbe I was getting nuts and was about to create an issue but found this already existing and your method really helped. Thx 😭

joeypaak avatar Oct 07 '23 03:10 joeypaak

To add more context into my case. I installed my nodes version with Volta.

redeemefy avatar Oct 08 '23 18:10 redeemefy

To add more context into my case. I installed my nodes version with Volta.

This is also my case, and @nikolubbe solution is not working for me.

macOS: 13.2.1 (22D68) chip: Apple M1

RenzoDas avatar Oct 10 '23 13:10 RenzoDas

To add more context into my case. I installed my nodes version with Volta.

This is also my case, and @nikolubbe solution is not working for me.

macOS: 13.2.1 (22D68)

chip: Apple M1

The mention solution didn't work for me either.

redeemefy avatar Oct 10 '23 13:10 redeemefy

Hey! Still getting this issue on every language server I tried (Javascript, Python), I'm on macOS Sonoma 14.1 beta. None of the fixes mentioned in this issue solved it for me.

jdupas22 avatar Oct 12 '23 15:10 jdupas22

Could it be that the type of MacBook matters? My teammate has the new MacBook with M1/2 CPU and I have a 2019 with Intel and he doesn't have the infinite loop of installing language servers.

redeemefy avatar Oct 15 '23 00:10 redeemefy