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

Unknown error logging in; please report an issue on github. API error: ('BadAuthentication', None) #9

Closed
stevearc opened this issue Feb 11, 2022 · 4 comments

Comments

@stevearc
Copy link
Owner

Reported on behalf of @srbhp. Copied into new issue from #3.

Describe the bug
I get this error

Unknown error logging in; please report an issue on github. API error: ('BadAuthentication', None)

But this Python script worked for me

import gkeepapi

keep = gkeepapi.Keep()
success = keep.login('userid@gmail.com', 'APP-Passward')
print("######    TO DO             ################################")
gnotes = keep.all()
for ig in gnotes:
    if ig.pinned:
        print(ig.title)
        print(ig.text)
print("############################################################")

:checkhealth gkeep
Gives me

## Python 3 provider (optional)
  - INFO: Using: g:python3_host_prog = "/usr/bin/python3.9"
  - INFO: Executable: /usr/bin/python3.9
  - INFO: Python version: 3.9.6
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

I suspect gkeep.nvim somehow picks up an older version of python.
How do I debug it ?

@stevearc
Copy link
Owner Author

The "Unknown error logging in" message was because I wasn't sure what would trigger that code flow. I've done some testing on my own, and it looks like that is caused by supplying an incorrect password (or app password, if using 2-factor). Can you double-triple check that you put in the correct email and password?

Also, not sure if this is a copy/paste mistake or something weirder, but the output of :checkhealth gkeep is completely wrong. That's what I would expect if you ran :checkhealth provider. The expected output looks something like

gkeep: health#gkeep#check
========================================================================
## gkeep
  - OK: gkeepapi 0.13.6 installed
  - OK: keyring installed
  - OK: Logged in as arc********@gmail.com
  - INFO: Log file: /home/stevearc/.cache/nvim/gkeep.log

@srbhp
Copy link

srbhp commented Feb 11, 2022

Yes you are right, I was copy/pasting the wrong APP password.
Maybe we should have an option to see the password when typing.
Thanks.
The :checkhealth gkeep output I have given earlier was wrong.
Now even after logged in I see this .


gkeep: health#gkeep#check
========================================================================
## gkeep
  - OK: gkeepapi 0.13.7 installed
  - OK: keyring installed
  - WARNING: Not logged in
    - ADVICE:
      - Try :GkeepLogin
  - INFO: Log file: /home/sp/.cache/nvim/gkeep.log

@stevearc
Copy link
Owner Author

Gkeep is aggressively lazy on startup, to try to avoid as much unnecessary work as possible. If you just started a fresh vim instance the health report will show you as not logged in until you :GkeepOpen or do something else that requires it to load your notes. I've pushed up a commit that should help with the reporting issue.

Despite the report of not being logged in, are you able to use the plugin? Are the features working?

@srbhp
Copy link

srbhp commented Feb 12, 2022

Yes. Everything is working fine.
checkhealth gkeep show not logged in until I open the :GkeepOpen .
After that, it shows logged in.

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

2 participants