-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Troubleshooting steps for ycmd server SHUT DOWN
This page is for anyone getting the following or similar variant on Vim startup
The ycmd server SHUT DOWN (restart with :YcmRestartServer). Unexpected exit code 1. Type ':YcmToggleLogs ycmd_57346_stderr_2hrqlh43.log' to check the logs.
Usually, after you check the log file it points to, you find it's empty. Sometimes the exit code is different, but basically you followed the install guide correctly, but something isn't working.
You might have googled the error and found responses from many years ago that are all not relevant. Ignore them!
This means that we were not able to start the ycmd server. It's usually trivial to fix.
First, if you used the "full" installation guide, then we recommend using
install.py
for almost all use-cases. If you needed to build libclang from
source, then, we still recommend using install.py
:
$ EXTRA_CMAKE_ARGS='-DPATH_TO_LLVM_ROOT=/path/to/your/llvm' ./install.py
--system-libclang ...
If you need to get through a corporate proxy, that's possible too: here's an example
The best way to validate installation is to do this:
$ cd /path/to/YouCompleteMe/third_party/ycmd/
$ cat PYTHON_USED_DURING_BUILDING
/some/path/to/python3
$ /some/path/to/python3 ycmd
<output>
If this appears to work, then you probably have
g:ycm_server_python_interpreter
set, remove that from your vimrc
and retry.
Otherwise, check <output>
, it should say something about why it wasn't
possible to start up ycmd.
Common errors include:
Error like | Possible Cause | Solution |
---|---|---|
cannot find module .... |
Not updating the submodules | git submodule update --init --recursive |
segmantation fault |
Use of anaconda | don't use anaconda when building ycmd |
cannot find module ... , segmentation fault , etc. |
Not having rebuilt (or built) ycm | e.g. python3 install.py --all . See README
|
No error | Using the wrong python to run ycmd | don't set g:ycm_server_python_interpreter , let YCM work it out |
Others | An incompatible or broken python environment | Fix your python environment |
cannot find symbol ....so |
Running an OS that's not compatible with pre-built libclang or clangd (e.g. RHEL 6, Ubuntu 14.04) | Build clangd or libclang from source |
Finally, in vim, check :filter youcompleteme scriptnames
. Ensure that you
only see entries for the correct locations:
/path/to/YCM/plugin/youcompleteme.vim
/path/to/YCM/autoload/youcompleteme.vim
Instructions in CONTRIBUTING.md
There are example projects that are used by our test cases in /path/to/YCM/third_party/ycmd/ycmd/tests/<language>/testdata
. Try to see if you get reasonable results when loading one of the test files in there, and using the minimal vimrc. This rules out your project and your vim config.