You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to retrieve external blobs saved in a Linode (Akamai) bucket (S3). This works fine most of the time, but larger blobs seem to run into errors during fetch:
---------------------------------------------------------------------------OSErrorTraceback (mostrecentcalllast)
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/urllib3/response.py:444, inHTTPResponse._error_catcher(self)
443try:
-->444yield446exceptSocketTimeout:
447# FIXME: Ideally we'd like to include the url in the ReadTimeoutError but448# there is yet no clean way to get at it from this context.File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/urllib3/response.py:567, inHTTPResponse.read(self, amt, decode_content, cache_content)
566withself._error_catcher():
-->567data=self._fp_read(amt) ifnotfp_closedelseb""568ifamtisNone:
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/urllib3/response.py:533, inHTTPResponse._fp_read(self, amt)
531else:
532# StringIO doesn't like amt=None-->533returnself._fp.read(amt) ifamtisnotNoneelseself._fp.read()
File~/miniconda3/envs/octo_code/lib/python3.10/http/client.py:481, inHTTPResponse.read(self, amt)
480try:
-->481s=self._safe_read(self.length)
482exceptIncompleteRead:
File~/miniconda3/envs/octo_code/lib/python3.10/http/client.py:630, inHTTPResponse._safe_read(self, amt)
624"""Read the number of bytes requested. 625 626 This function should be used when <amt> bytes "should" be present for 627 reading. If the bytes are truly not available (due to EOF), then the 628 IncompleteRead exception can be used to detect the problem. 629 """-->630data=self.fp.read(amt)
631iflen(data) <amt:
File~/miniconda3/envs/octo_code/lib/python3.10/socket.py:705, inSocketIO.readinto(self, b)
704try:
-->705returnself._sock.recv_into(b)
706excepttimeout:
OSError: [Errno22] InvalidargumentDuringhandlingoftheaboveexception, anotherexceptionoccurred:
ProtocolErrorTraceback (mostrecentcalllast)
CellIn[34], line1---->1data_to_export= (CuttleHeadMantle&key).fetch1(data2retrieve)
2additional_data= (CuttleHeadMantle.Behavior&key).fetch1(additional_data_label)
4len(data_to_export)
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/datajoint/fetch.py:346, inFetch1.__call__(self, squeeze, download_path, *attrs)
344else: # fetch some attributes, return as tuple345attributes= [aforainattrsifnotis_key(a)]
-->346result=self._expression.proj(*attributes).fetch(
347squeeze=squeeze, download_path=download_path, format="array"348 )
349iflen(result) !=1:
350raiseDataJointError(
351"fetch1 should only return one tuple. %d tuples found"%len(result)
352 )
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/datajoint/fetch.py:289, inFetch.__call__(self, offset, limit, order_by, format, as_dict, squeeze, download_path, *attrs)
286raisee287fornameinheading:
288# unpack blobs and externals-->289ret[name] =list(map(partial(get, heading[name]), ret[name]))
290ifformat=="frame":
291ret=pandas.DataFrame(ret).set_index(heading.primary_key)
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/datajoint/fetch.py:111, in_get(connection, attr, data, squeeze, download_path)
103safe_write(local_filepath, data.split(b"\0", 1)[1])
104returnadapt(str(local_filepath)) # download file from remote store106returnadapt(
107uuid.UUID(bytes=data)
108ifattr.uuid109else (
110blob.unpack(
-->111extern.get(uuid.UUID(bytes=data)) ifattr.is_externalelsedata,
112squeeze=squeeze,
113 )
114ifattr.is_blob115elsedata116 )
117 )
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/datajoint/external.py:203, inExternalTable.get(self, uuid)
201ifblobisNone:
202try:
-->203blob=self._download_buffer(self._make_uuid_path(uuid))
204exceptMissingExternalFile:
205ifnotSUPPORT_MIGRATED_BLOBS:
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/datajoint/external.py:142, inExternalTable._download_buffer(self, external_path)
140def_download_buffer(self, external_path):
141ifself.spec["protocol"] =="s3":
-->142returnself.s3.get(external_path)
143ifself.spec["protocol"] =="file":
144returnPath(external_path).read_bytes()
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/datajoint/s3.py:71, inFolder.get(self, name)
69logger.debug("get: {}:{}".format(self.bucket, name))
70try:
--->71returnself.client.get_object(self.bucket, str(name)).data72exceptminio.error.S3Errorase:
73ife.code=="NoSuchKey":
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/urllib3/response.py:306, inHTTPResponse.data(self)
303returnself._body305ifself._fp:
-->306returnself.read(cache_content=True)
File~/miniconda3/envs/octo_code/lib/python3.10/site-packages/urllib3/response.py:566, inHTTPResponse.read(self, amt, decode_content, cache_content)
563flush_decoder=False564fp_closed=getattr(self._fp, "closed", False)
-->566withself._error_catcher():
567data=self._fp_read(amt) ifnotfp_closedelseb""568ifamtisNone:
File~/miniconda3/envs/octo_code/lib/python3.10/contextlib.py:153, in_GeneratorContextManager.__exit__(self, typ, value, traceback)
151value=typ()
152try:
-->153self.gen.throw(typ, value, traceback)
154exceptStopIterationasexc:
155# Suppress StopIteration *unless* it's the same exception that156# was passed to throw(). This prevents a StopIteration157# raised inside the "with" statement from being suppressed.158returnexcisnotvalueFile~/miniconda3/envs/octo_code/lib/python3.10/site-packages/urllib3/response.py:461, inHTTPResponse._error_catcher(self)
457raiseReadTimeoutError(self._pool, None, "Read timed out.")
459except (HTTPException, SocketError) ase:
460# This includes IncompleteRead.-->461raiseProtocolError("Connection broken: %r"%e, e)
463# If no exception is thrown, we should avoid cleaning up464# unnecessarily.465clean_exit=TrueProtocolError: ("Connection broken: OSError(22, 'Invalid argument')", OSError(22, 'Invalid argument'))
Reproducibility
Include:
OS: MacOS 13.3.1
Python 3.10
MySQL 8.0
MySQL Deployment Strategy: Docker
Datajoint python 0.13.8
The text was updated successfully, but these errors were encountered:
I am trying to retrieve external blobs saved in a Linode (Akamai) bucket (S3). This works fine most of the time, but larger blobs seem to run into errors during fetch:
Reproducibility
Include:
The text was updated successfully, but these errors were encountered: