Coc.nvim: Timeout on commands

Created on 27 Nov 2018  路  13Comments  路  Source: neoclide/coc.nvim

Describe the bug
After I run a command, there is often a timeout: [coc.nvim] Error on BufCreate: request nvim_call_function - timeout after 3s even if the command succeeded. In this case I used gd to go to a definition which succeeded, but then I got this error messages.

Expected behavior
A command to succeed without an error, or if there was an error a different explanation.

Desktop (please complete the following information):

  • Terminal: iTerm2
  • Version: v3.2.5
question

All 13 comments

It's not command failure, but something wrong on buffer create.
I need to know the reason of timeout, try paste log of coc.nvim here.
You can get the log by :CocOpenLog

When I run :CocOpenLog I get an error:

"/private/var/folders/1c/66mlc88x2ld7tzmm91xwljqm0000gp/T/coc-nvim.log" 2438 lines --96%--
Error detected while processing function coc#rpc#request[4]..nvim#rpc#request:
line    5:
E714: List required

And then it opens. Here is the log from today (it is long, so I am putting it in a gist): https://gist.github.com/Dbz/83310590d7e6d730ac150fd9da5462d5

I just fixed E714: List required, but still don't know what caused the timeout.
What's your autocmd settings for coc? Maybe change CocAction to CocActionAsync could solve the problem.

I am using the default vim config on the readme. I will start by changing all of the CocActions to CocActionAsync.

You can remove the autocmd for signatureHelp, coc support trigger character for sigature help now.

Here is another one. I wonder if it is fighting with vim-go somehow?

Opening :messages I see:

"pkg/e2e/suite.go" 456L, 18150C
vim-go: deploymentclient.HTTPClient, cancelFunc context.CancelFunc, workunits []string)
[coc.nvim] Error on BufCreate: request nvim_call_function - timeout after 3s

Calling :CocOpenLog I get:

"/private/var/folders/1c/66mlc88x2ld7tzmm91xwljqm0000gp/T/coc-nvim.log" 2725L, 236089C
Error detected while processing function coc#rpc#request[4]..nvim#rpc#request:
line    5:
E714: List required

After pressing enter and going to the bottom of the log I see:

2018-11-27T15:31:14.674 INFO (pid:64108) [plugin] - coc initialized with node: v11.2.0
2018-11-27T15:31:14.677 INFO (pid:64108) [services] - golang state change: starting => running
2018-11-27T15:43:33.844 INFO (pid:66466) [services] - golang state change: stopped => starting
2018-11-27T15:43:33.857 INFO (pid:66466) [services] - golang state change: starting => stopped
2018-11-27T15:43:33.870 ERROR (pid:66466) [server] - uncaughtException Error: spawn go-langserver ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
    at onErrorNT (internal/child_process.js:421:16)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)
2018-11-27T15:43:33.884 INFO (pid:66466) [plugin] - coc initialized with node: v11.2.0
2018-11-27T15:45:37.172 ERROR (pid:64108) [events] - Error: request nvim_call_function - timeout after 3s
    at transport.request (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/@chemzqm/neovim/lib/api/Base.js:33:28)
    at Transport.parseMessage (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/@chemzqm/neovim/lib/utils/transport.js:107:13)
    at DecodeStream.Transport.decodeStream.on (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/@chemzqm/neovim/lib/utils/transport.js:41:18)
    at DecodeStream.emit (events.js:182:13)
    at addChunk (_stream_readable.js:287:12)
    at readableAddChunk (_stream_readable.js:268:11)
    at DecodeStream.Readable.push (_stream_readable.js:223:10)
    at DecodeStream.Transform.push (_stream_transform.js:151:32)
    at DecodeBuffer.DecodeStream.decoder.push (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/msgpack-lite/lib/decode-stream.js:24:12)
    at DecodeBuffer.flush (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/msgpack-lite/lib/flex-buffer.js:57:12)
2018-11-27T15:56:44.130 ERROR (pid:64108) [events] - Error: request nvim_call_function - timeout after 3s
    at transport.request (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/@chemzqm/neovim/lib/api/Base.js:33:28)
    at Transport.parseMessage (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/@chemzqm/neovim/lib/utils/transport.js:107:13)
    at DecodeStream.Transport.decodeStream.on (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/@chemzqm/neovim/lib/utils/transport.js:41:18)
    at DecodeStream.emit (events.js:182:13)
    at addChunk (_stream_readable.js:287:12)
    at readableAddChunk (_stream_readable.js:268:11)
    at DecodeStream.Readable.push (_stream_readable.js:223:10)
    at DecodeStream.Transform.push (_stream_transform.js:151:32)
    at DecodeBuffer.DecodeStream.decoder.push (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/msgpack-lite/lib/decode-stream.js:24:12)
    at DecodeBuffer.flush (/Users/danielburt/development/dotfiles/.vim/plugged/coc.nvim/node_modules/msgpack-lite/lib/flex-buffer.js:57:12)

Issue of :CocOpenLog is fixed, update coc.nvim required.
I have go-vim and go-langserver, but I can't reproduce your problem.
What's the steps to make the timeout happen?

It's hard to reproduce, but it does happen on a work project that I'm in.

I also get a lot of request "CocAction" timeout after 3000 when I use the gr command. However, if I try the command several times, it usually works. This makes me think that maybe there should be some background indexing and/or configurable timeout.

I have been considering rebuilding my .vimrc and plugins from scratch. Would switching to neovim possible help?

Also, do you want me to grab logs anytime this happens?

Would switching to neovim possible help?

I think so, async request works a lot better with neovim.

Also, do you want me to grab logs anytime this happens?

Sure, could be helpful to reproduce the problem, you can have all information by command :CocInfo

request "CocAction" timeout after 3000

This happens usually because your vim is blocked and the server can't receive response in 3s.
I've updated vim-node-rpc with better message, update it by npm i -g vim-node-rpc

I've fixed the timeout problem with vim-node-rpc by change timeout to 30s, since there could be prompt that block vim, server should wait for vim without throw error.

Awesome, and I switched to neovim, and I haven't run into the issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tom-james-watson picture tom-james-watson  路  3Comments

rkulla picture rkulla  路  3Comments

czepluch picture czepluch  路  3Comments

marene picture marene  路  3Comments

lanox picture lanox  路  3Comments