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

Cannot call write after stream was destroyed #27

Open
rodrigo-pino opened this issue Nov 27, 2021 · 2 comments
Open

Cannot call write after stream was destroyed #27

rodrigo-pino opened this issue Nov 27, 2021 · 2 comments
Labels
question Further information is requested

Comments

@rodrigo-pino
Copy link

Hi, I'm getting the previous mentioned error every time I open an R file. I don't know if it could be caused due to recently updating R to 4.1.2, or if I messed up smth that broke TCP connection perhaps.

It is not a coc-nvim issue since this only hapens with this extension. The R languageserver is installed and updated.

This is what CocInfo shows:

## versions

vim version: NVIM v0.6.0-dev+631-g72d62aa6a
node version: v17.1.0
coc.nvim version: 0.0.80-0480cbd997
coc.nvim directory: /home/rodro/.local/share/nvim/plugged/coc.nvim
term: xterm-kitty
platform: linux

## Log of coc.nvim

2021-11-27T11:19:00.667 INFO (pid:33518) [services] - registered service "languageserver.prolog-lsp"
2021-11-27T11:19:00.670 INFO (pid:33518) [services] - registered service "languageserver.solidity"
2021-11-27T11:19:00.941 INFO (pid:33518) [coc-git] - Looking for git in: git
2021-11-27T11:19:01.197 INFO (pid:33518) [extension:coc-r-lsp] - Start language server for file:///home/rodro/Aarka/Skull/2do_Semestre_4to/Estadistica/Secciones/Seccion%208/answers/ex2.R
2021-11-27T11:19:01.226 INFO (pid:33518) [extension:coc-r-lsp] - R binary: /usr/bin/R
2021-11-27T11:19:01.227 INFO (pid:33518) [extension:coc-r-lsp] - LANG: en_US.UTF-8
2021-11-27T11:19:01.233 INFO (pid:33518) [plugin] - coc.nvim 0.0.80-0480cbd997 initialized with node: v17.1.0 after 746ms
2021-11-27T11:19:01.524 INFO (pid:33518) [attach] - Request action: diagnosticList []
2021-11-27T11:19:01.616 INFO (pid:33518) [extension:coc-r-lsp] - R process connected
2021-11-27T11:19:01.794 INFO (pid:33518) [attach] - Request action: diagnosticList []
2021-11-27T11:19:01.795 INFO (pid:33518) [attach] - Request action: diagnosticList []
2021-11-27T11:19:01.801 INFO (pid:33518) [attach] - Request action: diagnosticList []
2021-11-27T11:19:01.810 INFO (pid:33518) [attach] - Request action: diagnosticList []
2021-11-27T11:19:01.814 INFO (pid:33518) [attach] - Request action: diagnosticList []
2021-11-27T11:19:01.874 INFO (pid:33518) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m2_v0_11_1_Floatinput_4',
  'CocStatusChange'
]
2021-11-27T11:19:01.939 ERROR (pid:33518) [language-client-client] - connection error: Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:220:20) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'read'
} undefined
2021-11-27T11:19:01.945 ERROR (pid:33518) [language-client-client] - connection error: Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:220:20) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'read'
} undefined
2021-11-27T11:19:01.950 ERROR (pid:33518) [language-client-client] - connection error: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at new NodeError (node:internal/errors:371:5)
    at _write (node:internal/streams/writable:322:11)
    at Socket.Writable.write (node:internal/streams/writable:335:10)
    at /home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:12134:25
    at new Promise (<anonymous>)
    at WritableStreamWrapper.write (/home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:12125:16)
    at StreamMessageWriter2.doWrite (/home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:13035:31)
    at /home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:13026:25 {
  code: 'ERR_STREAM_DESTROYED'
} { jsonrpc: '2.0', id: 1, method: 'shutdown', params: undefined }
2021-11-27T11:19:01.954 ERROR (pid:33518) [server] - unhandledRejection  Promise {
  <rejected> Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
      at new NodeError (node:internal/errors:371:5)
      at _write (node:internal/streams/writable:322:11)
      at Socket.Writable.write (node:internal/streams/writable:335:10)
      at /home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:12134:25
      at new Promise (<anonymous>)
      at WritableStreamWrapper.write (/home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:12125:16)
      at StreamMessageWriter2.doWrite (/home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:13035:31)
      at /home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:13026:25 {
    code: 'ERR_STREAM_DESTROYED'
  }
} Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at new NodeError (node:internal/errors:371:5)
    at _write (node:internal/streams/writable:322:11)
    at Socket.Writable.write (node:internal/streams/writable:335:10)
    at /home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:12134:25
    at new Promise (<anonymous>)
    at WritableStreamWrapper.write (/home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:12125:16)
    at StreamMessageWriter2.doWrite (/home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:13035:31)
    at /home/rodro/.local/share/nvim/plugged/coc.nvim/build/index.js:13026:25 {
  code: 'ERR_STREAM_DESTROYED'
}
2021-11-27T11:19:05.797 INFO (pid:33518) [attach] - receive notification: showInfo []
@chemzqm chemzqm added the question Further information is requested label Dec 21, 2021
@chemzqm
Copy link
Member

chemzqm commented Dec 21, 2021

Try use node 16 might helps.

@simongrund1
Copy link

simongrund1 commented Dec 28, 2021

Same issue here, regardless of node version (getting this with both 16 and 17).

Edit: Strangely, I was able to solve this via install.packages("stringi"), which seemed to have been missing before ("strange" because this package should've been installed automatically alongside the languageserver package).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants