【问题标题】:Why does my YCM Server shut down?为什么我的 YCM 服务器会关闭?
【发布时间】:2018-06-06 01:24:55
【问题描述】:

每当我打开 vim 时,我都会收到 Ycm 服务器已关闭且退出代码为 -6 的消息。日志文件包含以下信息:

2017-12-23 21:25:50,550 - ERROR - Unable to connect to server
Traceback (most recent call last):
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 217, in HandleServerException
    yield
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 237, in CheckIfServerIsReady
    'ready' )
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 68, in GetDataFromHandler
    timeout ) )
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 183, in JsonFromFuture
    response = future.result()
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 404, in result
    return self.__get_result()
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=54499): Max retries exceeded with url: /ready (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x10b7cbd50>: Failed to establish a new connection: [Errno 61] Connection refused',))
2017-12-23 21:25:50,655 - ERROR - The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). Unexpected exit code -6. Type ':YcmToggleLogs ycmd_54499_stderr_MqYNI6.log' to check the logs.
2017-12-23 21:26:05,494 - ERROR - Unable to connect to server
Traceback (most recent call last):
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 217, in HandleServerException
    yield
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/shutdown_request.py", line 37, in Start
    self.PostDataToHandler( {}, 'shutdown', TIMEOUT_SECONDS )
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 78, in PostDataToHandler
    timeout ) )
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 183, in JsonFromFuture
    response = future.result()
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 404, in result
    return self.__get_result()
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=54499): Max retries exceeded with url: /shutdown (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x10b80d2d0>: Failed to establish a new connection: [Errno 61] Connection refused',))
2017-12-23 21:26:05,618 - ERROR - Unable to connect to server
Traceback (most recent call last):
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 217, in HandleServerException
    yield
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 237, in CheckIfServerIsReady
    'ready' )
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 68, in GetDataFromHandler
    timeout ) )
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 183, in JsonFromFuture
    response = future.result()
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 404, in result
    return self.__get_result()
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=54502): Max retries exceeded with url: /ready (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x10b80d650>: Failed to establish a new connection: [Errno 61] Connection refused',))
2017-12-23 21:26:05,721 - ERROR - The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). Unexpected exit code -6. Type ':YcmToggleLogs ycmd_54502_stderr_fNX8sk.log' to check the logs.
2017-12-23 21:26:14,523 - ERROR - Unable to connect to server
Traceback (most recent call last):
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 217, in HandleServerException
    yield
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/debug_info_request.py", line 41, in Start
    self._response = self.PostDataToHandler( request_data, 'debug_info' )
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 78, in PostDataToHandler
    timeout ) )
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 183, in JsonFromFuture
    response = future.result()
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 404, in result
    return self.__get_result()
  File "/Users/abhisheknaik/.vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=54502): Max retries exceeded with url: /debug_info (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x10b80da10>: Failed to establish a new connection: [Errno 61] Connection refused',))

有人可以指出为什么连接丢失了吗?当服务器再次关闭时,运行 YcmRestartServer 并没有帮助。

非常感谢任何帮助。谢谢!

【问题讨论】:

  • let g:ycm_server_keep_logfiles = 1 let g:ycm_server_log_level = 'debug' 放到你的 .vimrc 中。使用:YcmDebugInfo 查看日志的保存位置并阅读它们。如果解决方案不明显,请发布输出。
  • @Qwertycrackers,这就是我在上面所做的。遵循您提到的确切步骤后,我得到了日志详细信息(上面发布)。
  • 哎呀,没有像我应该的那样仔细阅读。我在任何地方都找不到这个确切的错误,但我不禁怀疑它可能源于 ycmd 服务器没有正确的libclang。您能否检查您正在使用的(可能是系统)的版本是否高于 3.2?
  • 看起来this 家伙也遇到了类似的问题,但似乎没有更多信息。

标签: vim plugins vi macvim youcompleteme


【解决方案1】:

您可以尝试更新 YouCompleteMe。如果使用 vim-plug:

:PlugUpdate YouCompleteMe

它对我有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-04-26
    • 1970-01-01
    • 2016-08-22
    • 2019-09-01
    • 2021-04-12
    • 1970-01-01
    • 2012-12-01
    • 1970-01-01
    相关资源
    最近更新 更多