Environment
What operating system are you using?
Ubuntu
If possible, include the OS name and version (e.g. macOS Catalina 10.15.7)
Ubuntu 21.04
What Python version are you using?
3.8.5
Please use the full version string (e.g. 3.8.6
). You can use $ python --version
at the command line or >>> import sys; print(sys.version)
in a Python console.
What version of the radiant_mlhub
library are you using?
0.3.1
You can use $ mlhub --version
at the command line or >>> import radiant_mlhub; print(radiant_mlhub.__version__)
in a Python console.
Problem Description
Please provide a clear and concise description of the bug/problem, including error messages.
ConnectionResetError Traceback (most recent call last)
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/urllib3/response.py in _error_catcher(self)
437 try:
--> 438 yield
439
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/urllib3/response.py in read(self, amt, decode_content, cache_content)
518 cache_content = False
--> 519 data = self._fp.read(amt) if not fp_closed else b""
520 if (
~/miniconda3/envs/ai4food/lib/python3.8/http/client.py in read(self, amt)
457 b = bytearray(amt)
--> 458 n = self.readinto(b)
459 return memoryview(b)[:n].tobytes()
~/miniconda3/envs/ai4food/lib/python3.8/http/client.py in readinto(self, b)
501 # (for example, reading in 1k chunks)
--> 502 n = self.fp.readinto(b)
503 if not n and b:
~/miniconda3/envs/ai4food/lib/python3.8/socket.py in readinto(self, b)
668 try:
--> 669 return self._sock.recv_into(b)
670 except timeout:
~/miniconda3/envs/ai4food/lib/python3.8/ssl.py in recv_into(self, buffer, nbytes, flags)
1240 self.class)
-> 1241 return self.read(nbytes, buffer)
1242 else:
~/miniconda3/envs/ai4food/lib/python3.8/ssl.py in read(self, len, buffer)
1098 if buffer is not None:
-> 1099 return self._sslobj.read(len, buffer)
1100 else:
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
ProtocolError Traceback (most recent call last)
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/requests/models.py in generate()
757 try:
--> 758 for chunk in self.raw.stream(chunk_size, decode_content=True):
759 yield chunk
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/urllib3/response.py in stream(self, amt, decode_content)
575 while not is_fp_closed(self._fp):
--> 576 data = self.read(amt=amt, decode_content=decode_content)
577
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/urllib3/response.py in read(self, amt, decode_content, cache_content)
540 # Content-Length are caught.
--> 541 raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
542
~/miniconda3/envs/ai4food/lib/python3.8/contextlib.py in exit(self, type, value, traceback)
130 try:
--> 131 self.gen.throw(type, value, traceback)
132 except StopIteration as exc:
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/urllib3/response.py in _error_catcher(self)
454 # This includes IncompleteRead.
--> 455 raise ProtocolError("Connection broken: %r" % e, e)
456
ProtocolError: ("Connection broken: ConnectionResetError(104, 'Connection reset by peer')", ConnectionResetError(104, 'Connection reset by peer'))
During handling of the above exception, another exception occurred:
ChunkedEncodingError Traceback (most recent call last)
in
----> 1 arch_path = download_archive(dslist[1])
~/data/ai4food/radiant_mlhub/client.py in download_archive(archive_id, output_dir, if_exists, api_key, profile)
502
503 try:
--> 504 return _download(
505 f'archive/{archive_id}',
506 output_dir=output_dir,
~/data/ai4food/radiant_mlhub/client.py in _download(url, output_dir, if_exists, chunk_size, api_key, profile)
129 with tqdm(total=round(content_length / 1000000., 1), unit='M') as pbar:
130 pbar.update(round(start / 1000000., 1))
--> 131 for chunk in executor.map(
132 partial(_fetch_range, download_url),
133 _get_ranges(content_length, chunk_size, start=start)
~/miniconda3/envs/ai4food/lib/python3.8/concurrent/futures/_base.py in result_iterator()
609 # Careful not to keep a reference to the popped future
610 if timeout is None:
--> 611 yield fs.pop().result()
612 else:
613 yield fs.pop().result(end_time - time.monotonic())
~/miniconda3/envs/ai4food/lib/python3.8/concurrent/futures/_base.py in result(self, timeout)
430 raise CancelledError()
431 elif self._state == FINISHED:
--> 432 return self.__get_result()
433
434 self._condition.wait(timeout)
~/miniconda3/envs/ai4food/lib/python3.8/concurrent/futures/_base.py in __get_result(self)
386 def __get_result(self):
387 if self._exception:
--> 388 raise self._exception
389 else:
390 return self._result
~/miniconda3/envs/ai4food/lib/python3.8/concurrent/futures/thread.py in run(self)
55
56 try:
---> 57 result = self.fn(*self.args, **self.kwargs)
58 except BaseException as exc:
59 self.future.set_exception(exc)
~/data/ai4food/radiant_mlhub/client.py in fetch_range(url, range_)
84 def fetch_range(url: str, range_: str) -> bytes:
85 """Internal function for fetching a byte range from the url."""
---> 86 return session.get(url_, headers={'Range': f'bytes={range_}'}).content
87
88 # Resolve user directory shortcuts and relative paths
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/requests/sessions.py in get(self, url, **kwargs)
553
554 kwargs.setdefault('allow_redirects', True)
--> 555 return self.request('GET', url, **kwargs)
556
557 def options(self, url, **kwargs):
~/data/ai4food/radiant_mlhub/session.py in request(self, method, url, **kwargs)
104 ).geturl()
105
--> 106 response = super().request(method, url, **kwargs)
107
108 # Handle authentication errors
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
540 }
541 send_kwargs.update(settings)
--> 542 resp = self.send(prep, **send_kwargs)
543
544 return resp
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/requests/sessions.py in send(self, request, **kwargs)
695
696 if not stream:
--> 697 r.content
698
699 return r
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/requests/models.py in content(self)
834 self._content = None
835 else:
--> 836 self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
837
838 self._content_consumed = True
~/miniconda3/envs/ai4food/lib/python3.8/site-packages/requests/models.py in generate()
759 yield chunk
760 except ProtocolError as e:
--> 761 raise ChunkedEncodingError(e)
762 except DecodeError as e:
763 raise ContentDecodingError(e)
ChunkedEncodingError: ("Connection broken: ConnectionResetError(104, 'Connection reset by peer')", ConnectionResetError(104, 'Connection reset by peer'))
Steps To Reproduce
from radiant_mlhub import Dataset
import time
ds = Dataset.fetch('dlr_fusion_competition_germany')
ds.download('data/')
A full example that can be used to reproduce the errror. DO NOT INCLUDE ANY SENSITIVE INFORMATION LIKE API KEYS.
Expected behavior
A clear and concise description of what you expected to happen.
Additional Context
If applicable, please add screenshots or any other information that might help us troubleshoot the problem. Also describe any attempted solutions or workarounds.