Hello,
I’m trying to port a Python program from an HDFS back end to S3. Running some simple tests I’m getting an uncaught exception from TileDB. As the s3 back ends, I'm generally using minio for development, through I've reproduced the same issue using a Ceph object store. Here’s the condensed example:
tdmqc@3507db1a1ae5:/tdmq-dist$ python3
Python 3.6.9 (default, Oct 8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tiledb
>>> tiledb.__version__
'0.7.0
>>> service_info = {
... 'version' : '0.1',
... 'tiledb' : {
... 'storage.root' : 's3://firstbucket/',
... 'config': {
... "vfs.s3.aws_access_key_id": "tdm-user",
... "vfs.s3.aws_secret_access_key": "tdm-user-s3",
... "vfs.s3.endpoint_override": "minio:9000",
... "vfs.s3.scheme": "http",
... "vfs.s3.region": "",
... "vfs.s3.verify_ssl": "false",
... "vfs.s3.use_virtual_addressing": "false",
... "vfs.s3.use_multipart_upload": "false",
... "vfs.s3.logging_level": 'TRACE'
... }
... }
... }
>>> def clean_s3(tdmq_s3_service_info):
... import tiledb
... config = tiledb.Config(params=tdmq_s3_service_info['tiledb']['config'])
... bucket = tdmq_s3_service_info['tiledb']['storage.root']
... assert bucket.startswith('s3://')
... ctx = tiledb.Ctx(config=config)
... vfs = tiledb.VFS(ctx=ctx)
... if vfs.is_bucket(bucket):
... vfs.empty_bucket(bucket)
... else:
... vfs.create_bucket(bucket)
... return tdmq_s3_service_info
The first one or two times I call clean_s3(service_info)
it works fine.
>>> clean_s3(service_info)
log4j:WARN File option not set for appender [FSLOGGER].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?
{'version': '0.1', 'tiledb': {'storage.root': 's3://firstbucket/', 'config': {'vfs.s3.aws_access_key_id': 'tdm-user', 'vfs.s3.aws_secret_access_key': 'tdm-user-s3', 'vfs.s3.endpoint_override': 'minio:9000', 'vfs.s3.scheme': 'http', 'vfs.s3.region': '', 'vfs.s3.verify_ssl': 'false', 'vfs.s3.use_virtual_addressing': 'false', 'vfs.s3.use_multipart_upload': 'false', 'vfs.s3.logging_level': 'TRACE'}}}
>>> clean_s3(tdmq_s3_service_info)
{'version': '0.1', 'tiledb': {'storage.root': 's3://firstbucket/', 'config': {'vfs.s3.aws_access_key_id': 'tdm-user', 'vfs.s3.aws_secret_access_key': 'tdm-user-s3', 'vfs.s3.endpoint_override': 'minio:9000', 'vfs.s3.scheme': 'http', 'vfs.s3.region': '', 'vfs.s3.verify_ssl': 'false', 'vfs.s3.use_virtual_addressing': 'false', 'vfs.s3.use_multipart_upload': 'false', 'vfs.s3.logging_level': 'TRACE'}}}
Then something breaks. Further calls to the function result in an uncaught exception in TileDB:
>>> clean_s3(s3_service_info)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 8, in clean_s3
File "tiledb/libtiledb.pyx", line 5511, in tiledb.libtiledb.VFS.is_bucket
File "tiledb/libtiledb.pyx", line 481, in tiledb.libtiledb._raise_ctx_err
File "tiledb/libtiledb.pyx", line 466, in tiledb.libtiledb._raise_tiledb_error
tiledb.libtiledb.TileDBError: Error: Internal TileDB uncaught exception; basic_string::compare: __pos (which is 18446744073709551615) > this->size() (which is 4)
>>> clean_s3(service_info)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 8, in clean_s3
File "tiledb/libtiledb.pyx", line 5511, in tiledb.libtiledb.VFS.is_bucket
File "tiledb/libtiledb.pyx", line 481, in tiledb.libtiledb._raise_ctx_err
File "tiledb/libtiledb.pyx", line 466, in tiledb.libtiledb._raise_tiledb_error
tiledb.libtiledb.TileDBError: Error: Internal TileDB uncaught exception; basic_string::compare: __pos (which is 18446744073709551615) > this->size() (which is 4)
Once this happens I can't seem to do any s3 operation. Here are some other information I have collected:
- Reinitializing the tiledb context has no effect.
- Trying to reload the module has no effect (i.e.,
importlib.reload(tiledb)
).
- I can reproduce this with both minio and Ceph.
- Generally, things break after the first couple of times I've called the function, generally in quick succession. Sometimes it happens on the first call.
- I've tried distancing subsequent calls to
clean_s3
by as much as 15 seconds, but the thing still breaks.
- I'm running in Docker, in a custom ubuntu-based image. TileDB-Py is installed via
pip
.
- I have condensed this example from a more complicated scenario and another example I put together (which I posted in the forum. In those cases, the exception was being generated by
tiledb.object_type
and by tiledb.DenseArray.create
.
Given the value of _pos
, I guess it's got something to do with an unsigned type being used where a signed one is expected -- or maybe not. Let me know I can be of help.