kevinhwang91 / rnvimr

Make Ranger running in a floating window to communicate with Neovim via RPC
BSD 3-Clause "New" or "Revised" License
812 stars 17 forks source link

checkhealh: Error invoking 'echo' on channel XX #32

Closed XiaowenHu96 closed 4 years ago

XiaowenHu96 commented 4 years ago

The plugin worked fine before but today I ran into some trouble, from the error message there is something going worng in rpc related function.

  1. Minimum Init.vim
    
    call plug#begin('~/.config/nvim/autoload/plugged')

Plug 'kevinhwang91/rnvimr', {'do': 'make sync'}

call plug#end()


2. nvim --version

NVIM v0.4.3 Build type: Release LuaJIT 2.0.5 Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.4.3/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include Compiled by builduser

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

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info


3. Reproduce and behaviour.
    1. Startup neovim with `nvim -u minimum.vim`
    2. Run `:RnvimrToggle`,  rnvimr pops up fine.
    3. Cannot use `q`, `<C-t>`, or `<CR>` to communicate with rnvimr (Browsing between dirs was fine).

4. checkhealth output:

health#rnvimr#check

I'm pretty sure it may not be relevant with the plugin itself since it worked fine a few days ago. I may mess up something by myself, however, I don't have much experience with rpc and would appreciate any hint on how to fix this issue.

kevinhwang91 commented 4 years ago

I can't reproduce this issue. What's error msg when you use rnvimr normally.

Please give me these info what the checkhealth actually does: OS: Ranger info: ranger --version Pynvim info: nvim +'checkhealth provider' and paste the info about Pynvim.

Fjeldsoe1 commented 4 years ago

I ran into a similar problem today(not entirely the same, the checkhealth fails on different lines). I'm running macOS Catalina 10.15.4

  1. Minimum Init.vim
    
    call plug#begin('~/.config/nvim/autoload/plugged')

Plug 'kevinhwang91/rnvimr', {'do': 'make sync'}

call plug#end()


2. Nvim version 

NVIM v0.4.3 Build type: Release LuaJIT 2.0.5 Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/build/config -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/src -I/usr/local/include -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/deps-build/include -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/build/src/nvim/auto -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/build/include Compiled by brew@Catalina.local

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

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

Run :checkhealth for more info


3. Reproduce and behavior.
I'm not sure how to describe how to reproduce it, I just get an error when running `:checkhealth`

4. The checkhealth output:

health#rnvimr#check

  1. Ranger info:

    ranger version: ranger 1.9.3
    Python version: 3.8.2 (default, Mar 11 2020, 00:29:50) [Clang 11.0.0 (clang-1100.0.33.17)]
    Locale: None.UTF-8
  2. Pynvim info:

    ## Python 3 provider (optional)
    - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
    - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
    - INFO: Executable: /usr/local/opt/python@3.8/bin/python3
    - INFO: Other python executable: /usr/local/bin/python3
    - INFO: Other python executable: /usr/bin/python3
    - INFO: Python version: 3.8.2
    - INFO: pynvim version: 0.4.1
    - OK: Latest pynvim is installed.
kevinhwang91 commented 4 years ago

I ran into a similar problem today. Im running MacOS catalina 10.15.4

  1. Minimum Init.vim
call plug#begin('~/.config/nvim/autoload/plugged')

Plug 'kevinhwang91/rnvimr', {'do': 'make sync'}

call plug#end()
  1. Nvim version
NVIM v0.4.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/build/config -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/src -I/usr/local/include -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/deps-build/include -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/build/src/nvim/auto -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/build/include
Compiled by brew@Catalina.local

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

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

Run :checkhealth for more info
  1. Reproduce and behaviour. I'm not sure how to describe how to reproduce it I just get an error when running :checkhealth
  2. The checkhealth output:
health#rnvimr#check
========================================================================
  - ERROR: Failed to run healthcheck for "rnvimr" plugin. Exception:
    function health#check[21]..health#rnvimr#check[5]..<SNR>158_check_rpc, line 34
    Vim(call):E900: Invalid channel id
  1. Ranger info:
ranger version: ranger 1.9.3
Python version: 3.8.2 (default, Mar 11 2020, 00:29:50) [Clang 11.0.0 (clang-1100.0.33.17)]
Locale: None.UTF-8
  1. Pynvim info:
## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: /usr/local/opt/python@3.8/bin/python3
  - INFO: Other python executable: /usr/local/bin/python3
  - INFO: Other python executable: /usr/bin/python3
  - INFO: Python version: 3.8.2
  - INFO: pynvim version: 0.4.1
  - OK: Latest pynvim is installed.

Thanks for your info. What's error msg when you open rnvimr? Press 'W'` in Ranger and post the log, please.

Fjeldsoe1 commented 4 years ago

The Log:

Message Log:
16:51:55 INFO ranger version: ranger 1.9.3
16:51:55 INFO Python version: 3.8.2 (default, Mar 11 2020, 00:29:50) [Clang 11.0.0 (clang-1100.0.33.17)]
16:51:55 INFO Locale: None.UTF-8
16:51:55 INFO Process ID: 37662
16:51:55 ERRO Notification: Invalid linemode: devicons; should be filename/metatitle/permissions/fileinfo/mtime/sizemtime/humanreadablemtime/sizehumanreadablemtime
kevinhwang91 commented 4 years ago

It seems that this is caused by https://github.com/alexanderjeurissen/ranger_devicons which updates recently. You should work run make install rather than make sync. I will solve this issue as soon as possible.

Fjeldsoe1 commented 4 years ago

Thank you! All the checkhealth works now after I looked into the devicons

health#rnvimr#check
========================================================================
## OS
  - OK: Name: Mac

## Ranger
  - OK: Version: ranger 1.9.3

## Python
  - OK: Version: 3.8.2 (default, Mar 11 2020, 00:29:50) [Clang 11.0.0 (clang-1100.0.33.17)]

## Pynvim
  - OK: Version: 0.4.1

## Ueberzug (optional)
  - INFO: Ueberzug is not support for Mac

## RPC
  - OK: Install lib for checkhealth successfully
  - OK: RPC echo: Neovim send "Give me five!" and receive "Give me five!"
  - OK: Clean lib for checkhealth successfully
kevinhwang91 commented 4 years ago

I don't know how to reproduce this issue, although I update the latest version of devicons.

It only produces an issue about running ranger without icons in nvim.

kevinhwang91 commented 4 years ago

@XiaowenHu96 The easiest way is to reinstall rnvimr, I think all are going well.

XiaowenHu96 commented 4 years ago

@XiaowenHu96 The easiest way is to reinstall rnvimr, I think all are going well.

Sorry, I'm very busy recently. Will give you an update once I have a chance to test it.

XiaowenHu96 commented 4 years ago

@kevinhwang91 Hi here is the info, hopes that help.

  1. Pynvim

    ## Python 3 provider (optional)
    - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
    - INFO: Executable: /usr/bin/python3
    - INFO: Python version: 3.8.2
    - INFO: pynvim version: 0.4.1
    - OK: Latest pynvim is installed.
  2. Ranger --version

    ranger version: ranger-master
    Python version: 3.8.2 (default, Apr  8 2020, 14:31:25) [GCC 9.3.0]
    Locale: en_US.UTF-8
  3. cat /etc/os-release

    NAME="Manjaro Linux"
    ID=manjaro
    ID_LIKE=arch
    PRETTY_NAME="Manjaro Linux"
    ANSI_COLOR="1;32"
    HOME_URL="https://www.manjaro.org/"
    SUPPORT_URL="https://www.manjaro.org/"
    BUG_REPORT_URL="https://bugs.manjaro.org/"
    LOGO=manjarolinux
  4. W in ranger:

    Message Log:
    17:34:00 INFO ranger version: ranger-master
    17:34:00 INFO Python version: 3.8.2 (default, Apr  8 2020, 14:31:25) [GCC 9.3.0]
    17:34:00 INFO Locale: en_US.UTF-8
    17:34:00 INFO Process ID: 459366

I also want to mention, after reinstalling rnvimr, it crashes as soon as I toggle it on. I couldn't copy the error message in the floating window, here is a screenshot. Looks like it is a crash in ranger.

image

Also, :checkhealth from my neovim has no information about RPC, is that expected?

XiaowenHu96 commented 4 years ago

I also tried ranger-git from AUR, didn't help.

kevinhwang91 commented 4 years ago

It relates to Python or Pynvim rather than Ranger. From the log image, I know Ranger crashes due to code about Pynvim. Ranger doesn't use asyncio package but Pynvim does.

I was used Manjaro before, why I migrate from Manjaro to ArchLinux?

Because the repo in Manjaro is different from ArchLinux, Manjaro will change the package a lot, including Ranger. I suggest you install requirements by pip instead of pacman in Manjaro.

Please run checkhealth again, I have updated the code, maybe it can provide some clues.

XiaowenHu96 commented 4 years ago

I have installed Ranger through pip and updated rnvimr.

health#rnvimr#check
========================================================================
  - ERROR: Failed to run healthcheck for "rnvimr" plugin. Exception:
    function health#check[21]..health#rnvimr#check[5]..<SNR>117_check_rpc, line 34
    Vim(call):E900: Invalid channel id
kevinhwang91 commented 4 years ago

Sorry for my silly mistake, I haven't merged the code just now. Please try again.

btw, pip install Pynvim.

XiaowenHu96 commented 4 years ago

No worries. Here is the new log


health#rnvimr#check
========================================================================
## OS
  - OK: Name: Linux

## Ranger
  - OK: Version: ranger 1.9.3

## Python
  - OK: Version: 3.8.2 (default, Apr  8 2020, 14:31:25) [GCC 9.3.0]

## Pynvim
  - OK: Version: 0.4.1

## Ueberzug (optional)
  - OK: Ueberzug is ready

## RPC
  - OK: Install lib for checkhealth successfully
  - ERROR: RPC: timeout 3s
  - ERROR: Vim(call):E900: Invalid channel id
  - OK: Clean lib for checkhealth successfully
kevinhwang91 commented 4 years ago

Follow these steps to make sure that rpc work fine:

  1. Open shell 1, run nvim --listen /tmp/abcd;
  2. Run ex command in Neovim :echo $NVIM_LISTEN_ADDRESS make sure that output /tmp/abcd;
  3. Open shell 2, run this py snippet:
    #!/usr/bin/env python3
    import pynvim
    socket_path = '/tmp/abcd'
    nvim = pynvim.attach('socket', path=socket_path)
    nvim.command('echom "hello"')
  4. Check Neovim out whether output hello.
  5. Run Neovim normally and :echo $NVIM_LISTEN_ADDRESS, it will output msg look like this format /tmp/nvimIYj484/0
XiaowenHu96 commented 4 years ago

@kevinhwang91 Many thanks, problem solved. I modified the environment variable $NVIM_LISTEN_ADDRESS when using nvr with another plugin. Reset it and everything works fine now.