Closed ethanbergstrom closed 1 year ago
Fixed with v4.2.0
Any idea of when this fix will be released in PyPi? I'm configuring this syncer for my home server where I'd like to run this as a non-root user and it looks like this prevents me from running the script:
Traceback (most recent call last):
File "/home/syncer/.local/lib/python3.9/site-packages/withings_sync/garmin.py", line 38, in get_session
garth.save('./garmin_session')
File "/usr/local/lib/python3.9/dist-packages/garth/http.py", line 183, in dump
os.makedirs(dir_path, exist_ok=True)
File "/usr/lib/python3.9/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: './garmin_session'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/syncer/.local/bin/withings-sync", line 8, in <module>
sys.exit(main())
File "/home/syncer/.local/lib/python3.9/site-packages/withings_sync/sync.py", line 512, in main
sync()
File "/home/syncer/.local/lib/python3.9/site-packages/withings_sync/sync.py", line 473, in sync
gar_wg_state = sync_garmin(fit_data_weight)
File "/home/syncer/.local/lib/python3.9/site-packages/withings_sync/sync.py", line 168, in sync_garmin
garmin.login(ARGS.garmin_username, ARGS.garmin_password)
File "/home/syncer/.local/lib/python3.9/site-packages/withings_sync/garmin.py", line 46, in login
return GarminConnect.get_session(email=username, password=password)
File "/home/syncer/.local/lib/python3.9/site-packages/withings_sync/garmin.py", line 40, in get_session
raise APIException("Authentication failure: {}. Did you enter correct credentials?".format(ex))
withings_sync.garmin.APIException: Authentication failure: [Errno 13] Permission denied: './garmin_session'. Did you enter correct credentials?
The K8s examples explicitly do not run as root, but the current implementation of Garth post-v4 upgrade puts
./garmin_session
in/
, which is a location a non-root user wouldn't normally be able to write to.Looks like this should be fixed in #144 in that it now derives its path from
$HOME
the same way Withings session data is stored, but wanted to call this out as a separate but related issue.Working around it for now by specifying
workingDir
in my K8s job to match the same directory as$HOME
.