vim-gutentags icon indicating copy to clipboard operation
vim-gutentags copied to clipboard

Error detected while processing DirChanged Autocommands for "*":

Open ctfrancia opened this issue 4 years ago • 14 comments

Describe the bug Describe what the bug is about, and what you expected. Don't forget to format things nicely with Markdown. If applicable, post screenshots. After leaving Neovim I get the following error:

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>70_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

Steps to reproduce

  1. open up a file with neovim
  2. edit file
  3. quit Neovim with :x

Share your setup

  • What OS and version of Vim are you using? Catalina 10.14
  • What version of ctags, gtags, or whatever do you have installed? latest? It's a fresh install from homebrew
  • Are you using g:gutentags_cache_dir? no

Post the logs

  • Run :let g:gutentags_trace = 1.
  • Reproduce the bug.
  • Run :messages and show the messages that Gutentags posted.
  • Look for the tags.log file that Gutentags' script left behind, and post its contents.

Additional context Add any other context about the problem here.

ctfrancia avatar Mar 15 '20 12:03 ctfrancia

This is minimal vimrc, I think.

How to reproduce

  1. nvim -u /tmp/mini.vim somefile
  2. edit
  3. save (:wqa)
syntax on
filetype plugin indent on

if has('vim_starting')
  let s:pluin_manager_dir='~/.vim/plugged/vim-plug'
  execute 'set runtimepath+=' . s:pluin_manager_dir
endif
call plug#begin('~/.vim/plugged')
  Plug 'ludovicchabant/vim-gutentags'
  Plug 'neoclide/coc.nvim', {'branch': 'release'}
cal plug#end()

let g:coc_global_extensions = [ 'coc-snippets' ]

yutkat avatar Apr 10 '20 04:04 yutkat

~FWIW this workaround works for me to stop the failure https://github.com/ludovicchabant/vim-gutentags/issues/178#issuecomment-472715897~ this does not fix it entirely but does seem to improve it

keith avatar Jun 09 '20 17:06 keith

I can't quite reproduce this bug. I have neovim 0.4.4 (from homebrew on macOS), and I had to modify the minimal vimrc since I don't have a plugin manager (just a barebones neovim):

syntax on
filetype plugin indent on

if has('vim_starting')
  execute 'set runtimepath+=~/Code/DotFiles/vim/bundle/gutentags'
  execute 'set runtimepath+=~/Code/Tests/coc.nvim'
endif

let g:coc_global_extensions = [ 'coc-snippets' ]

I don't see any errors so far. It could be because coc is non-functional: it's asking me to install all kinds of javascript stuff to enable itself...

ludovicchabant avatar Oct 01 '20 17:10 ludovicchabant

@ludovicchabant I also can't reliably reproduce this bug. I used to hit it consistently on a repo I worked on some time ago, but I recently re-enabled gutentags (I love it BTW but I had to disable it because of this bug) and I didn't hit the bug again (yet). And I don't use coc at all.

I'm saying this just to emphasize that the bug is real, it's just elusive :)

infokiller avatar Oct 01 '20 17:10 infokiller

I can't quite reproduce this bug. I have neovim 0.4.4 (from homebrew on macOS), and I had to modify the minimal vimrc since I don't have a plugin manager (just a barebones neovim):

syntax on
filetype plugin indent on

if has('vim_starting')
  execute 'set runtimepath+=~/Code/DotFiles/vim/bundle/gutentags'
  execute 'set runtimepath+=~/Code/Tests/coc.nvim'
endif

let g:coc_global_extensions = [ 'coc-snippets' ]

I don't see any errors so far. It could be because coc is non-functional: it's asking me to install all kinds of javascript stuff to enable itself...

i also cannot repro it. i try

" File: $XDG_CONFIG_HOME/nvim/test.vim
" OS: linux v5.4.13
" Vi: nvim v0.4.3
" Py: cpython v3.6.10
" Term: guake v3.7.0
syntax on
filetype plugin indent on
set runtimepath=$VIMRUNTIME,$GITHUBWORKSPACE/ludovicchabant/vim-gutentags,$GITHUBWORKSPACE/neoclide/coc.nvim
let g:coc_global_extensions = ['coc-snippets']
" vi -u $XDG_CONFIG_HOME/nvim/test.vim ~/Desktop/test.c

because i don't use vim-plug (but i use coc.nvim)

can i know whether the vim-plug is necessary, please? if so, i'll install a vim-plug to test again.

BTW, i can use the following vimrc to encounter this error.

" File: $XDG_CONFIG_HOME/nvim/test.vim
" OS: linux v5.4.13
" Vi: nvim v0.4.3
" Py: cpython v3.6.10
" Term: guake v3.7.0
set runtimepath=$VIMRUNTIME,$GITHUBWORKSPACE/Freed-Wu/LeaderF,$GITHUBWORKSPACE/ludovicchabant/vim-gutentags
" vi -u $XDG_CONFIG_HOME/nvim/test.vim ~/Desktop/test.c

see https://github.com/ludovicchabant/vim-gutentags/issues/283

can anyone repro it?

Freed-Wu avatar Oct 07 '20 09:10 Freed-Wu

Not sure if this is helpful, but I get this on 3 of my machines: Arch, Ubuntu and MacOS Big Sur. The nvim version doesn't seem to matter as I use nightly on some and stable on others.

I can get it to occur consistently on all three machines by quitting neovim within 5 seconds or so of opening it.

(you don't realise how commonly you do this until you start getting an error every time you do :joy:)

ceuk avatar Feb 10 '21 03:02 ceuk

I've been getting this all the time too. It seems to have started around the time I switched to nvim, but no idea if it's nvim specific 🤔

jesseleite avatar Mar 16 '21 23:03 jesseleite

I'm seeing this intermittently on different files.

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>126_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

meangrape avatar Mar 26 '22 18:03 meangrape

Install a plugin 'airblade/vim-rooter' ,can solved this problem.

Leo-Ni88 avatar Apr 07 '22 06:04 Leo-Ni88

Install a plugin 'airblade/vim-rooter' ,can solved this problem.

I can confirm this does not fix my issues. It's happening on some of the files, not on all files.

tufei avatar Jul 08 '22 17:07 tufei

I am experiencing this bug after moving from vim to neovim.

sandrodz avatar Jul 16 '22 20:07 sandrodz

I fixed this by running :healthcheck from within nvim. This alerted me to the fact that python had an error, so I followed the instruction to: pip install pynvim When I ran :healthcheck again, all was well, and on quitting nvim, I have not had the DirChanged error since.

Edit: Further evidence suggests it still throws the error if the file is saved, but doesn't on a non-edit.

WilliamDugdale avatar Jan 25 '23 05:01 WilliamDugdale

Same issue here, rather consistently:

Error detected while processing function <SNR>202_nvim_job_exit_wrapper[1]..gutentags#ctags#on_job_exit[1]..gutentags#remove_job_by_data[2]..gutentags#remove_job[22]..<SNR>202_update_tags[55]..function <SNR>202_nvim_job_exit_wrapper[1]..gutentags#ctags#on_job_exit[1]..gutentags#remove_job_by_data[2]..gutentags#remove_job[22]..<SNR>202_update_tags[44]..gutentags#ctags#generate[112]..<SNR>203_generate_wildignore_options:
line   26:
E482: Can't open file /var/folders/31/5hzdscvx19715k164wsn1ync0000gn/T/nvim.jseidel/tu94sk/2 for writing: no such file or directory
Error detected while processing function <SNR>202_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

Happens when I exit a file that I have been editing: MacOS Ventura 13.2.1 NVIM v0.8.3 Build type: Release LuaJIT 2.1.0-beta3 Compiled by brew@Ventura Features: +acl +iconv +tui :checkhealth command returns:


coc: health#coc#check
========================================================================
  - OK: nvim version satisfied
  - OK: Environment check passed
  - OK: Javascript bundle build/index.js found
  - OK: Service started

gitmessenger: health#gitmessenger#check
========================================================================
  - OK: +job is available to execute Git command
  - OK: Git command `git` is available: git version 2.38.0
  - OK: Floating window is available for popup window

man: require("man.health").check()
========================================================================
  - OK: plugin/man.vim not in $VIMRUNTIME
  - OK: autoload/man.vim not in $VIMRUNTIME

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $TERM_PROGRAM='iTerm.app'
  - INFO: $COLORTERM='truecolor'

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3.9 in the environment.
  - INFO: Executable: /usr/local/bin/python3.9
  - INFO: Python version: 3.9.16
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.
      - You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim

## Node.js provider (optional)
  - INFO: Node.js: v14.17.0
  - INFO: Nvim node.js host: /Users/jseidel/.config/yarn/global//node_modules/neovim/bin/cli.js
  - OK: Latest "neovim" npm/yarn/pnpm package is installed: 4.10.1

## Perl provider (optional)
  - WARNING: "Neovim::Ext" cpan module is not installed
    - ADVICE:
      - See :help |provider-perl| for more information.
      - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /Users/jseidel/.local/state/nvim/lsp.log
  - INFO: Log size: 823 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 14
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for help: ABI version 14
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for vim: ABI version 14

JESii avatar Mar 07 '23 16:03 JESii

I can reproduce below issue with 2 conditions met.

  1. Let nvim to open file out of file the project location. ?? Will this step create new tags or do some changes??
  2. quit nvim immediately. must use cmd :wq but not :q Looks like this step break step1's process, since if i wait to several seconds to let new tags create success, then can't reproduce below error.

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>112_nvim_job_exit_wrapper[1]..gutentags#ctags#on_job_exit[1]..gutentags#remove_job_by_data[2]..gutentags#remove_job: line 22:

lyskai avatar Aug 06 '23 07:08 lyskai