Closed jloxfo2 closed 1 year ago
rust-analyzer fails to start. As you see in the logs, rust-analyzer started several times, but all failed.
There is no output, although we do see it in the CocInfo logs.
Where's it?
Do you have rust-analyzer installed manually? By default, coc-rust-analyzer will download rust-analyzer to ~/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer
. What's the output:
~/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer --version
I think that command shows the problem. It seems to reside in the libc version,
% ~/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer --version
/home/$USER/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /home/$USER/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer)
Checking the version of libc,
% ldd --version
ldd (GNU libc) 2.26
One thing that's still not clear is why it was working before if there is such a dependency failure.
Verbose logging output, checking :CocCommand workspace.showOutput
:
[Error - 19:31:17.367] Connection to server Rust Analyzer Language Server is erroring, write EPIPE. Shutting down server.
Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at Socket._writeGeneric (node:net:905:11)
at Socket._write (node:net:917:8)
at writeOrBuffer (node:internal/streams/writable:391:12)
at _write (node:internal/streams/writable:332:10)
at Socket.Writable.write (node:internal/streams/writable:336:10)
at /local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:3107
at new Promise (<anonymous>)
at ZD.write (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:3028)
[Error - 19:31:17.368] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: 1
at Nd.shutdown (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:13537)
at Nd.stop (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:13332)
at Nd.stop (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:248:3029)
at Nd.handleConnectionError (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:16527)
at e (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15182)
at /local/home/$USER/.vim/plugged/coc.nvim/build/index.js:241:5636
at yT.invoke (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:14460)
at lc.fire (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:15230)
at Dn (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:25:6576)
at yT.invoke (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:14460)
[Info - 19:31:17.368] Connection to server got closed. Server will restart.
[Error - 19:31:17.369] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:31:17.371] Rust Analyzer Language Server client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
/local/home/$USER/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /local/home/$USER/.config/coc/extensions/coc-rust-analyzer-
[Error - 19:31:17.377] /local/home/$USER/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer exited with code: 1
[Error - 19:31:17.377] /local/home/$USER/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer exited with code: 1
[Info - 19:31:17.377] Connection to server got closed. Server will restart.
[Error - 19:31:17.377] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 19:31:17.378] Rust Analyzer Language Server client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
/local/home/$USER/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /local/home/$USER/.config/coc/extensions/coc-rust-analyzer-
[Error - 19:31:17.385] Connection to server Rust Analyzer Language Server is erroring, write EPIPE. Shutting down server.
Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at Socket._writeGeneric (node:net:905:11)
at Socket._write (node:net:917:8)
at writeOrBuffer (node:internal/streams/writable:391:12)
at _write (node:internal/streams/writable:332:10)
at Socket.Writable.write (node:internal/streams/writable:336:10)
at /local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:3107
at new Promise (<anonymous>)
at ZD.write (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:3028)
[Error - 19:31:17.385] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: 2
at Nd.shutdown (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:13537)
at Nd.stop (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:13332)
at Nd.stop (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:248:3029)
at Nd.handleConnectionError (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:16527)
at e (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15182)
at /local/home/$USER/.vim/plugged/coc.nvim/build/index.js:241:5636
at yT.invoke (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:14460)
at lc.fire (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:15230)
at Dn (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:25:6576)
at yT.invoke (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:24:14460)
[Info - 19:31:17.385] Connection to server got closed. Server will restart.
So I was able to root cause the issue to the rust-analyzer
binary itself. The binary version being used was not compatible with my libc version (v2.26). It may have been working before running rustup
due to rust-analyzer
now shipping with rustup
[0]. In any case, using a different rust-analyzer
binary and setting "rust-analyzer.server.path"
in the CocConfig to point to the binary solved the issue.
I faced the same issue, was able to resolve by running:
mkdir -p ~/.local/bin
curl -L https://github.com/rust-lang/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > ~/.local/bin/rust-analyzer
chmod +x ~/.local/bin/rust-analyzer
Running into an issue with client failing to connect to the language server. It was previously working, but broke at some point. The only notable thing that occurred in that time was running
rustup update
to move to 1.70. Also tried uninstalling and reinstallingcoc-rust-analyzer
,coc.nvim
, andrust.vim
, but without any success.Error seen after starting opening a rust source file in vim:
What's the output of
:CocInfo
What's the output of
:CocCommand rust-analyzer.serverVersion
There is no output, although we do see it in the CocInfo logs.What's your coc-rust-analyzer version? You can get it from
:CocList extensions