GkeepLogin error
Describe the bug
This seems very similar to #4 but has a slightly different stack trace and also cause - so opening a new issue.
I am unable to logon as :GkeepLogin [email protected] throws this stack trace. Keyring appears to be working alright.
Error detected while processing function remote#define#CommandBootstrap[5]..remote#define#request:
line 2:
Error invoking '/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep:command:GkeepLogin' on channel 3 (python3-rplugin-host):
error caught in request handler '/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep:command:GkeepLogin [['[email protected]']]':
Traceback (most recent call last):
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/plugin.py", line 81, in w
f(self, *args, **kwargs)
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/plugin.py", line 47, in d
return f(self, *args[0])
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/plugin.py", line 661, in cmd_login
return prompt(
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/modal/prompt.py", line 42, in show
bufnr = self._create_buffer()
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/modal/prompt.py", line 17, in _create_buffer
bufnr.options["buftype"] = "prompt"
File "/usr/lib/python3/dist-packages/pynvim/api/common.py", line 116, in __setitem__
self._set(key, value)
File "/usr/lib/python3/dist-packages/pynvim/api/common.py", line 58, in request
return self._session.request(name, self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request
res = self._session.request(name, *args, **kwargs)
File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request
raise self.error_wrapper(err)
pynvim.api.common.NvimError: E474: Invalid argument
A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Go to 'nvim'
- Run command ':GkeepLogin [email protected]'
- See error above
Expected behavior I believe I should be prompted for password/API keys next but I am unable to progress pass this first step.
Version information
- OS:
Running a debian minimal VM inside parallels on a Mac.
$ uname -a
Linux freya 5.10.0-16-arm64 #1 SMP Debian 5.10.127-1 (2022-06-30) aarch64 GNU/Linux
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
- Neovim:
NVIM v0.4.4
Build type: Release
Lua 5.1
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-AMNr6D/neovim-0.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -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 -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-AMNr6D/neovim-0.4.4/build/config -I/build/neovim-AMNr6D/neovim-0.4.4/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-AMNr6D/neovim-0.4.4/build/src/nvim/auto -I/build/neovim-AMNr6D/neovim-0.4.4/build/include
Compiled by [email protected]
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
- Gkeep:
health#gkeep#check
========================================================================
## gkeep
- OK: gkeepapi 0.14.2 installed
- OK: gpsoauth 1.0.2 installed
- OK: keyring installed
- WARNING: Not logged in
- ADVICE:
- Try :GkeepLogin
- INFO: Log file: /home/unop/.cache/nvim/gkeep.log
Additional context
This is a fresh install of neovim installed from the debian repos via sudo apt install neovim
pip install keyrings.alt in place. Without this :checkhealth gkeep complains about
- ERROR: Error with keyring provider: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.
All vim directories have been moved out of the way i.e. mv ~/.vim ~/.vim.bak; mv ~/.vimrc ~/.vimrc.bak.
It seems the keyring may be working as expected.. or at least the test suggested in #4 doesn't throw any errors.
$ python3 -c 'import keyring; a=keyring.get_password("google-keep-token", "foobar"); print(a)'
None
$ cat ~/.cache/nvim/gkeep.json
{"email": "[email protected]", "saved_searches": []}
Screenshots If applicable, add screenshots to help explain your problem.
Looks like the error happens when setting buftype = "prompt". You're using Neovim v0.4.4, but the minimum required version is 0.5. Could you upgrade and see if that fixes it?
Thanks @stevearc for the quick reply. So yes, that covered it - I upgraded and got past that first issue ..
But it seems like i've bumped into another .. this time a terminal problem opening/closing the prompt.
Error detected while processing function _gkeep_prompt_close[1]..remote#define#request:
line 2:
Error invoking '/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep:function:_gkeep_prompt_close' on channel 3 (python3-rplugin-host):
error caught in request handler '/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep:function:_gkeep_prompt_close [['rmihrkqdjzmbjjdy']]':
Traceback (most recent call last):
File "/usr/lib/python3.9/getpass.py", line 69, in unix_getpass
old = termios.tcgetattr(fd) # a copy to save
termios.error: (25, 'Inappropriate ioctl for device')
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/plugin.py", line 47, in d
return f(self, *args[0])
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/plugin.py", line 81, in w
f(self, *args, **kwargs)
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/plugin.py", line 375, in close_prompt
self._modal.prompt.close(text)
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/modal/prompt.py", line 66, in close
callback(text)
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/plugin.py", line 81, in w
f(self, *args, **kwargs)
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/plugin.py", line 48, in d
return f(self, *args)
File "/home/unop/.local/share/nvim/site/pack/gkeep/start/gkeep.nvim/rplugin/python3/gkeep/plugin.py", line 693, in cmd_login
keyring.set_password("google-keep-token", email, token)
File "/usr/local/lib/python3.9/dist-packages/keyring/core.py", line 60, in set_password
get_keyring().set_password(service_name, username, password)
File "/usr/local/lib/python3.9/dist-packages/keyring/backends/chainer.py", line 58, in set_password
return keyring.set_password(service, username, password)
File "/usr/local/lib/python3.9/dist-packages/keyrings/alt/file_base.py", line 123, in set_password
password_encrypted = self.encrypt(password.encode('utf-8'), assoc)
File "/usr/local/lib/python3.9/dist-packages/keyrings/alt/file.py", line 199, in encrypt
cipher = self._create_cipher(self.keyring_key, salt, IV)
File "/usr/local/lib/python3.9/dist-packages/keyring/util/properties.py", line 57, in __get__
return self.fget(obj)
File "/usr/local/lib/python3.9/dist-packages/keyrings/alt/file.py", line 93, in keyring_key
self._init_file()
File "/usr/local/lib/python3.9/dist-packages/keyrings/alt/file.py", line 100, in _init_file
self.keyring_key = self._get_new_password()
File "/usr/local/lib/python3.9/dist-packages/keyrings/alt/file.py", line 55, in _get_new_password
password = getpass.getpass("Please set a password for your new keyring: ")
File "/usr/lib/python3.9/getpass.py", line 91, in unix_getpass
passwd = fallback_getpass(prompt, stream)
File "/usr/lib/python3.9/getpass.py", line 126, in fallback_getpass
return _raw_input(prompt, stream)
File "/usr/lib/python3.9/getpass.py", line 148, in _raw_input
raise EOFError
I've got nothing unusual here .. I'm running under tmux but the behaviour's the same outside with and without $TERM set.
$ echo $TERM
screen
$ echo $SHELL
bash
Looks like this is failing because the underlying keyring library is trying to set up the keyring (because it hasn't been set up yet) and it fails because it's not in an interactive context. I'll see if I can come up with a graceful way to handle that
I've put in a fix. Let me know if that does it for you
for me, absolutely nothing happens when I enter email or password to the prompt window. no error, no reaction