Youcompleteme: ycmd server SHUT DOWN. Unexpected exit code -6. Type - on MacOS High Sierra

0

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) _before_ filing your issue:

  • [ x ] I have read and understood YCM's CONTRIBUTING document.
  • [ x ] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [ x ] I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • [ x ] I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • [ x ] If filing a bug report, I have included the output of vim --version.
  • [ x ] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [ x ] If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • [ x ] If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • [ x ] If filing a bug report, I have included a minimal test case that reproduces
    my issue, including what I expected to happen and what actually happened.
  • [ x ] If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • [ x ] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt _gift_ of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • [ x ] I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key
questions:

  • What did you do?
    Opened VIM and immediately got this message:
    The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). Unexpected exit code -6. Type ':YcmToggleLogs ycmd_55130_stderr_FYT1q1.log' to check the logs.

Include steps to reproduce here.

  • New macbook with High Sierra
  • Installed YouCompleteMe with VimPlug by adding the line Plug 'Valloric/YouCompleteMe'
  • Then went to the ~.vim/plugged/YouCompleteMe and ran ./install.sh --clang-completer
  • Without error
  • But when open VIM I get the above message immediately.
  • And I get not semantic completion by YouCompleteMe

Include description of a minimal test case, including any actual code required
to reproduce the issue.

  • What did you expect to happen?

    • Not to get any error message when I opened VIM.
  • What actually happened?
    Described above

Include description of the observed behaviour, including actual output,
screenshots, etc.

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jul 26 2017 19:10:24)
Included patches: 1-503, 505-642
Compiled by [email protected]
Normal version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    -mouse_sgr       +tag_old_static
-arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           -mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     -termguicolors
-browse          -footer          +multi_byte      +terminfo
+builtin_terms   +fork()          +multi_lang      +termresponse
+byte_offset     -gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
-clientserver    +insert_expand   +packages        -toolbar
-clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        -perl            +vertsplit
+cmdline_hist    -keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        -langmap         +printer         +visualextra
-conceal         +libcall         -profile         +viminfo
+cryptv          +linebreak       +python/dyn      +vreplace
+cscope          +lispindent      -python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             -rightleft       +writebackup
+diff            +menu            +ruby/dyn        -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xpm
-emacs_tags      -mouseshape      +startuptime     -xsmp
+eval            -mouse_dec       +statusline      -xterm_clipboard
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax
-farsi           -mouse_netterm   +tag_binary
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework Cocoa

Output of YcmDebugInfo

Printing YouCompleteMe debug information...
-- Client logfile: /var/folders/_j/kqfq2jbs3g75s04gzvylk5lc0000gp/T/ycm_GxZ2IP.log
-- Server errored, no debug info from server
-- Server running at: http://127.0.0.1:55082
-- Server process ID: 39977
-- Server logfiles:
--   /var/folders/_j/kqfq2jbs3g75s04gzvylk5lc0000gp/T/ycmd_55082_stdout_6O1SSS.log
--   /var/folders/_j/kqfq2jbs3g75s04gzvylk5lc0000gp/T/ycmd_55082_stderr_ty4e7w.log

Contents of YCM, ycmd and completion engine logfiles

Content of Client logfile:

cat /var/folders/_j/kqfq2jbs3g75s04gzvylk5lc0000gp/T/ycm_GxZ2IP.log
\2018-02-02 05:39:09,126 - ERROR - Unable to connect to server
Traceback (most recent call last):
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 223, in HandleServerException
    yield
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 236, in CheckIfServerIsReady
    'ready' )
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 69, in GetDataFromHandler
    timeout ) )
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 189, in JsonFromFuture
    response = future.result()
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 404, in result
    return self.__get_result()
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
ConnectTimeout: HTTPConnectionPool(host='127.0.0.1', port=55082): Max retries exceeded with url: /ready (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.HTTPConnection object at 0x1013d6e50>, 'Connection to 127.0.0.1 timed out. (connect timeout=0.01)'))
2018-02-02 05:39:09,239 - ERROR - Unable to connect to server
Traceback (most recent call last):
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 223, in HandleServerException
    yield
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 236, in CheckIfServerIsReady
    'ready' )
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 69, in GetDataFromHandler
    timeout ) )
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 189, in JsonFromFuture
    response = future.result()
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 404, in result
    return self.__get_result()
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
ConnectTimeout: HTTPConnectionPool(host='127.0.0.1', port=55082): Max retries exceeded with url: /ready (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.HTTPConnection object at 0x1013d6890>, 'Connection to 127.0.0.1 timed out. (connect timeout=0.01)'))
2018-02-02 05:39:09,344 - ERROR - The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). Unexpected exit code -6. Type ':YcmToggleLogs ycmd_55082_stderr_ty4e7w.log' to check the logs.
2018-02-02 05:39:19,226 - ERROR - Unable to connect to server
Traceback (most recent call last):
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 223, in HandleServerException
    yield
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/debug_info_request.py", line 41, in Start
    self._response = self.PostDataToHandler( request_data, 'debug_info' )
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 79, in PostDataToHandler
    timeout ) )
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 189, in JsonFromFuture
    response = future.result()
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 404, in result
    return self.__get_result()
  File "/Users/joaoh82/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
ConnectTimeout: HTTPConnectionPool(host='127.0.0.1', port=55082): Max retries exceeded with url: /debug_info (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.HTTPConnection object at 0x10141a4d0>, 'Connection to 127.0.0.1 timed out. (connect timeout=0.01)'))

Both Server logsfiles are empty

Include link here to a gist containing the entire logfiles for ycm, ycmd
and any completer logfiles listed by :YcmToggleLogs.

OS version, distribution, etc.

Mac OS 10.13 (17A405) High SIerra

Include system information here.

Output of build/install commands

Include link to a gist containing the invocation and entire output of
install.py if reporting an installation issue.

joaoh82 picture joaoh82  ·  2 Feb 2018

Most helpful comment

14

I had the same issue.

Running /usr/bin/python install.py within ~/.vim/plugged/YouCompleteMe did the trick.

jabalazs picture jabalazs  ·  19 Apr 2018

All comments

5

I got it/
I anaconda installed before setting up Vim and installing all my plugins.
So YouCompleteMe was using Anaconda’s python to compile Ycm Core.
But without error… even so, Ycm was crashing every time Vim opened.
So I had to disable Anaconda’s python’s for a moment and run the setup again.

Worked!

joaoh82 picture joaoh82  ·  3 Feb 2018
0

@joaoh82 I have the same issue, but I can't get it work. Do you just recompile the YCM core use anaconda python and get it work?

tgzhou98 picture tgzhou98  ·  19 Mar 2018
14

I had the same issue.

Running /usr/bin/python install.py within ~/.vim/plugged/YouCompleteMe did the trick.

jabalazs picture jabalazs  ·  19 Apr 2018
0

I was getting this error since I didn't have some dependencies installed globally such as nose and Flake8. I was able to discover which dependencies I was missing by running ~/.vim/plugged/YouCompleteMe/run_tests.py

likeshumidity picture likeshumidity  ·  2 May 2018
0

None of those dependencies are required unless you want to run the tests.

puremourning picture puremourning  ·  2 May 2018
0

@jabalazs save my day

shinux picture shinux  ·  18 May 2018
0

Thanks for the fix, @jabalazs.
@valloric @puremourning - does this mean that YCM cannot be compiled with an Anaconda Python installation? Why does it need the system python to run the server?

Thanks again!

jaidevd picture jaidevd  ·  29 Oct 2018
0

does this mean that YCM cannot be compiled with an Anaconda Python installation?

Sometimes. Anaconda comes with its own bundle of joy shared objects/dll files. Sometimes the versions of libraries you get in Anaconda are too old to support the latest libclang on which YCM's server depends on. Other times it's a boost bug and a user really wanted to use --system-boost. Therefore, anaconda simply breaks itself and we just can't support it.

Why does it need the system python to run the server?

It doesn't. virtualenv works perfectly, as does any custom built python I've ever compiled. It's just that

anaconda simply breaks itself

bstaletic picture bstaletic  ·  29 Oct 2018
0

Thanks for the clarification @bstaletic - makes sense.
I guess it's easiest to build YCM as usual and then switch the Python interpreter as described here: https://github.com/Valloric/YouCompleteMe#configuring-through-vim-options

jaidevd picture jaidevd  ·  29 Oct 2018
0

Note that the interpreter used for running the server is completely separate from the interpreter used for your project's completion.

bstaletic picture bstaletic  ·  29 Oct 2018
1

@jabalazs Anaconda's python was causing the issue for me as well, thank you.

jacksonlanecole picture jacksonlanecole  ·  26 Nov 2018
0

Running /usr/bin/python install.py does not work for me. Still having that problem.

wty20060888 picture wty20060888  ·  6 Sep 2019
0

@wty20060888 We'll need more information. Go to the gitter channel instead.

bstaletic picture bstaletic  ·  6 Sep 2019