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

AssertionError on attempting to run garmindb_cli.py script #249

Closed
lowebb opened this issue Nov 27, 2024 · 3 comments
Closed

AssertionError on attempting to run garmindb_cli.py script #249

lowebb opened this issue Nov 27, 2024 · 3 comments

Comments

@lowebb
Copy link

lowebb commented Nov 27, 2024

Describe the bug
Since the 25/11/2024, attempting to pull data from Garmin is throwing an AssertionError when attempting to login

This happens for entire pull or just the latest. I've checked and re-checked my auth details and am lost what the problem might be. Any help much appreciated

To Reproduce
Steps to reproduce the behavior:

  1. Run script per README.md garmindb_cli.py --all --download --import --analyze
  2. It fails

Expected behavior
It should run, download data and exit

Logs

garmindb_cli.py --all --download --import --analyze
___Downloading All Data___
Traceback (most recent call last):
  File "/home/xxxxxxxx/fw/garmin/venv2/bin/garmindb_cli.py", line 368, in <module>
    main(sys.argv[1:])
  File "/home/xxxxxx/fw/garmin/venv2/bin/garmindb_cli.py", line 349, in main
    download_data(args.overwrite, args.latest, args.stats)
  File "/home/xxxxxxxx/fw/garmin/venv2/bin/garmindb_cli.py", line 113, in download_data
    if not download.login():
  File "/home/xxxxxxxx/fw/garmin/venv2/lib/python3.10/site-packages/garmindb/download.py", line 92, in login
    self.garth.username
  File "/home/xxxxxxx/fw/garmin/venv2/lib/python3.10/site-packages/garth/http.py", line 109, in username
    return self.profile["userName"]
  File "/home/xxxxxxx/fw/garmin/venv2/lib/python3.10/site-packages/garth/http.py", line 104, in profile
    assert isinstance(self._profile, dict)
AssertionError

Please run bugreport.sh and attach bugreport.zip.

Additional context
Add any other context about the problem here.

@tcgoetz
Copy link
Owner

tcgoetz commented Nov 27, 2024

This is a bug in garth: matin/garth#73

@tcgoetz
Copy link
Owner

tcgoetz commented Nov 27, 2024

Waiting on this PR matin/garth#74 and a new release of garth with it in it. New release of GarminDB when that happens.

@cyberjunky
Copy link

@tcgoetz I temp fixed it in python-garminconnect by doing this before/in my code, maybe you can do something similar in your code?


# Temp fix for API change!
garth.http.USER_AGENT = {"User-Agent": "GCM-iOS-5.7.2.1"}

https://github.com/cyberjunky/python-garminconnect/blob/master/garminconnect/__init__.py#L15

lowebb added a commit to lowebb/GarminDB that referenced this issue Dec 1, 2024
lowebb added a commit to lowebb/GarminDB that referenced this issue Dec 1, 2024
@tcgoetz tcgoetz closed this as completed Dec 6, 2024
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

3 participants