-
Notifications
You must be signed in to change notification settings - Fork 30
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
Authentication Failures again #28
Comments
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 |
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 |
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:
|
Still get authentication failed. Not even too many requests |
I checked out |
Double integration (two accounts on one HA instance) running OK for more than 3 hours now, see |
I'll try clouscrapper tommorow |
The CI is ok on the current branch, except on Python 3.7 🤷♂️ |
@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. |
It's working for me now thanks! |
Great how to get the newest version. |
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
|
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. |
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 |
Did you download the cloud fare fixes branch? |
Maybe i have not signed up so I am not sure what questions they ask. If one is what is the IP address your application will making calls from, then it definitely can be a white listing component. |
Two things I tested just now that seems to be working:
For 1 - I chose to do this after reading through this linked issue For 2 - I want to note that I may have run the wrong branch when I previously attempted to test the cloudscraper fix. But for the life of me I cannot remember. Sorry for the confusion, but it does seem to be working now. Oddly enough, I tried 5 times, it worked on 4 attempts, failed on 1.
Other things I tested during this session (on the
I will continue to tentatively test the |
What a mess... I'm using the last release myself and have no issues to upload activities. I think they have some anti-cheat heuristics on a few factors:
I can't find how to get the geolocation argument from garmin (basically to tell if you are Another attempt would be to try something like selenium, but that would be really heavy and hard to maintain too 😞 I don't have a silver bullet for now. |
Just an update from my end. I am using the cloud fix CI with V1 peloton-to-Garmin and it continues to work on my MS Azure Linux VM. I am using python 3.7 and my URLs are fr-FR. I apologized I have been saying my VM is an AWS one when it is an Azure in Central US. |
Let me know if there is anything I can test for you. |
If you update v2 with cloudscrapper branch I'll pull it down and test |
I'm the other comments can we just add a param for country code we manually put in and then add a delay for the login request and give that a shot |
@dkmcgowan I have updated the V2 docker image to use the cloudscraper fix. You can pull latest and test it out. Seems to still be working for me. |
This one is working for me, atleast the first run did to upload a few |
I've integrated the CloudScraper fix into my latest build and am taking a poll (see last comment) to see who its working for. |
So far the cloudscraper fix seems to be working for all of my users who have reported back (~10 so far). No one has reported that it is not working for them. |
I have just downloaded, compiled and installed python3.9 on raspbian.. that made things work again using gupload 2021-05-29 06:03:34,133 [INFO] Force uploading |
cloudscraper fix seems to work for me as well. (i'm using this from within peloton-to-garmin) |
FWIW- Standard Installation on Mac Big Sur (11.13.1) Python 3.8 fails authentication. |
Following directions (cloudscraper) above seems to fix the issue for me. |
garmin-uploader 1.0.10 in Virtualbox machine with Ubuntu 20.04 (python 3.8.5) works perfectly. |
@La0 - Question when you have a chance. My project has switched to using the cloudscraper fix with moderate success for most users. One issue we are seeing is when we attempt upload multiple activities at once. If we attempt to only upload 1 activity, then the upload succeeds. However, attempting to upload more than 1 at once results in an auth error with Garmin. Below is a sample command that is executed. Email and Password are scrubbed intentionally:
Here is a comment with more details on repro steps. I'm wondering if something changed in the cloudscraper fix where it attempts to authenticate more than once when uploading multiple files? Or if there is something I should be doing differently in these cases? |
Want to report that using 1.0.10 is working on a Heroku install as a library dependency within https://github.com/flackdl/ifit-garmin-sync |
Hello. I am trying to incorporate this change as well, and resorted to adding Thanks in advance. |
Hi! My experience is that the cloudscraper branch is working well, while the master branch has consistently failed (always resulting in the 'authentication failed' misnomer errors). In this thread I'm also reading a lot of positive feedback on this branch. Would it be possible to merge the cloudscraper branch into master and bump the library version? |
Checking in here. Although the PelotonToGarminConsole is working wonderfully, I have started a new process of syncing iFit (for Norditrack) to Garmin. I am using the uploader again and it continues to get the too many requests error. |
I am getting auth errors with this and many other projects. It fails at getting the CSRF token/ticket. I tried using https://github.com/felipeam86/garpy/tree/4ced33f4dcf018278e948b6eaea1ab6414d2ef5a and it worked. After some looking at it, it seems that one of the difference may be where the response token is being looked for?
coming from this method/function here |
After a year of working with the crowdscraper code, it is now resulting in 403 errors. Is anyone else running into connection troubles starting this week? |
yeah.. its down for most projects... |
garth is working |
Same here. Simple test from cli
results in.....
` |
@pantomnesia see oldnapalm@7234be7 (notice that it will only fix authentication but you will still get upload error and updating activity name and type won't work because Or just migrate to https://github.com/matin/garth Example: import os
import sys
import garth
from getpass import getpass
if len(sys.argv) < 2:
print("Use %s <file name>" % sys.argv[0])
sys.exit(1)
if not os.path.isfile(sys.argv[1]):
print("File %s not found" % sys.argv[1])
sys.exit(1)
tokens_dir = '~/.garth'
try:
garth.resume(tokens_dir)
garth.client.username
except:
email = input("Enter email address: ")
password = getpass("Enter password: ")
try:
garth.login(email, password)
garth.save(tokens_dir)
except Exception as exc:
print(exc)
sys.exit(1)
try:
with open(sys.argv[1], "rb") as f:
resp = garth.client.upload(f)
print(resp)
except Exception as exc:
print(exc)
sys.exit(1)
sys.exit(0) |
Howdy,
Seems Garmin has yet again tweaked some things and I have several users (including myself) running into auth failures.
philosowaffle/peloton-to-garmin#109
Thank you in advance for any help!
The text was updated successfully, but these errors were encountered: