petergardfjall / garminexport

Garmin Connect activity exporter and backup tool
Apache License 2.0
507 stars 83 forks source link

[ERROR] failed with exception: ('Connection aborted.', error(54, 'Connection reset by peer')) #20

Closed tymmej closed 6 years ago

tymmej commented 6 years ago

I cannot download activities:

`./garminbackup.py --log-level=DEBUG --backup-dir=./backup tymmej@gmail.com 2018-01-28 10:40:59,914 [INFO] backing up formats: json_summary, json_details, gpx, tcx, fit Enter password: 2018-01-28 10:41:07,869 [INFO] authenticating user ... 2018-01-28 10:41:08,782 [DEBUG] got auth response: <!DOCTYPE html>

Success

2018-01-28 10:41:08,795 [DEBUG] auth ticket url: 'https://connect.garmin.com/modern?ticket=ST-014852-RkYPGCipbBTWZPxxApKk-cas' 2018-01-28 10:41:08,795 [INFO] claiming auth ticket ... 2018-01-28 10:41:14,717 [INFO] scanning activities for tymmej@gmail.com ... 2018-01-28 10:41:14,718 [DEBUG] fetching activities 0 through 99 ... 2018-01-28 10:41:32,050 [DEBUG] got 100 activities. 2018-01-28 10:41:32,058 [DEBUG] fetching activities 100 through 199 ... 2018-01-28 10:41:49,668 [DEBUG] got 100 activities. 2018-01-28 10:41:49,673 [DEBUG] fetching activities 200 through 299 ... 2018-01-28 10:42:07,029 [DEBUG] got 100 activities. 2018-01-28 10:42:07,033 [DEBUG] fetching activities 300 through 399 ... 2018-01-28 10:42:24,212 [DEBUG] got 100 activities. 2018-01-28 10:42:24,216 [DEBUG] fetching activities 400 through 499 ... 2018-01-28 10:42:40,658 [DEBUG] got 100 activities. 2018-01-28 10:42:40,663 [DEBUG] fetching activities 500 through 599 ... 2018-01-28 10:42:57,507 [DEBUG] got 100 activities. 2018-01-28 10:42:57,510 [DEBUG] fetching activities 600 through 699 ... 2018-01-28 10:43:13,848 [DEBUG] got 100 activities. 2018-01-28 10:43:13,852 [DEBUG] fetching activities 700 through 799 ... 2018-01-28 10:43:31,341 [DEBUG] got 100 activities. 2018-01-28 10:43:31,346 [DEBUG] fetching activities 800 through 899 ... 2018-01-28 10:43:50,267 [DEBUG] got 100 activities. 2018-01-28 10:43:50,271 [DEBUG] fetching activities 900 through 999 ... 2018-01-28 10:43:51,397 [DEBUG] got 4 activities. 2018-01-28 10:43:51,398 [DEBUG] fetching activities 1000 through 1099 ... 2018-01-28 10:43:54,056 [DEBUG] got 0 activities. 2018-01-28 10:43:54,057 [INFO] account has a total of 904 activities 2018-01-28 10:43:54,058 [DEBUG] 0 tried but failed activities in ./backup/.not_found 2018-01-28 10:43:54,080 [INFO] ./backup contains 0 backed up activities 2018-01-28 10:43:54,080 [INFO] activities that aren't backed up: 904 2018-01-28 10:43:54,080 [INFO] backing up activity 2404463481 from 2017-12-30 10:23:58+00:00 (1 out of 904) ... 2018-01-28 10:43:54,080 [DEBUG] getting json summary for 2404463481 2018-01-28 10:43:54,696 [DEBUG] getting json details for 2404463481 2018-01-28 10:44:01,649 [DEBUG] getting gpx for 2404463481 2018-01-28 10:47:58,950 [DEBUG] getting tcx for 2404463481 2018-01-28 10:59:00,223 [DEBUG] getting fit for 2404463481 2018-01-28 10:59:00,303 [ERROR] failed with exception: ('Connection aborted.', error(54, 'Connection reset by peer')) 2018-01-28 10:59:00,309 [ERROR] failed with exception: ('Connection aborted.', error(54, 'Connection reset by peer'))`

pavlinux commented 6 years ago
2018-02-23 23:34:34,461 [INFO] backing up formats: fit
2018-02-23 23:34:34,471 [INFO] authenticating user ...
2018-02-23 23:34:36,189 [INFO] claiming auth ticket ...
2018-02-23 23:34:43,217 [INFO] scanning activities for ........@gmail.com ...
2018-02-23 23:34:48,581 [ERROR] failed with exception: failed to fetch activities 0 to 99 types: 500
<html><head><title>JBossWeb/2.0.0.GA - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><HR size="1" noshade="noshade"><h3>JBossWeb/2.0.0.GA</h3></body></html>
petergardfjall commented 6 years ago

The latest version uses a configurable number of retries on failed download attempts. Give it a try. The Garmin Connect API appears to have been quite shaky lately.