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

trying to login and getting error #7

Open
bouton opened this issue Oct 3, 2024 · 5 comments
Open

trying to login and getting error #7

bouton opened this issue Oct 3, 2024 · 5 comments

Comments

@bouton
Copy link

bouton commented Oct 3, 2024

Hi - thought I'd try this out after using garminexport in the past. Note - I am a linux newbie.
Installation seemed to go ok. When I entered python3 garmin-backup.py data/2024 -f "gpx" --current --verbose=3 it said

Connecting to Garmin Connect...
Trying to login to Garmin Connect using token data from directory '~/.garminconnect'...

Login tokens not present, login with your Garmin Connect credentials to generate them.
They will be stored in '~/.garminconnect' for future use.

Gave me a login and password prompt (my email address has a "+" in it if that matters) and then a bit of a pause like it is thinking about it - then this error

Traceback (most recent call last):
  File "/garmin-backup/src/garmin-backup.py", line 98, in init_api
    garmin.login(tokenstore)
  File "/garmin-backup/.venv/lib/python3.11/site-packages/garminconnect/__init__.py", line 206, in login
    self.garth.load(tokenstore)
  File "/garmin-backup/.venv/lib/python3.11/site-packages/garth/http.py", line 212, in load
    with open(os.path.join(dir_path, "oauth1_token.json")) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/.garminconnect/oauth1_token.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/garmin-backup/src/garmin-backup.py", line 361, in <module>
    main()
  File "/garmin-backup/src/garmin-backup.py", line 329, in main
    api = init_api(email, password, tokenstore)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/garmin-backup/src/garmin-backup.py", line 112, in init_api
    garmin.login()
  File "/garmin-backup/.venv/lib/python3.11/site-packages/garminconnect/__init__.py", line 208, in login
    self.garth.login(
  File "/garmin-backup/.venv/lib/python3.11/site-packages/garth/http.py", line 160, in login
    self.oauth1_token, self.oauth2_token = sso.login(
                                           ^^^^^^^^^^
  File "/garmin-backup/.venv/lib/python3.11/site-packages/garth/sso.py", line 100, in login
    handle_mfa(client, SIGNIN_PARAMS, prompt_mfa)
  File "/garmin-backup/.venv/lib/python3.11/site-packages/garth/sso.py", line 157, in handle_mfa
    mfa_code = prompt_mfa()
               ^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable

any suggestions what to do next.
Thanks

@osso73
Copy link
Owner

osso73 commented Oct 7, 2024

Ok, just seen that sorry. Let me see if I can reproduce this. By looking at these traces, it seems the error comes from a package that I'm relying on, so I'll check if something has changed in the package recently.

@osso73
Copy link
Owner

osso73 commented Oct 7, 2024

I could not reproduce the same error: when I try with my login (user or mail) it works well.

Are you using MFA? I've seen an issue on the package that implements the authentication where a user has the same error as yours: matin/garth#41. It seems the issue is not completely solved yet.

@bouton
Copy link
Author

bouton commented Oct 8, 2024 via email

@osso73
Copy link
Owner

osso73 commented Oct 9, 2024

I DO know what Multi-Factor Authentication is... just did a test creating a new account, with MFA, and I got the same error that you get. When I de-activate the MFA, it works well.

So as a work-around, try to de-activate your MFA from Garmin. Or alternatively, you may wait and see if this error is corrected in this issue: matin/garth#41. Not much I can do here, as the authentication is really handled by this package.

@bouton
Copy link
Author

bouton commented Oct 9, 2024 via email

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