ECB - ERROR: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Sometimes (not on every download), some datasets (frequently GFS
, and E11
) does not download, the error is ERROR: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Example: https://git.nomics.world/dbnomics-fetchers/ecb-fetcher/-/jobs/282058
ERROR: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
url: 'https://sdw-wsrest.ecb.europa.eu/service/data/GFS/'
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/urllib3/response.py", line 697, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/urllib3/response.py", line 437, in _error_catcher
yield
File "/usr/local/lib/python3.7/dist-packages/urllib3/response.py", line 764, in read_chunked
self._update_chunk_length()
File "/usr/local/lib/python3.7/dist-packages/urllib3/response.py", line 701, in _update_chunk_length
raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/requests/models.py", line 751, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/usr/local/lib/python3.7/dist-packages/urllib3/response.py", line 572, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/usr/local/lib/python3.7/dist-packages/urllib3/response.py", line 793, in read_chunked
self._original_response.close()
File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.7/dist-packages/urllib3/response.py", line 455, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "download.py", line 186, in download_file
response = requests_session.get(url)
File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 683, in send
r.content
File "/usr/local/lib/python3.7/dist-packages/requests/models.py", line 829, in content
self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
File "/usr/local/lib/python3.7/dist-packages/requests/models.py", line 754, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
ERROR: https://sdw-wsrest.ecb.europa.eu/service/data/GFS/