Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

YCMD not working for python script #7179

Closed
sixshotx opened this issue Sep 23, 2016 · 5 comments
Closed

YCMD not working for python script #7179

sixshotx opened this issue Sep 23, 2016 · 5 comments

Comments

@sixshotx
Copy link

Description :octocat:

YCMD Auto-completion not working for python

Reproduction guide 馃

  • Start Emacs
  • Enable YCMD in python-mode
  • auto completion is not working

Observed behaviour: 馃憖 馃挃
Connection refused reported from ycmd-server

System Info 馃捇

  • OS: gnu/linux
  • Emacs: 25.1.1
  • Spacemacs: 0.105.22
  • Spacemacs branch: develop (rev. 4c165ad)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: hybrid
  • Completion: helm
  • Layers:
(helm spell-checking syntax-checking
      (auto-completion :variables auto-completion-return-key-behavior 'complete auto-completion-tab-key-behavior 'cycle auto-completion-complete-with-key-sequence nil auto-completion-complete-with-key-sequence-delay 0.1 auto-completion-enable-snippets-in-popup t auto-completion-private-snippets-directory nil)
      better-defaults
      semantic
      (ycmd :variables ycmd-server-command
            '("python" "/home/sixshotx/Repo/git/ycmd/ycmd/")
            ycmd-force-semantic-completion nil))
  • YCMD user config:
(with-eval-after-load 'python
    (add-hook 'python-mode-hook 'ycmd-mode)
    (setq python-shell-interpreter "python3"))

ycmd-server log 馃惥

2016-09-23 16:04:02,795 - DEBUG - Global extra conf not loaded or no function YcmCorePreload
serving on http://127.0.0.1:35797
2016-09-23 16:04:02,809 - INFO - Received ready request
2016-09-23 16:04:02,810 - INFO - Starting JediHTTP server
2016-09-23 16:04:02,810 - INFO - using port 33695
2016-09-23 16:04:02,813 - DEBUG - Making JediHTTP request: POST b'http://127.0.0.1:33695/ready' {'x-jedihttp-hmac': b'SPp3bQuF0Y04ABwByTHryT461+zVlQVXBrBqfJE9qr0=', 'content-type': 'application/json'} b''
2016-09-23 16:04:02,816 - INFO - Starting new HTTP connection (1): 127.0.0.1
2016-09-23 16:04:02,816 - ERROR - HTTPConnectionPool(host='127.0.0.1', port=33695): Max retries exceeded with url: /ready (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7ff1902a9358>: Failed to establish a new connection: [Errno 111] Connection refused',))
Traceback (most recent call last):
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/packages/urllib3/connection.py", line 137, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py", line 91, in create_connection
    raise err
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py", line 81, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
    body=body, headers=headers)
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py", line 353, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/packages/urllib3/connection.py", line 162, in connect
    conn = self._new_conn()
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/packages/urllib3/connection.py", line 146, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7ff1902a9358>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/adapters.py", line 376, in send
    timeout=timeout
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py", line 609, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/packages/urllib3/util/retry.py", line 273, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=33695): Max retries exceeded with url: /ready (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7ff1902a9358>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sixshotx/Repo/git/ycmd/ycmd/../ycmd/completers/python/jedi_completer.py", line 105, in ServerIsHealthy
    return bool( self._GetResponse( '/ready' ) )
  File "/home/sixshotx/Repo/git/ycmd/ycmd/../ycmd/completers/python/jedi_completer.py", line 213, in _GetResponse
    headers = extra_headers )
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/api.py", line 53, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/sessions.py", line 468, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/home/sixshotx/Repo/git/ycmd/third_party/requests/requests/adapters.py", line 437, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=33695): Max retries exceeded with url: /ready (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7ff1902a9358>: Failed to establish a new connection: [Errno 111] Connection refused',))
2016-09-23 16:04:02,821 - INFO - Received event notification
2016-09-23 16:04:02,821 - DEBUG - Event name: BufferVisit
2016-09-23 16:04:02,822 - INFO - Received event notification
2016-09-23 16:04:02,822 - DEBUG - Event name: FileReadyToParse
2016-09-23 16:04:02,822 - INFO - Adding buffer identifiers for file: /home/sixshotx/tmp/python/x.py
2016-09-23 16:04:04,855 - INFO - Received event notification
2016-09-23 16:04:04,855 - DEBUG - Event name: FileReadyToParse
2016-09-23 16:04:04,855 - INFO - Adding buffer identifiers for file: /home/sixshotx/tmp/python/x.py
2016-09-23 16:04:16,839 - INFO - Received event notification
2016-09-23 16:04:16,839 - DEBUG - Event name: FileReadyToParse
2016-09-23 16:04:16,839 - INFO - Adding buffer identifiers for file: /home/sixshotx/tmp/python/x.py
@TheBB
Copy link
Collaborator

TheBB commented Sep 24, 2016

I see the same, but the error message indicates that ycmd can't connect to jedi. Did you report to ycmd?

@sixshotx
Copy link
Author

Not yet. I think the problem might be within either spacemacs or emacs-ycmd. I have no problem connecting jedi using vim-youcompleteme with the same ycmd engine though.

@TheBB
Copy link
Collaborator

TheBB commented Sep 25, 2016

Then did you try reproducing with just emacs-ycmd?

@deb0ch
Copy link
Contributor

deb0ch commented Sep 26, 2016

emacs-ycmd is a bit outdated sometimes, so it is possible that it is coming from there.

The example I am refering to is if you try to call ycmd-restart-semantic-server you get a "usage" error message, saying that the command is not supported:

REQUEST [error] Error (error) while connecting to http://127.0.0.1:44286/run_completer_command.
Supported commands are:
ClearCompilationFlagCache
FixIt
GetDoc
GetDocQuick
GetParent
GetType
GoTo
GoToDeclaration
GoToDefinition
GoToImprecise
GoToInclude
See the docs for information on what they do.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
@lebensterben lebensterben removed the stale marked as a stale issue/pr (usually by a bot) label Feb 4, 2022
@lebensterben lebensterben moved this from Answered, waiting to To close in Forum Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Forum
  
To close
Development

No branches or pull requests

4 participants