Garmelon/PFERD

Suggestion: Add flag to sync_url to ignore timeouts

DeveloperTK opened this issue · 3 comments

From time to time, I get an error like this:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Volumes/Vault/ILIAS Sync/urllib3/connection.py:169 in _new_conn                                 │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/urllib3/util/connection.py:96 in create_connection                     │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/urllib3/util/connection.py:86 in create_connection                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
timeout: timed out

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Volumes/Vault/ILIAS Sync/urllib3/connectionpool.py:699 in urlopen                               │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/urllib3/connectionpool.py:382 in _make_request                         │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/urllib3/connectionpool.py:1010 in _validate_conn                       │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/urllib3/connection.py:353 in connect                                   │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/urllib3/connection.py:174 in _new_conn                                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x110423cd0>, 'Connection to ilias.studium.kit.edu timed out. (connect timeout=5)')

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Volumes/Vault/ILIAS Sync/requests/adapters.py:439 in send                                       │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/urllib3/connectionpool.py:755 in urlopen                               │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/urllib3/util/retry.py:573 in increment                                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
MaxRetryError: HTTPSConnectionPool(host='ilias.studium.kit.edu', port=443): Max retries exceeded with url: /goto.php?target=file_(file id here)_download&client_id=produktiv (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x110423cd0>, 'Connection to 
ilias.studium.kit.edu timed out. (connect timeout=5)'))

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Volumes/Vault/ILIAS Sync/PFERD/errors.py:32 in inner                                            │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/PFERD/pferd.py:302 in ilias_kit_folder                                 │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/PFERD/pferd.py:108 in _ilias                                           │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/PFERD/ilias/downloader.py:109 in download_all                          │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/PFERD/ilias/downloader.py:125 in download                              │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/PFERD/ilias/downloader.py:145 in _try_download                         │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/requests/sessions.py:555 in get                                        │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/requests/sessions.py:542 in request                                    │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/requests/sessions.py:655 in send                                       │
│                                                                                                  │
│ /Volumes/Vault/ILIAS Sync/requests/adapters.py:504 in send                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ConnectTimeout: HTTPSConnectionPool(host='ilias.studium.kit.edu', port=443): Max retries exceeded with url: /goto.php?target=file_(file id here)_download&client_id=produktiv (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x110423cd0>, 'Connection to
ilias.studium.kit.edu timed out. (connect timeout=5)'))
INFO                                                                                                                                                                                                                                                                            
INFO      Download Summary                                                                                                                                                                                                                                                      
INFO      Nothing changed!   

From my understanding, this has something to do with the ILIAS instance running very slow. Could you implement an option that ignores timeouts like this and retries or shows a warning at the end instead of stopping? Synchronizing the entire desktop can take up to 30 minutes which makes this error pretty annoying.

The retry-downloads branch retries downloads 3 times and skips only the failed files. Is that what you had in mind?

Yes, that is exactly what I thought 👍

Should be closed by v2.5.3