Hi,
I had just solved the problem by degrading pymongo to version 3.11! Thank you!

Best regards,
Zhang
________________________________
发件人: Zhang Li <terminal.zhan...@outlook.com>
发送时间: Sunday, December 26, 2021 8:46:43 PM
收件人: gem5-users@gem5.org <gem5-users@gem5.org>
主题: Errors when using gem5art

Hi Jason or Ayaz,
    I recently read your gem5art paper and documents about gem5art in 
https://gem5art.readthedocs.io/en/latest/main-doc/artifacts.html. I used a 
virtual envioronment as tutorials. But I encountered a problem when I try to 
connect to MongoDB. Below is my output. I found that disable_md5 parameter was 
removed in pymongo v4.0 in 
https://pymongo.readthedocs.io/en/stable/api/gridfs/index.html. I tried to 
remove disable_md5 parameter and then there was no error when connecting 
database. But when I tried to register a artifact, another error occurred as 
the following traceback. I have no idea to solve the problem. Maybe someone 
else have experience working with gem5art? Can I get some advice or I made a 
wrong way in using gem5art? I am looking forward to your reply. Thank you!

Best regard,
Zhang


Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gem5art.artifact import *
>>> db = getDBConnection()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/gem5art/artifact/_artifactdb.py",
 line 247, in getDBConnection
    _db = typ(uri)
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/gem5art/artifact/_artifactdb.py",
 line 133, in __init__
    self.fs = gridfs.GridFSBucket(self.db, disable_md5=True)
TypeError: __init__() got an unexpected keyword argument 'disable_md5'
>>>


Traceback (most recent call last):
  File "launch_boot_tests.py", line 16, in <module>
    packer = Artifact.registerArtifact(
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/gem5art/artifact/artifact.py",
 line 187, in registerArtifact
    _db.upload(self._id, self.path)
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/gem5art/artifact/_artifactdb.py",
 line 143, in upload
    self.fs.upload_from_stream_with_id(key, str(path), f)
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/gridfs/__init__.py",
 line 668, in upload_from_stream_with_id
    gin.write(source)
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/gridfs/grid_file.py",
 line 411, in __exit__
    self.close()
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/gridfs/grid_file.py",
 line 320, in close
    self.__flush()
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/gridfs/grid_file.py",
 line 304, in __flush
    return self._coll.files.insert_one(
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/collection.py",
 line 524, in insert_one
    self._insert_one(
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/collection.py",
 line 474, in _insert_one
    self.__database.client._retryable_write(
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/mongo_client.py",
 line 1340, in _retryable_write
    return self._retry_with_session(retryable, func, s, None)
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/mongo_client.py",
 line 1229, in _retry_with_session
    return self._retry_internal(retryable, func, session, bulk)
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/mongo_client.py",
 line 1261, in _retry_internal
    return func(session, sock_info, retryable)
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/collection.py",
 line 462, in _insert_command
    result = sock_info.command(
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/pool.py",
 line 735, in command
    self._raise_connection_failure(error)
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/pool.py",
 line 719, in command
    return command(self, dbname, spec, secondary_ok,
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/network.py",
 line 118, in command
    request_id, msg, size, max_doc_size = message._op_msg(
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/pymongo/message.py",
 line 597, in _op_msg
    return _op_msg_uncompressed(
  File 
"/home/terminal/work/boot-tests/venv/lib/python3.8/site-packages/bson/binary.py",
 line 251, in from_uuid
    raise ValueError(
ValueError: cannot encode native uuid.UUID with UuidRepresentation.UNSPECIFIED. 
UUIDs can be manually converted to bson.Binary instances using 
bson.Binary.from_uuid() or a different UuidRepresentation can be configured. 
See the documentation for UuidRepresentation for more information.
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to