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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError('Cannot add child handler, the child watcher does not have a loop attached',)> #761

Closed
markers16123 opened this issue May 16, 2018 · 3 comments

Comments

@markers16123
Copy link

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

Erase and reinstall the mac, and then try to init deoplete.vim by using a minimal init.vim, but it is not working.

Expected

Environment Information

  • deoplete version(SHA1):
* [master] Fix #754 async problem
 ! [origin/HEAD] Fix #754 async problem
  ! [origin/master] Fix #754 async problem
---
*++ [master] Fix #754 async problem
  • OS:
ProductName:    Mac OS X
ProductVersion: 10.13.4
BuildVersion:   17E202
  • neovim/Vim :version output:
NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/build/config -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/build/src/nvim/auto -I/tmp/neovim-20180209-92407-udkzoo/neovim-0.2.2/build/include
Compiled by [email protected]

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.2.2_1/share/nvim"

Run :checkhealth for more info
  • :checkhealth or :CheckHealth result(neovim only):

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $XTERM_VERSION=''
  - INFO: $VTE_VERSION=''
  - INFO: $COLORTERM=''
  - INFO: $SSH_TTY=''

## tmux
  - OK: escape-time: 10ms
  - INFO: $TERM: screen-256color

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - INFO: Using: g:python_host_prog = "/usr/local/bin/python"
  - INFO: Executable: /usr/local/bin/python
  - INFO: Python2 version: 2.7.15
  - INFO: python-neovim version: 0.2.6
  - OK: Latest python-neovim is installed: 0.2.6

## Python 3 provider (optional)
  - INFO: Using: g:python3_host_prog = "/usr/local/bin/python3"
  - INFO: Executable: /usr/local/bin/python3
  - INFO: Python3 version: 3.6.5
  - INFO: python3-neovim version: 0.2.6
  - OK: Latest python3-neovim is installed: 0.2.6

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
  - INFO: Host: /usr/local/bin/neovim-ruby-host
  - OK: Latest "neovim" gem is installed: 0.7.1

## Node provider (optional)
  - INFO: Node: v10.1.0
  - INFO: Host: /usr/local/bin/neovim-node-host
  - OK: Latest "neovim" npm is installed: 4.0.1

health#deoplete#check
========================================================================
## deoplete.nvim
  - OK: has("nvim") was successful
  - OK: exists("v:t_list") was successful
  - OK: has("timers") was successful
  - OK: has("python3") was successful
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github


Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"                              minimal init.vim                              "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

set runtimepath+=~/.config/nvim/plugged/deoplete.nvim
let g:deoplete#enable_at_startup = 1

filetype plugin indent on
syntax enable

"----------------------------------------------------------
" Neovim's Python provider
"----------------------------------------------------------
let g:python_host_prog  = '/usr/local/bin/python'
let g:python3_host_prog = '/usr/local/bin/python3'

" Clipbord
set clipboard+=unnamedplus  " use clipboard ( see : help clipboard )

" Mouse ( see :help mouse-using )
set mouse=nvic

The reproduce ways from neovim/Vim starting (Required!)

  1. foo
  2. bar
  3. baz

Generate a logfile if appropriate

  1. export NVIM_PYTHON_LOG_FILE=/tmp/log
  2. export NVIM_PYTHON_LOG_LEVEL=DEBUG
  3. nvim -u minimal.vimrc
  4. some works
  5. cat /tmp/log_{PID}

Screen shot (if possible)

Upload the log file

log_py3_rplugin

@callmekohei
Copy link
Contributor

callmekohei commented May 16, 2018

Hello! @markers16123

Please check again following.

comfirm version

// Python3 version
$ ls -al $(which python3)
lrwxr-xr-x  1 callmekohei  admin  34  4  1 01:21 /usr/local/bin/python3 -> ../Cellar/python/3.6.5/bin/python3

$ python3 --version
Python 3.6.5

// neovim version
$ nvim --version
NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5

// Python client version
$ pip3 show neovim
Name: neovim
Version: 0.2.6
Summary: Python client to neovim
Home-page: http://github.com/neovim/python-client
Author: Thiago de Arruda
Author-email: [email protected]
License: Apache
Location: /usr/local/lib/python3.6/site-packages
Requires: greenlet, msgpack
Required-by: 

$ pip3 list | grep -e greenlet -e msgpack
greenlet        0.4.13 
msgpack         0.5.6  
msgpack-python  0.4.8 

// deoplete.nvim version
deoplete.nvim [master]$ git log --oneline | head -n 1
26334d3 Fix #754 async problem

create minimal.vim

" set path ( fit your path )
set runtimepath+=${XDG_CONFIG_HOME}/nvim/dein/repos/github.com/Shougo/deoplete.nvim

" setting of deoplete
let g:deoplete#enable_at_startup = 1

" turn on plugins
set nocompatible
filetype plugin indent on
syntax enable

" Neovim's Python provider
let g:python_host_prog  = '/usr/local/bin/python'
let g:python3_host_prog = '/usr/local/bin/python3'

launch Neovim

$ nvim -N -u minimal.vim

UpdateRemotePlugins

:UpdateRemotePlugins

check deoplete

foo
bar
baz

fo // popup here
   //   foo [~] A
   //   fo  [~] A

screen shot 2018-05-16 at 20 54 49

@Shougo
Copy link
Owner

Shougo commented May 16, 2018

neovim/pynvim#324
neovim/pynvim#326

I cannot reproduce it though.
Have you tried the minimal vimrc?

Workaround:

       call deoplete#custom#option('num_processes', 1)

@dylan-chong
Copy link

dylan-chong commented Sep 26, 2018

I am encountering the same problem as in the original post. Your workaround seems to fix the problem which is good.

This is the error on the log file by the way

2018-09-26 20:43:25,723 [ERROR @ base_events.py:default_exception_handler:1591] 27653 - Task exception was never retrieved
future: <Task finished coro=<BaseEventLoop.subprocess_exec() done, defined at /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py:1491> exception=RuntimeError('Cannot add child handler, the child watcher does not have a loop attached')>
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 1516, in subprocess_exec
    bufsize, **kwargs)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 193, in _make_subprocess_transport
    self._child_watcher_callback, transp)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 924, in add_child_handler
    "Cannot add child handler, "
RuntimeError: Cannot add child handler, the child watcher does not have a loop attached
2018-09-26 20:43:25,725 [ERROR @ base_events.py:default_exception_handler:1591] 27653 - Task exception was never retrieved
future: <Task finished coro=<BaseEventLoop.subprocess_exec() done, defined at /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py:1491> exception=RuntimeError('Cannot add child handler, the child watcher does not have a loop attached')>
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 1516, in subprocess_exec
    bufsize, **kwargs)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 193, in _make_subprocess_transport
    self._child_watcher_callback, transp)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 924, in add_child_handler
    "Cannot add child handler, "
RuntimeError: Cannot add child handler, the child watcher does not have a loop attached
2018-09-26 20:43:25,725 [ERROR @ base_events.py:default_exception_handler:1591] 27653 - Task exception was never retrieved
future: <Task finished coro=<BaseEventLoop.subprocess_exec() done, defined at /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py:1491> exception=RuntimeError('Cannot add child handler, the child watcher does not have a loop attached')>
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 1516, in subprocess_exec
    bufsize, **kwargs)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 193, in _make_subprocess_transport
    self._child_watcher_callback, transp)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 924, in add_child_handler
    "Cannot add child handler, "
RuntimeError: Cannot add child handler, the child watcher does not have a loop attached
2018-09-26 20:43:25,726 [ERROR @ base_events.py:default_exception_handler:1591] 27653 - Task exception was never retrieved
future: <Task finished coro=<BaseEventLoop.subprocess_exec() done, defined at /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py:1491> exception=RuntimeError('Cannot add child handler, the child watcher does not have a loop attached')>
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 1516, in subprocess_exec
    bufsize, **kwargs)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 193, in _make_subprocess_transport
    self._child_watcher_callback, transp)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 924, in add_child_handler
    "Cannot add child handler, "
RuntimeError: Cannot add child handler, the child watcher does not have a loop attached

I will let you know @Shougo if I can think of the reason for not being able to reproduces problem on your system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants