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

Aunthentication failure #21

Closed
Dave-DigiMim opened this issue Jun 29, 2021 · 2 comments
Closed

Aunthentication failure #21

Dave-DigiMim opened this issue Jun 29, 2021 · 2 comments

Comments

@Dave-DigiMim
Copy link

I randomly get this error, if I repeat the process a few times it will then work fine eventually.
I download 2 sets my self and my wife sometime 1 will fail sometimes the other..
I run both in a bash script. Which i now fail on Error, but would ideally like to retry!

Could it be a timing issue? Maybe my internet is slow or poor latency ?
Traceback (most recent call last):
File "/home/pi/.local/bin/garpy", line 8, in
sys.exit(main())
File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/pi/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/garpy/cli.py", line 88, in download
username=username, password=password, user_agent=user_agent
File "/home/pi/.local/lib/python3.7/site-packages/garpy/client.py", line 101, in enter
self.connect()
File "/home/pi/.local/lib/python3.7/site-packages/garpy/client.py", line 114, in connect
self._authenticate()
File "/home/pi/.local/lib/python3.7/site-packages/garpy/client.py", line 139, in _authenticate
"authentication failure: did you enter valid credentials?"
ConnectionError: authentication failure: did you enter valid credentials?

@Dave-DigiMim
Copy link
Author

I just used this script to try 10 times.

import os
from time import sleep
from sys import argv
from os.path import exists

def importgarpy(u,p,f,fd):
print("%s,%s,%s,%s"%(u,p,f,fd))
os.system("cd %s"%fd)
print(" changed path")
os.system("sudo chown -R pi:pi ./")
os.system("touch %s/startuptest"%fd)
os.system("/home/pi/.local/bin/garpy download -u %s -p %s 2>&1 | tee %s/%s"%(u,p,fd,f))
os.system("tail -1 %s/%s > %s/lastline.txt"%(fd,f,fd))
val=open("%s/%s"%(fd,f), "r").read()
print(val)
print(val.startswith("ConnectionError: authentication failure:") )
if val.startswith("ConnectionError: authentication failure:") != 0:
print("Connection Error")
return False
else:
return True
cnt=0
print("User=",argv[1],"Pass =",argv[2],"Filelog =",argv[3],"Folder=",argv[4])
while True:
res= importgarpy(argv[1],argv[2],argv[3],argv[4])
print("count ",cnt ,res)
if res==True:
print("Done")
break
elif cnt>10:
break
sleep(30)
cnt+=1

@felipeam86
Copy link
Owner

Hi @Dave-DigiMim,

Sorry for not replying earlier. I am getting the same random connection error. Garmin is getting better at blocking crawlers. For the moment, I don't have an easy fix for this.

I hope to find a solution when I have some available time.

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

2 participants