garmin-uploader
garmin-uploader copied to clipboard
Authentication Failures again
Howdy,
Seems Garmin has yet again tweaked some things and I have several users (including myself) running into auth failures. https://github.com/philosowaffle/peloton-to-garmin/issues/109
assert self.user.authenticate(), "Failed to authenticate garmin user."
AssertionError: Failed to authenticate garmin user.
Thank you in advance for any help!
Hey @philosowaffle ,
I reproduce the issue: the project unit tests are failing on the authentication.
I'll try to quickly find a fix, I'll keep you posted here
This time it's Cloudflare rejecting the requests.
I get a nice error page, with the infamous 1020 Cloudflare error. This may take some time to fix...
Oh no :(
Cloudflare is awesome for keeping our favorite sites online, but as an indy dev who just wants to automate things, I hate it lol
You can try this rough patch : https://github.com/La0/garmin-uploader/pull/29/files
I got some auth requests to work with this code, but now i'm getting HTTP 429 Too many requests
:sob:
Thank you for the quick patch attempt! I'm at work so won't be able to verify till tonight.
On the 429 error, I've had good luck with switching onto a VPN. The 429 seems tied to IP address, so if you hop on a vpn then you get another 10-20 requests before it throws 429 again. And I think the cool off period is about 1hr.
How can we pull this fix. I would like to test it.
I had similar problem with my code. Actually itis the cloudflare protection that kicks in. I got it working using cloudscraper
library to make the request. Here is a similar py libarary where this is duscussed.
https://github.com/cyberjunky/python-garminconnect/issues/46
i can confirm Cyberjunky fix looks like its working, I'm testing it live now
@kenlpeters You can try my patch with the following pip command:
pip install https://github.com/La0/garmin-uploader/archive/fix-cloudfare-errors.zip
Still get authentication failed. Not even too many requests
I checked out fix-cloudfare-errors
, switched conftest.py
to use my dev credentials, then ran the unit tests. Unfortunately, most are still failing with Authentication Failed
. Same error if I use the default guploader
creds as well.
Double integration (two accounts on one HA instance) running OK for more than 3 hours now, see
https://github.com/home-assistant/core/issues/50822
I'll try clouscrapper tommorow
The CI is ok on the current branch, except on Python 3.7 :man_shrugging:
@La0 - let me know when 3.7 is working. Unfortunately that is the version I am running... go figure.
@kenlpeters I just re-ran the CI, and it worked. I get the same results locally on multiple Python versions, and on multiple accounts / servers.
Please test this version !
I must not be downloading the proper version of the api.py. Can you link the right version.
Any update on this. I am still running into the authentication error. I just think it is a fact that I am not pulling the proper version of the software.
@kenlpeters I just re-ran the CI, and it worked. I get the same results locally on multiple Python versions, and on multiple accounts / servers.
Please test this version !
It's working for me now thanks!
Great how to get the newest version.
Any update on this. I am still running into the authentication error. I just think it is a fact that I am not pulling the proper version of the software.
For me I had the old version installed in ~/.local and nothing else there. So I removed all of that directory, then cloned this repo, switched branches and ran
python3 setup.py install --user
Little out of my league. Is there a link to the newest branch/repo to download On May 20, 2021, 7:57 AM -0400, Mario Limonciello @.***>, wrote:
Any update on this. I am still running into the authentication error. I just think it is a fact that I am not pulling the proper version of the software. For me I had the old version installed in ~/.local and nothing else there. So I removed all of that directory, then cloned this repo, switched branches and ran python3 setup.py install --user — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
I think I downloaded the proper branch (cloud fare fixes) and unzipped and run the setup.py. Still I am getting Authenication error.
I tried the CI branch as well and it did not work. So obviously I am downloading the right branch.
I think I downloaded the proper branch (cloud fare fixes) and unzipped and run the setup.py. Still I am getting Authenication error.
Assuming you're not hitting a different failure and are running the wrong code still - if I was to guess, you're still getting the wrong copy from a local install somewhere else that has higher precedence (like site-packages or dist-packages). You should try doing pip uninstall garmin-uploader
.
Did you download the cloud fare fixes branch?
Yes. Basically I did:
rm ~/.local -r
git clone https://github.com/La0/garmin-uploader/
git checkout fix-cloudfare-errors
python3 setup.py install --user
gupload .....
and verified it's working for me now.
Another option, if you do not want to bother with installing/uninstalling packages:
> git clone https://github.com/La0/garmin-uploader/
> git checkout fix-cloudfare-errors
> pip install -r requirements.txt
> pip install -r requirements-tests.txt
> cd tests
> pytest
This runs the unit tests with a default set of credentials. If you would like to try running the unit tests with your personal credentials then modify here.
@La0 , assuming what I have outlined above is correct, I am still seeing Authentication failures :(
It fails the check on line 134 in api.py
and raises the Authentication failed.
exception (which bubbles up and is masked by the Invalid Credentials
exception). Fails for both your test user and my with my user creds. I am on python 3.6.4
.
@superm1 pardon snooping on your GH account, but looks like you're based in Texas. I am also based in Texas, so I guess that rules out different regional rules CloudFlare could be enforcing.
So I am not getting invalid credentials even though my credentials are correct.
@philosowaffle - Same here. Python 3.7 invalid credentials both with default and my person ones.