petergardfjall / garminexport

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

[ERROR] Failed With Exception - Server 500 Error on summary_json Download #19

Closed jhamilt5 closed 6 years ago

jhamilt5 commented 6 years ago

OS: Ubuntu 16.04.3 LTS Python Version: 2.7.12 Command Line: python garminbackup.py --backup-dir=../activities --format=json_summary <my-email> Output:

2018-01-13 06:58:16,778 [INFO] backing up formats: json_summary Enter password: 2018-01-13 06:58:18,644 [INFO] authenticating user ... 2018-01-13 06:58:20,542 [INFO] claiming auth ticket ... 2018-01-13 06:58:23,943 [INFO] scanning activities for \<my-email> ... 2018-01-13 06:58:24,735 [INFO] account has a total of 10 activities 2018-01-13 06:58:24,741 [INFO] ../activities contains 0 backed up activities 2018-01-13 06:58:24,743 [INFO] activities that aren't backed up: 10 2018-01-13 06:58:24,745 [INFO] backing up activity 2421143428 from 2018-01-08 01:30:51+00:00 (1 out of 10) ... 2018-01-13 06:58:25,030 [INFO] backing up activity 2394978767 from 2017-12-24 19:26:22+00:00 (2 out of 10) ... 2018-01-13 06:58:25,348 [INFO] backing up activity 2405029691 from 2017-12-30 19:56:37+00:00 (3 out of 10) ... 2018-01-13 06:58:25,670 [INFO] backing up activity 2410850813 from 2018-01-02 22:27:05+00:00 (4 out of 10) ... 2018-01-13 06:58:25,970 [INFO] backing up activity 2418745447 from 2018-01-06 23:35:43+00:00 (5 out of 10) ... 2018-01-13 06:58:26,155 [ERROR] failed with exception: failed to fetch json summary for activity 2418745447: 500

Error Output: <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 - org.springframework.beans.factory.BeanCreationException: Autowiring of fields/methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.garmin.connect.service.personalrecord.PersonalRecordService com.garmin.mb.activity.service.ActivityServiceManagerBean.personalRecordService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.garmin.connect.service.personalrecord.PersonalRecordService] is defined: Unsatisfied dependency of type [interface com.garmin.connect.service.personalrecord.PersonalRecordService]: expected at least 1 matching bean</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>org.springframework.beans.factory.BeanCreationException: Autowiring of fields/methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.garmin.connect.service.personalrecord.PersonalRecordService com.garmin.mb.activity.service.ActivityServiceManagerBean.personalRecordService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.garmin.connect.service.personalrecord.PersonalRecordService] is defined: Unsatisfied dependency of type [interface com.garmin.connect.service.personalrecord.PersonalRecordService]: expected at least 1 matching bean</u></p><p><b>description</b> <u>The server encountered an internal error (org.springframework.beans.factory.BeanCreationException: Autowiring of fields/methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.garmin.connect.service.personalrecord.PersonalRecordService com.garmin.mb.activity.service.ActivityServiceManagerBean.personalRecordService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.garmin.connect.service.personalrecord.PersonalRecordService] is defined: Unsatisfied dependency of type [interface com.garmin.connect.service.personalrecord.PersonalRecordService]: expected at least 1 matching bean) that prevented it from fulfilling this request.</u></p><HR size="1" noshade="noshade"><h3>JBossWeb/2.0.0.GA</h3></body></html>

Additional Notes:

jhamilt5 commented 6 years ago

After some testing, it turns out this is linked to issue #12 This behavior seems to happen around 20% of the time, but it kills the execution of the program. I was able to get around it by adding simple loops to retry on failure. I also made that configurable through argparse to choose the maximum number of retries per activity and how long you should sleep between tries. Through testing, 10 retries and one second of sleep seems to do the trick.

tymmej commented 6 years ago

@jhamilt5 can you share diff or make pull reqest?

petergardfjall commented 6 years ago

Thanks, I already have some code under development for #12. I'll try to release it on the master branch as soon as I can.

Den 26 feb. 2018 14:06 skrev "Jakub Tymejczyk" notifications@github.com:

@jhamilt5 https://github.com/jhamilt5 can you share diff or make pull reqest?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/petergardfjall/garminexport/issues/19#issuecomment-368498368, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWoY8NxhPmcI3tGQAEnxo26qoY0jLfgks5tYqxhgaJpZM4RdRHX .

petergardfjall commented 6 years ago

Try out the latest version. It uses a configurable number of retries (--max-retries) with exponential back-off.