Ultisnips: Error detected while processing function UltiSnips#TrackChange[1]..provider#python3#Call: line 18:

Created on 1 May 2017  路  34Comments  路  Source: SirVer/ultisnips

I am getting the following error while editing markdown files:

"~/work/miwt-help/en/subMeasurementsHome.markdown" 21L, 970C
Error detected while processing function UltiSnips#TrackChange[1]..provider#python3#Call:
line   18:
Invalid channel: 1
Error detected while processing function UltiSnips#TrackChange[1]..provider#python3#Call:
line   18:
Invalid channel: 1
Error detected while processing function UltiSnips#TrackChange[1]..provider#python3#Call:
line   18:
Invalid channel: 1
"navbar.markdown" 12L, 488C written
Error detected while processing function UltiSnips#TrackChange[1]..provider#python3#Call:
line   18:
Invalid channel: 1
Error detected while processing function UltiSnips#TrackChange[1]..provider#python3#Call:
line   18:
Invalid channel: 1
Error detected while processing function UltiSnips#TrackChange[1]..provider#python3#Call:
line   18:
Invalid channel: 1
Error detected while processing function UltiSnips#TrackChange[1]..provider#python3#Call:
line   18:
Invalid channel: 1
E492: Not an editor command: output
Press ENTER or type command to continue

Every time I hit a key, this error comes up every time I hit a key.

selection_087

answered or workaround exists can't reproduce neovim only questionable thirdparty problem

Most helpful comment

@hoetmaaiers
I had this exact issue, turns out I have my editor set in my gitconfig

editor = /usr/bin/vim

Instead of the homebrew installed one

editor = /usr/local/bin/vim

switching to the homebrew corrects this.

All 34 comments

Same issue here. Errors pop up at every key stroke. (neovim 0.2.0 + ultisnip + vim-snippets)

I'm experiencing this issue as well, I saw it intermittently before updating neovim to 0.2.0, but I'm now seeing it very consistently. I haven't delved deeply into getting exact conditions for reproducing the bug, but anecdotally it seems to happen more with certain filetypes (.md and .txt are ones I've noticed) and it also seems to happen more when the editor has been 'idling' for a while without receiving any input. Hopefully that's helpful!

Same issue here. (neovim 0.2.0 + ultisnip + vim-snippets + vundle)

Error detected while processing function UltiSnips#TrackChange[1]..provider#python#Call:
line 18:
Invalid channel: 3

Same issue here, even when using the 3.1 release version. I noticed that the error occurs once the python2 provider thread (which imports neovim) quits: one can check it through htop.

The same issue seems affect YouCompleteMe. I even suspect it could be the root cause of the problem.

This problem is likely a neovim issue rather than a ultisnip one.

See https://github.com/neovim/neovim/issues/6249.

Most likely a configuration issue. Make sure :CheckHealth reports the python paths you expect, if you have multiple python installs (or virtual envs, or whatever other python things flying around; set g:python_host_prog and g:python3_host_prog to avoid ambiguity).

neovim/neovim#6249 is meaningless. That's why it was merged with https://github.com/neovim/neovim/issues/4468 ("better feedback" for this error).

Thanks, @justinmk. :CheckHealth reports the path to the python is correct. Also, the python is only allowed to minimize ambiguity. My configuration is indeed simple and just default.

One observation is that the crash of the python provider is likely due to YCM. After removing the YouCompleteMe plugin, then no error is observed. I wonder whether neovim will re-spawn a python instance if the existing one dies.

I wonder whether neovim will re-spawn a python instance if the existing one dies.

Unfortunately not yet. https://github.com/neovim/neovim/issues/5429

I have the same issue in Vim 8 (not Neovim)... Are any solutions known?
I only have the issue when entering a .git/COMMIT_EDITMSG[+].

Same here. No Neovim.

MacOS Sierra v 10.12.5
vim: version 7.4.8056
Homebrew 1.2.3

I'm commenting lines out from augroup UltiSnips_AutoTrigger to augroup END in ~/.vim/plugged/ultisnips/plugin/UltiSnips.vim for now.
For some reason au! UltiSnips_AutoTrigger didn't work. (No group found)

Same here with MacOS sierra, vim 8.0 (via macvim).

I figured out that re-installing Vim through Homebrew with only python3 does the trick brew install vim --with-python3. Make sure to uninstall python first.

Also make sure that you are using vim installed from homebrew and not the system version.
which vim should point to something like /usr/local/bin/vim rather than /usr/bin/vim.

@hoetmaaiers
I had this exact issue, turns out I have my editor set in my gitconfig

editor = /usr/bin/vim

Instead of the homebrew installed one

editor = /usr/local/bin/vim

switching to the homebrew corrects this.

This happened to me after I upgraded Python via brew. Fixed by relinking it with
brew link --overwrite python

For me brew upgrade vim works as a solution.

For some reason this issue appared for me right now (but I have been using neovim and ultisnips for over two years).

The issue is not on startup, but after a while of editing the same file.

Same for me!
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 19 2018 05:42:07)
Python 2.7.14 :: Anaconda, Inc.

I started to have this issue today after many years of using vim, upgrading vim didn't solve it, it seems that it has something to do with sessions everything started after I created and opened a session file.

I'm not sure if this is the same issue as what I was dealing with, but I had the plugin suan/vim-instant-markdown enabled and disabling it fixed this issue for me (in Neovim)

Happened to me as well, brew upgrade vim was the solution. I'd like to note that it may be upgrading Mac Command Line tools that causes this error.

  1. Exec which vim, get your correct vim path.
  2. git config --global core.editor "/path/to/vim"

For me, I brew installed vim8 with python extension. The path to my brew vim8 is /usr/local/bin/vim. At step 2, I configured my git with git config --global core.editor "/usr/local/bin/vim"

Hope it can also work for you.

Hi,

I have this very same issue. What I found out is, that thi is happening only when I open the session (created by :mksession .session and then vim -S .session. If I open the file directly, it's working.

I think it might be related to the tilde (~) expand:
When I open the file directly then:
:py3 import vim ; print(vim._get_paths())
prints, among others, something like /home/username/.vim/bundle/ultisnips/pythonx
I can do this, without any error: py3 import UltiSnips

But when I open the session (even openeing only the same file like above), then
:py3 import vim ; print(vim._get_paths()) is ~/.vim/bundle/ultisnips/pythonx
:py3 import UltiSnips ends up with NameError: name 'UltiSnips' is not defined
When I edit the .session file manually and I replace the ~ with /home/username in the runtimepath section, then, opening the session works correctly with UltiSnips. Weird thing is that I'm using this plugin for years and it has just broke one day. I tried to completely remove it and clone it from the repo, but it didn't help. Also, another python related plugins work just fine (jedi for example)

Ok, this is definitelly ugly and dirty workaround, but until this is really fixed i was able to manage to make this plugin working in session by editing ~/.vim/bundle/ultisnips/autoload/UltiSnips.vim this way:

diff --git a/autoload/UltiSnips.vim b/autoload/UltiSnips.vim
index bde2857..9aa99bd 100644
--- a/autoload/UltiSnips.vim
+++ b/autoload/UltiSnips.vim
@@ -5,6 +5,7 @@ let b:did_autoload_ultisnips = 1

" Also import vim as we expect it to be imported in many places.
exec g:_uspy "import vim"
+exec g:_uspy "import sys; import os.path; sys.path.append(os.path.expanduser('~/.vim/bundle/ultisnips/pythonx/'))"
exec g:_uspy "from UltiSnips import UltiSnips_Manager"

function! s:compensate_for_pum()

(adding exec g:_uspy "import sys; import os.path; sys.path.append(os.path.expanduser('~/.vim/bundle/ultisnips/pythonx/'))" line just before exec g:_uspy "from UltiSnips import UltiSnips_Manager" )

  1. Exec which vim, get your correct vim path.
  2. git config --global core.editor "/path/to/vim"

For me, I brew installed vim8 with python extension. The path to my brew vim8 is /usr/local/bin/vim. At step 2, I configured my git with git config --global core.editor "/usr/local/bin/vim"

Hope it can also work for you.

This solved my issue of having Error detected while processing /Users/james/.vim/bundle/ultisnips/autoload /UltiSnips.vim: everytime I do git commit. This came up after upgrading to Mojave.

Same here. Whenever I make any keystroke in insert mode in any file, it gives long series of errors (same error as posted above). If I press Command+V to paste something, it will pop out the errors and paste something like -1.

vim 8.0 (not neovim). macOS 10.14.4. I've tried g:python_host_prog since brew changed the python path (not python3) recently and I made it point to the system one, with no luck. I've tried which vi or which vim, and they all point to /usr/bin/vi(m). I also tried reinstalling ultisnip but still came to no avail.

Hope it be fixed. Thanks.

I encountered this issue while using python virtualenv with neovim. After running checkhealth I found that neovim looks for neovim module in virtualenv not in system installed python

I try summarizing what I read in this thread:

  • There is an old issue with neovim which seems fixed at master of NeoVim.
  • There are various issues with Mac OS and different python versions being used. Generally I suggest using Homebrew MacVim & homebrew python on Mac OS.
  • Some problems related to Vim sessions.

I think this bug has historic value for people running into the later two issues, but is not generally actionable for UltiSnips at this point in time, so I will close it. If you encounter any of the problems mentioned in this issue, please open a new issue with reproducability in mind.

I also encountered this issue using vim in Debian on Windows Subsystem for Linux. The solution was to uninstall vim and install vim-python:

sudo apt install vim-python

For anyone else who hits this bug, you can try enabling configuring git to default to vim without plugins with:
git config --global core.editor "vim --noplugin"
Hope this helps.

To switch back, just run the same command without the --noplugin flag.

I have this error in normal Vim now. Should I open a new issue? I also have it on Windows even though Python is installed. Thing is: I don't even use Python! Ultisnips should not require this by default!

Use Vundle as your plugin manager.

I fix the bug by installing pynvim pip install pynvim

I fix the bug by removing config of nvim and reinstall vim.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisrytting picture chrisrytting  路  7Comments

raorm picture raorm  路  4Comments

lx93uv picture lx93uv  路  6Comments

Industrial picture Industrial  路  8Comments

chiphogg picture chiphogg  路  3Comments