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

Error when deoplete installed #168

Closed
michaelmior opened this issue Apr 11, 2018 · 20 comments
Closed

Error when deoplete installed #168

michaelmior opened this issue Apr 11, 2018 · 20 comments

Comments

@michaelmior
Copy link

@michaelmior michaelmior commented Apr 11, 2018

vim often hangs for several seconds when exiting if deoplete installed. I also get the error message below. Not sure if the error is really with gutentags or deoplete but since the error is in gutentags code, I figured I'd start here.

Error detected while processing function deoplete#send_event[1]..deoplete#util#rpcnotify[4]..<SNR>144_notify:
line    9:
E475: Invalid argument: Channel doesn't exist
E475: Invalid argument: Channel doesn't exist
Error detected while processing function <SNR>137_nvim_job_exit_wrapper[1]..gutentags#ctags#on_job_exit[1]..gutentags#remove_job_by_data[2]..gutentags#remove_job:
line   22:
E171: Missing :endif
@justinhoward
Copy link

@justinhoward justinhoward commented Apr 12, 2018

I can confirm the same error

  • NVIM v0.2.2
  • Gutentags master (commit 327bd97)

Does not happen on v1.0.0

@Leandros
Copy link

@Leandros Leandros commented Apr 23, 2018

It used to work with an older version of gutentags, since this appeared after I updated my plugins.

@taiansu
Copy link

@taiansu taiansu commented Apr 25, 2018

FWIW, this only happens when I open a ruby file.

@ruipin
Copy link

@ruipin ruipin commented Apr 27, 2018

I seem to get this almost every single time I do a git commit and quickly close vim once it opens to edit the commit message (i.e. I use the default message).

@alok
Copy link

@alok alok commented May 2, 2018

@ruipgpinheiro Same here.

@EduardoBorsa
Copy link

@EduardoBorsa EduardoBorsa commented May 7, 2018

Same here...

@burgessa23
Copy link

@burgessa23 burgessa23 commented May 8, 2018

can also repro the git case, seems to also happen when normally editing files too

@ludovicchabant
Copy link
Owner

@ludovicchabant ludovicchabant commented May 9, 2018

It's probably related to issue 167 ?

Can you try to edit this piece of code and add 'detach': 1 to the options dictionary?

@burgessa23
Copy link

@burgessa23 burgessa23 commented May 11, 2018

@ludovicchabant sorry, where in the dict?

@gkapfham
Copy link

@gkapfham gkapfham commented Jun 6, 2018

Hello @ludovicchabant and @burgessa23 and @michaelmior! I can confirm that I am also experiencing this issue when I do a git commit and then edit the commit message in Neovim. Currently, I am using NVIM v0.3.0-dev. I followed @ludovicchabant's instructions and changed the source code of Gutentags in the following fashion. Is this what you had in mind?

    function! gutentags#build_default_job_options(module) abort
        let l:job_opts = {
                    \ 'detach': 1,
                    \'on_exit': function(
                    \    '<SID>nvim_job_exit_wrapper',
                    \    ['gutentags#'.a:module.'#on_job_exit']),
                    \'on_stdout': function(
                    \    '<SID>nvim_job_out_wrapper',
                    \    ['gutentags#default_io_cb']),
                    \'on_stderr': function(
                    \    '<SID>nvim_job_out_wrapper',
                    \    ['gutentags#default_io_cb'])
                    \}
        return l:job_opts
    endfunction

I can confirm that when I make this change to the code I no longer see the error that was causing problems for me. Is this a fix to the problem? I would appreciate any feedback that you can share about the best way to fully resolve this issue. Thanks for your help and your contribution of this great plugin!

@ludovicchabant
Copy link
Owner

@ludovicchabant ludovicchabant commented Jun 9, 2018

It's difficult to know if this is the fix at the moment :) The problem with detaching on exit is that if you exit vim and re-open it in the same folder, you'll end up with 2 competing ctags processes trying to scan the same files, and write to the same tags file... which is probably bad.

Issue #167 will be the central place for most "problems on exit in Neovim" from now on, so I'll close this issue and we can keep investigating and figuring out these things over there.

People who want to go back to before we started using the Vim8/Neovim background job API can switch to the vim7 branch in the Gutentags repository.

@gkapfham
Copy link

@gkapfham gkapfham commented Jun 13, 2018

Hello @ludovicchabant, I am also tracking issue #167. I thought it best to report here that I am now using the following version of Neovim:

Build type: RelWithDebInfo
Lua 5.1
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim-TNdxg7/neovim-0.2.2ubuntu2+git201806122018-315b7f8-f2f288d/build/config -I/build/neovim-TNdxg7/neovim-0.2.2ubuntu2+git201806122018-315b7f8-f2f288d/src -I/build/neovim-TNdxg7/neovim-0.2.2ubuntu2+git201806122018-315b7f8-f2f288d/.deps/usr/include -I/usr/include -I/build/neovim-TNdxg7/neovim-0.2.2ubuntu2+git201806122018-315b7f8-f2f288d/build/src/nvim/auto -I/build/neovim-TNdxg7/neovim-0.2.2ubuntu2+git201806122018-315b7f8-f2f288d/build/include
Compiled by buildd@lgw01-amd64-048

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Here is an example of an error that I see in the terminal window if I use Neovim to edit the commit message and then quickly exit Neovim.

line    9:
E475: Invalid argument: Channel doesn't exist
Error detected while processing DirChanged Auto commands for "*":
E475: Invalid argument: Channel doesn't exist
Error detected while processing function deoplete#send_event[1]..deoplete#util#rpcnotify[2]..<SNR>19_notify:
line    9:
E475: Invalid argument: Channel doesn't exist
Error detected while processing function <SNR>152_nvim_job_exit_wrapper[1]..gutentags#ctags#on_job_exit[1]..gutentags#remove_job_by_data[2]..gutentags#remove_job:
line   22:
E171: Missing :endif[fix-target-blank 56bf590] Deleting a not-needed word in the software file.
 1 file changed, 1 insertion(+), 1 deletion(-)

I think that this error is similar to the one that started this issue and it is occurring with this newer version of Neovim. So, perhaps it is possible that a newer version does not resolve this tricky issue? Please let me know if you have any updates or if there is anything that I can do to assist in the resolution of this issue.

@ludovicchabant
Copy link
Owner

@ludovicchabant ludovicchabant commented Jun 14, 2018

This looks very similar to #178 ?

@afifsohaili
Copy link

@afifsohaili afifsohaili commented Jun 28, 2018

This seems to happen when I rebase or commit only, so I added this line:

au FileType gitcommit,gitrebase let g:gutentags_enabled=0

and it works.

@gkapfham
Copy link

@gkapfham gkapfham commented Jul 6, 2018

Hello @ludovicchabant and @afifsohaili, I am writing to confirm that I am following @afifsohaili's suggestion and disabling this plugin when editing a gitcommit or gitrebase buffer and also no longer having any problems. Of course, this does not solve any underlying issues, but it makes Neovim more stable for me. Thanks for the suggestion!

joncrawf added a commit to joncrawf/.vim that referenced this issue Aug 3, 2018
The recent versions of the gutentags plugin utilises neovim's async
backend, which currently causes ctag processes not to be escaped
correctly when quiting a file. This commit moves to a branch of
gutentags that doesn't do this:
ludovicchabant/vim-gutentags#168

Signed-off-by: Jon Crawford <jon@joncrawf.com>
FlowFX added a commit to FlowFX/dotfiles that referenced this issue Oct 2, 2018
@dyno
Copy link

@dyno dyno commented Feb 23, 2019

it's really annoying when quickly edit a text file, so i think it is better only trigger it when first see a source ifile.

    let g:gutentags_enabled = 0
    augroup auto_gutentags
      au FileType python,java,scala,sh,groovy,vim let g:gutentags_enabled=1
    augroup end
@ludovicchabant
Copy link
Owner

@ludovicchabant ludovicchabant commented Mar 13, 2019

A few notes:

  1. There's a g:gutentags_exclude_filetypes that lets you configure file types for which Gutentags should not activate. The advantage over an auto-command, AFAIK, is that the auto-command will kill Gutentags support for the entire session, whereas this setting will just be local to that buffer.

  2. I just installed Neovim v0.3.4 and I can't repro the bug... what I'm doing is opening a file in a big repository (I'm using a BSD distro) so that it takes definitely long enough to run ctags that I won't get the timing wrong. Then, I close Neovim before indexing is finished -- I tried with both "full" indexing and "single file" indexing (upon saving a file). Am I missing something?

@dynofu
Copy link

@dynofu dynofu commented Mar 13, 2019

i get a pretty reproducible situation, edit a source that is not part of the repository. something like a temp source file x.py in a fairly large repository (11728 files). fast vim edit it (actually make some modification, add some spaces etc) then quit vim.

vim x.py
Error detected while processing DirChanged Autocommands for "*":
E475: Invalid argument: Channel doesn't exist
E475: Invalid argument: Channel doesn't exist
Error detected while processing function <SNR>258_nvim_job_exit_wrapper[1]..gutentags#gtags_cscope#on_job_exit[3]..gutentags#remove_job:
line   22:
E171: Missing :endif
Error detected while processing DirChanged Autocommands for "*":
E475: Invalid argument: Channel doesn't exist
E475: Invalid argument: Channel doesn't exist
gutentags: gutentags: ctags job failed, returned: 1

one observation is when quit, gtags seems lag around for a bit then quit.

EDIT:
it looks whether the file is part of the repository does not matter, just make a bit change then quit.

i am on mac and NVIM v0.3.4.

@ludovicchabant
Copy link
Owner

@ludovicchabant ludovicchabant commented Mar 13, 2019

Mmmmh.... macOS and Neovim v0.3.4, with a repository with 200k+ files, and I can't repro. By "fast edit" you mean :e x.py, add some blank line, :w, and :q?

The fact that you have an error message that says ...while processing DirChanged Autocommands makes me wonder if there's maybe another plugin or custom script involved in this bug? Gutentags does change the current directory (temporarily) when it starts the tags generation... could you grep for DirChanged in your installed plugins?

@ludovicchabant
Copy link
Owner

@ludovicchabant ludovicchabant commented Mar 13, 2019

Actually this looks exactly like #178 so we'll continue over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet