Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rust Analyzer Language Server client: couldn't create connection to server. #1151

@jloxfo2

Description

@jloxfo2

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 reinstalling coc-rust-analyzer, coc.nvim, and rust.vim, but without any success.

Error seen after starting opening a rust source file in vim:

[coc.nvim] Rust Analyzer Language Server client: couldn't create connection to server.

What's the output of :CocInfo

## versions

vim version: VIM - Vi IMproved 9.0 9000813
node version: v16.20.0
coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800
coc.nvim directory: /local/home/$USER/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2023-06-06T07:09:26.424 INFO (pid:43707) [plugin] - coc.nvim initialized with node: v16.20.0 after 176
2023-06-06T07:09:26.425 INFO (pid:43707) [services] - LanguageClient Rust Analyzer Language Server
state change: stopped => starting
2023-06-06T07:09:26.433 INFO (pid:43707) [language-client-index] - Language server "rust-analyzer"
started with 43744
2023-06-06T07:09:26.444 ERROR (pid:43707) [language-client] - Sending request failed.
2023-06-06T07:09:26.445 INFO (pid:43707) [services] - LanguageClient Rust Analyzer Language Server
state change: starting => stopped
2023-06-06T07:09:26.445 INFO (pid:43707) [services] - LanguageClient Rust Analyzer Language Server
state change: stopped => starting
2023-06-06T07:09:26.445 ERROR (pid:43707) [language-client-client] - Server rust-analyzer
initialization failed. jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15224)
    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 Qe (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:25:6504)
    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) {
  code: -32097,
  data: undefined
}
2023-06-06T07:09:26.447 INFO (pid:43707) [services] - LanguageClient Rust Analyzer Language Server
state change: starting => stopped
2023-06-06T07:09:26.448 ERROR (pid:43707) [server] - unhandledRejection  Promise {
  <rejected> jh [Error]: Pending response rejected since connection got disposed
      at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:51:4592)
      at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:241:6209)
      at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:
15575)
      at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:248:3561)
      at t (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15224)
      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 Qe (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:25:6504)
      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) {
    code: -32097,
    data: undefined
  }
} jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15224)
    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 Qe (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:25:6504)
    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) {
  code: -32097,
  data: undefined
}
2023-06-06T07:09:26.451 INFO (pid:43707) [language-client-index] - Language server "rust-analyzer"
started with 43745
2023-06-06T07:09:26.453 ERROR (pid:43707) [language-client] - Sending request failed.
2023-06-06T07:09:26.453 INFO (pid:43707) [services] - LanguageClient Rust Analyzer Language Server
state change: stopped => starting
2023-06-06T07:09:26.454 ERROR (pid:43707) [language-client-client] - Server rust-analyzer
initialization failed. jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15224)
    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 Qe (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:25:6504)
    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) {
  code: -32097,
  data: undefined
}
2023-06-06T07:09:26.454 INFO (pid:43707) [services] - LanguageClient Rust Analyzer Language Server
state change: starting => stopped
2023-06-06T07:09:26.454 ERROR (pid:43707) [services] - Server rust-analyzer failed to start: jh
[Error]: Pending response rejected since connection got disposed
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15224)
    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 Qe (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:25:6504)
    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) {
  code: -32097,
  data: undefined
}
2023-06-06T07:09:26.459 INFO (pid:43707) [language-client-index] - Language server "rust-analyzer"
started with 43747
2023-06-06T07:09:26.463 ERROR (pid:43707) [language-client] - Sending request failed.
2023-06-06T07:09:26.463 INFO (pid:43707) [services] - LanguageClient Rust Analyzer Language Server
state change: stopped => starting
2023-06-06T07:09:26.463 ERROR (pid:43707) [language-client-client] - Server rust-analyzer
initialization failed. jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15224)
    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 Qe (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:25:6504)
    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) {
  code: -32097,
  data: undefined
}
2023-06-06T07:09:26.463 INFO (pid:43707) [services] - LanguageClient Rust Analyzer Language Server
state change: starting => stopped
2023-06-06T07:09:26.466 INFO (pid:43707) [language-client-index] - Language server "rust-analyzer"
started with 43748
2023-06-06T07:09:26.468 ERROR (pid:43707) [language-client] - Sending request failed.
2023-06-06T07:09:26.468 ERROR (pid:43707) [language-client-client] - Server rust-analyzer
initialization failed. jh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:51:4592)
    at Object.dispose (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:241:6209)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15575)
    at Nd.handleConnectionClosed (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:248:3561)
    at t (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:244:15224)
    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 Qe (/local/home/$USER/.vim/plugged/coc.nvim/build/index.js:25:6504)
    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) {
  code: -32097,
  data: undefined
}
2023-06-06T07:09:26.636 INFO (pid:43707) [attach] - receive notification: highlight []
2023-06-06T07:09:28.916 INFO (pid:43707) [attach] - receive notification: showInfo []
2023-06-06T07:09:29.231 INFO (pid:43707) [attach] - receive notification: highlight []
2023-06-06T07:09:31.377 ERROR (pid:43707) [timing] - activate coc-rust-analyzer timeout after 5000ms
2023-06-06T07:09:33.147 INFO (pid:43707) [attach] - receive notification: runCommand [ 'rust-analyzer.
serverVersion' ]
2023-06-06T07:09:33.448 INFO (pid:43707) [attach] - receive notification: highlight []
2023-06-06T07:09:36.696 INFO (pid:43707) [attach] - receive notification: highlight []
2023-06-06T07:09:41.156 INFO (pid:43707) [attach] - receive notification: showInfo []
2023-06-06T07:09:41.467 INFO (pid:43707) [attach] - receive notification: highlight []
2023-06-06T07:09:44.193 INFO (pid:43707) [attach] - receive notification: highlight []
2023-06-06T07:09:45.501 INFO (pid:43707) [attach] - receive notification: highlight []
2023-06-06T07:09:47.222 INFO (pid:43707) [attach] - receive notification: showInfo []

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

+ coc-rust-analyzer 0.73.0 /local~/.config/coc/extensions/node_modules/coc-rust-analyzer
+ coc-json 1.8.0 /local~/.config/coc/extensions/node_modules/coc-json

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions