tcgoetz / GarminDB

Download and parse data from Garmin Connect or a Garmin watch, FitBit CSV, and MS Health CSV files into and analyze data in Sqlite serverless databases with Jupyter notebooks.
GNU General Public License v2.0
1.18k stars 142 forks source link

error in File "/usr/local/lib/python3.9/site-packages/garmindb/download.py", line 166, in login #143

Closed thinktank9 closed 2 years ago

thinktank9 commented 2 years ago

I have a cron job that downloads Garmin data every day but since yesterday evening its started giving an error. It's been working fine for the last couple of months and I haven't made any changes to the configuration or the environment (its runs inside a docker container so it's completely isolated). I upgraded the package with pip install --upgrade garmindb but I am still getting the error. See the logs below.

To Reproduce Steps to reproduce the behaviour: run garmindb_cli.py --all --download --import --analyze --latest

Expected behaviour Should download all the updates since the last run

Logs

___Downloading Latest Data___
Traceback (most recent call last):
  File "/usr/local/bin/garmindb_cli.py", line 349, in <module>
    main(sys.argv[1:])
  File "/usr/local/bin/garmindb_cli.py", line 330, in main
    download_data(args.overwrite, args.latest, args.stats)
  File "/usr/local/bin/garmindb_cli.py", line 111, in download_data
    if not download.login():
  File "/usr/local/lib/python3.9/site-packages/garmindb/download.py", line 166, in login
    self.display_name = self.user_prefs['displayName']
TypeError: 'NoneType' object is not subscriptable
tcgoetz commented 2 years ago

Confirmed.

tcgoetz commented 2 years ago

Fixed on develop branch. Are you able to test from source? Can you test the develop branch and see if it works for you?

MarnixvBuuren commented 2 years ago

Works! Did a download of all latest activities and monitoring-files. Thx! (Had some minor issues with the defines.mk-files, location of bash on ubuntu is /bin/bash, but after fixing that, everything works)

EmptySoft commented 2 years ago

i try to use the develop branch to, but i cannot run the make setup command

harald@kalymnos:~/GarminDB> git clone https://github.com/tcgoetz/GarminDB.git --branch develop --single-branc Klone nach 'GarminDB' ... remote: Enumerating objects: 4171, done. remote: Counting objects: 100% (647/647), done. remote: Compressing objects: 100% (255/255), done. remote: Total 4171 (delta 424), reused 593 (delta 377), pack-reused 3524 Empfange Objekte: 100% (4171/4171), 4.11 MiB | 1.74 MiB/s, Fertig. Löse Unterschiede auf: 100% (2952/2952), Fertig. harald@kalymnos:~/GarminDB> make setup cp /home/harald/GarminDB/garmindb/GarminConnectConfig.json.example /home/harald/.GarminDb/GarminConnectConfig.json make: /usr/bin/bash: Kommando nicht gefunden make: /usr/bin/bash: Kommando nicht gefunden make: /usr/bin/bash: Kommando nicht gefunden make: /usr/bin/bash: Kommando nicht gefunden make: *** [Makefile:53: /home/harald/.GarminDb/GarminConnectConfig.json] Fehler 127 harald@kalymnos:~/GarminDB>

tcgoetz commented 2 years ago

I'm using this for the first time and am getting this error still. I have switched branch to develop. On Mac OS X.

After switching to the develop branch, did you build and install? make reinstall_all

tcgoetz commented 2 years ago

Kommando nicht gefunden make: /usr/bin/bash

You don't have bash installed on your system. either install bash or change the SHELL define in defines.mk.

thinktank9 commented 2 years ago

Works for me.

Steps:

  1. created a docker container with all the required tools
  2. inside the container, cloned the repo using git clone -b develop --recurse-submodules git@github.com:tcgoetz/GarminDB.git
  3. inside GarminDB dir ran make setup
  4. updated /root/.GarminDb/GarminConnectConfig.json with my settings
  5. ran make create_dbs

it started downloading the files, see the screenshot -

image

Is that what you were expecting me to check?

thinktank9 commented 2 years ago

This is a screenshot of my script which was giving the error earlier, it's working with the fix now -

image

Thank you!

tcgoetz commented 2 years ago

Released in 3.1.2.

EmptySoft commented 2 years ago

Kommando nicht gefunden make: /usr/bin/bash

You don't have bash installed on your system. either install bash or change the SHELL define in defines.mk. Hi Tom.!

Thanks a lot (my bash is in the linux standard path /bin/bash. But now i have a new error ... harald@kalymnos:~/GarminDB> make setup cp /home/harald/GarminDB/garmindb/GarminConnectConfig.json.example /home/harald/.GarminDb/GarminConnectConfig.json python3 -m venv --upgrade-deps /home/harald/GarminDB/.venv usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade] [--without-pip] [--prompt PROMPT] ENV_DIR [ENV_DIR ...] venv: error: unrecognized arguments: --upgrade-deps make: *** [Makefile:56: /home/harald/GarminDB/.venv] Fehler 2 harald@kalymnos:~/GarminDB>