clojure-vim / async-clj-omni

Async Clojure Completion for various (n)vim completion engines
49 stars 7 forks source link

Deoplete not working #22

Open mn-dimension opened 5 years ago

mn-dimension commented 5 years ago

Hi

With everything setup correctly as in issue 20 I am getting deoplete crashing in the async_clj source with a socket error.

I have tried with cider version 0.17.0 and the latest beta resulting in the same problem.

I can send more details if you need.

Can you help please.

cheers

This is the stack trace

[deoplete] Traceback (most recent call last): File "/Users/user1/.cache/vim/dein/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete/child.py", line 182, in _gather_results result = self._get_result(context, source) File "/Users/user1/.cache/vim/dein/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete/child.py", line 241, in _get_result ctx['candidates'] = source.gather_candidates(ctx) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/async_clj.py", line 24, in gather_candidates return self.__cider_completion_manager.gather_candidates(context["complete_str"]) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/../../../../pythonx/async_clj_omni/fireplace.py", line 88, in gather_candidates wc = self.__connmanager.get_conn(conn_string) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/../../../../pythonx/async_clj_omni/fireplace.py", line 36, in get_conn conn = nrepl.connect(conn_string) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/__init__.py", line 129, in connect return f(uri) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/__init__.py", line 31, in _bencode_connect s = socket.create_connection(uri.netloc.split(":")) File "/Users/user1/.cache/pyenv/versions/3.7.2/lib/python3.7/socket.py", line 707, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "/Users/user1/.cache/pyenv/versions/3.7.2/lib/python3.7/socket.py", line 748, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 8] nodename nor servname provided, or not known Error from async_clj: [Errno 8] nodename nor servname provided, or not known. Use :messages / see above for error details. [deoplete] Traceback (most recent call last): File "/Users/user1/.cache/vim/dein/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete/child.py", line 182, in _gather_results result = self._get_result(context, source) File "/Users/user1/.cache/vim/dein/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete/child.py", line 241, in _get_result ctx['candidates'] = source.gather_candidates(ctx) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/async_clj.py", line 24, in gather_candidates return self.__cider_completion_manager.gather_candidates(context["complete_str"]) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/../../../../pythonx/async_clj_omni/fireplace.py", line 88, in gather_candidates wc = self.__connmanager.get_conn(conn_string) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/../../../../pythonx/async_clj_omni/fireplace.py", line 36, in get_conn conn = nrepl.connect(conn_string) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/__init__.py", line 129, in connect return f(uri) File "/Users/user1/.cache/vim/dein/repos/github.com/clojure-vim/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/__init__.py", line 31, in _bencode_connect s = socket.create_connection(uri.netloc.split(":")) File "/Users/user1/.cache/pyenv/versions/3.7.2/lib/python3.7/socket.py", line 707, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "/Users/user1/.cache/pyenv/versions/3.7.2/lib/python3.7/socket.py", line 748, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 8] nodename nor servname provided, or not known Error from async_clj: [Errno 8] nodename nor servname provided, or not known. Use :messages / see above for error details. [deoplete] Too many errors from "async_clj". This source is disabled until Neovim is restarted.

SevereOverfl0w commented 5 years ago

New version of fireplace is async, and it's use of sleep means that deoplete errors. I'm not sure how to fix.

rafaeldelboni commented 5 years ago

Having the exactly same problems, does anyone got this working?

SevereOverfl0w commented 5 years ago

Please try the ncm2, coc.nvim or asyncomplete adapters for now.

I think that to fix this, we will need to find out why Deoplete's timer is throwing an exception.

mn-dimension commented 5 years ago

I moved to https://github.com/Olical/conjure

-- The Continium

On 14 August 2019 at 07:46:16, Dominic Monroe (notifications@github.commailto:notifications@github.com) wrote:

Please try the ncm2, coc.nvim or asyncomplete adapters for now.

I think that to fix this, we will need to find out why Deoplete's timer is throwing an exception.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/clojure-vim/async-clj-omni/issues/22?email_source=notifications&email_token=AMMBOTYQUI5FWAY32WTSSY3QEOS3RA5CNFSM4IAPYXH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4H3KEY#issuecomment-521123091, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMMBOTZ6FISRP7CIGUUUGC3QEOS3RANCNFSM4IAPYXHQ.

campbellr commented 4 years ago

I ran into this same issue an it seems that somewhere along the line, the host and port keys for the fireplace client transport dictionary was replaced with a url.

The following change got me though the error above:

diff --git a/pythonx/async_clj_omni/fireplace.py b/pythonx/async_clj_omni/fireplace.py
index e2f823b..e91a160 100644
--- a/pythonx/async_clj_omni/fireplace.py
+++ b/pythonx/async_clj_omni/fireplace.py
@@ -80,10 +80,12 @@ class CiderCompletionManager:
             self.__logger.debug("Unable to get connection info")
             return []

-        host = transport.get("host")
-        port = transport.get("port")
-
-        conn_string = "nrepl://{}:{}".format(host, port)
+        if "url" in transport:
+            conn_string = transport["url"]
+        else:
+            host = transport.get("host")
+            port = transport.get("port")
+            conn_string = "nrepl://{}:{}".format(host, port)

         wc = self.__connmanager.get_conn(conn_string)

Only to run into another error that I haven't figured out yet:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/Users/ryancampbell/.local/share/nvim/plugged/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/__init__.py", line 63, in run
    for incoming in self._IO:
  File "/Users/ryancampbell/.local/share/nvim/plugged/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/bencode.py", line 170, in __next__
    v = self.read()
  File "/Users/ryancampbell/.local/share/nvim/plugged/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/bencode.py", line 157, in read
    return _read_datum(self._file)
  File "/Users/ryancampbell/.local/share/nvim/plugged/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/bencode.py", line 100, in _read_datum
    delim = _read_delimiter(s)
  File "/Users/ryancampbell/.local/share/nvim/plugged/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/bencode.py", line 70, in _read_delimiter
    d = _read_byte(s)
  File "/Users/ryancampbell/.local/share/nvim/plugged/async-clj-omni/rplugin/python3/deoplete/sources/vim_nrepl_python_client/nrepl/bencode.py", line 37, in _read_byte
    return s.read(1)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer
[deoplete] Traceback (most recent call last):
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 319, in _process_filter
    filtered = f.filter(context)
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/filter/converter_remove_overlap.py", line 28, in filter
    if self.vim.call('searchpair', '(', '', ')', 'bnw'):
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 299, in call
    return self.request('nvim_call_function', name, args, **kwargs)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 95, in request
    v = self._blocking_request(method, args)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 175, in _blocking_request
    self._enqueue_notification)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/async_session.py", line 66, in run
    self._msgpack_stream.run(self._on_message)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/msgpack_stream.py", line 43, in run
    self.loop.run(self._on_data)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/event_loop/base.py", line 144, in run
    self._run()
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/event_loop/asyncio.py", line 136, in _run
    self._loop.run_forever()
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 525, in run_forever
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
Errors from: <deoplete.filter.converter_remove_overlap.Filter object at 0x10676c710>.  Use :messages / see above for error details.
[deoplete] Traceback (most recent call last):
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 319, in _process_filter
    filtered = f.filter(context)
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/filter/converter_remove_overlap.py", line 28, in filter
    if self.vim.call('searchpair', '(', '', ')', 'bnw'):
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 299, in call
    return self.request('nvim_call_function', name, args, **kwargs)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 95, in request
    v = self._blocking_request(method, args)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 175, in _blocking_request
    self._enqueue_notification)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/async_session.py", line 66, in run
    self._msgpack_stream.run(self._on_message)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/msgpack_stream.py", line 43, in run
    self.loop.run(self._on_data)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/event_loop/base.py", line 144, in run
    self._run()
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/event_loop/asyncio.py", line 136, in _run
    self._loop.run_forever()
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 525, in run_forever
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/autoload/deoplete/_main.py", line 56, in main
    child.main_loop(stdout)
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 67, in main_loop
    ret = self.main(name, args, queue_id)
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 86, in main
    results = self._merge_results(args[0], queue_id)
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 162, in _merge_results
    result, context['input'], context['next_input'])
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 384, in _get_candidates
    self._process_filter(f, ctx, source.max_candidates)
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 325, in _process_filter
    error_tb(self._vim, 'Errors from: %s' % f)
  File "/Users/ryancampbell/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/util.py", line 101, in error_tb
    vim.err_write('[deoplete] %s\n' % '\n'.join(lines))
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 409, in err_write
    return self.request('nvim_err_write', msg, **kwargs)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 95, in request
    v = self._blocking_request(method, args)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 175, in _blocking_request
    self._enqueue_notification)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/async_session.py", line 66, in run
    self._msgpack_stream.run(self._on_message)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/msgpack_stream.py", line 43, in run
    self.loop.run(self._on_data)
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/event_loop/base.py", line 144, in run
    self._run()
  File "/Users/ryancampbell/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/event_loop/asyncio.py", line 136, in _run
    self._loop.run_forever()
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 525, in run_forever
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
Error in child: RuntimeError('This event loop is already running').  Use :messages / see above for error details.
SevereOverfl0w commented 4 years ago

The issue is a timer in deoplete which triggers when fireplace does it's async. That timer blows up. I decided it was too much to debug for me.