kosmosnautti / dltool

Tool to download contents of a DAT collection from Myrient
GNU General Public License v3.0
30 stars 3 forks source link

[Bug] Connection broken Incomplete Read #13

Open Sle3perX opened 2 months ago

Sle3perX commented 2 months ago

When using the tool on Windows with command line or Powershell after a few seconds or minutes i am getting the below traceback. Sometimes i can download 10-20 games but sometimes the connection resets after 2 games. When restarting the script it checks all games again and even crashes while rechecking.

83% |   3.0 MiB / 3.6 MiB |##################################################           | ETA:   0:00:00 |   3.9 MiB/s
Traceback (most recent call last):
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\urllib3\response.py", line 748, in _error_catcher
    yield
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\urllib3\response.py", line 894, in _raw_read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
urllib3.exceptions.IncompleteRead: IncompleteRead(3636613 bytes read, 139718 more expected)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\requests\models.py", line 820, in generate
    yield from self.raw.stream(chunk_size, decode_content=True)
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\urllib3\response.py", line 1060, in stream
    data = self.read(amt=amt, decode_content=decode_content)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\urllib3\response.py", line 977, in read
    data = self._raw_read(amt)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\urllib3\response.py", line 872, in _raw_read
    with self._error_catcher():
  File "C:\Users\USER\scoop\apps\python\current\Lib\contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\urllib3\response.py", line 772, in _error_catcher
    raise ProtocolError(arg, e) from e
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(3636613 bytes read, 139718 more expected)', IncompleteRead(3636613 bytes read, 139718 more expected))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\USER\Documents\Romcenter\dltool-main\dltool.py", line 283, in <module>
    for data in resp.iter_content(chunk_size=CHUNKSIZE):
  File "C:\Users\USER\scoop\apps\python\current\Lib\site-packages\requests\models.py", line 822, in generate
    raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(3636613 bytes read, 139718 more expected)', IncompleteRead(3636613 bytes read, 139718 more expected))
alex-taxiera commented 2 months ago

This is the same problem I called out in #9

aZuiZui commented 2 months ago

I am getting the same issue, it is possible for us to output the download link to a file to be able to import this into a download manager instead? I think implementing a retry would be troublesome, where you can leverage something else to download with multi threading.

2024-08-21 07:16:10 | Resuming 0029/4418: 7 Wonders of the Ancient World (USA) 99% | 89.4 MiB / 90.2 MiB |########################################################### | ETA: 0:00:00 | 6.0 MiB/sTraceback (most recent call last): File "C:\dltool\dltool.py", line 279, in pbar += len(data) File "C:\Users\Docker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\progressbar\bar.py", line 875, in iadd return self.increment(value) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Docker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\progressbar\bar.py", line 878, in increment self.update(self.value + value, *args, **kwargs) File "C:\Users\Docker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\progressbar\bar.py", line 925, in update raise ValueError( ValueError: Value 94576742 is too large. Should be between 0 and 94576556

aZuiZui commented 2 months ago

Not sure if dev is still working on the tool; there is a folk that fixes this issue; https://github.com/alex-taxiera/auto-myrient/releases

alex-taxiera commented 2 months ago

I am getting the same issue, it is possible for us to output the download link to a file to be able to import this into a download manager instead? I think implementing a retry would be troublesome, where you can leverage something else to download with multi threading.

2024-08-21 07:16:10 | Resuming 0029/4418: 7 Wonders of the Ancient World (USA) 99% | 89.4 MiB / 90.2 MiB |########################################################### | ETA: 0:00:00 | 6.0 MiB/sTraceback (most recent call last): File "C:\dltool\dltool.py", line 279, in pbar += len(data) File "C:\Users\Docker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\progressbar\bar.py", line 875, in iadd return self.increment(value) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Docker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\progressbar\bar.py", line 878, in increment self.update(self.value + value, *args, **kwargs) File "C:\Users\Docker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\progressbar\bar.py", line 925, in update raise ValueError( ValueError: Value 94576742 is too large. Should be between 0 and 94576556

This is a different problem, which is already captured by #6