Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GridFSStore collection has no database attribute #733

Open
pmiam opened this issue Oct 24, 2022 · 1 comment
Open

GridFSStore collection has no database attribute #733

pmiam opened this issue Oct 24, 2022 · 1 comment
Labels

Comments

@pmiam
Copy link

pmiam commented Oct 24, 2022

Any atomate2 TaskDocument larger than the document limit cannot spill into gridfs additional stores successfully because the gridfs collection has no database property

Traceback (truncated):

Traceback (most recent call last):
  File "/home/pmangana/src/atomate2/a2a.py", line 124, in update_store
    s.update(data, key="uuid")
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/jobflow/core/store.py", line 325, in update
    self.docs_store.update(dict_docs, key=key)
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/maggma/stores/mongolike.py", line 487, in update
    raise e
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/maggma/stores/mongolike.py", line 475, in update
    self._collection.bulk_write(requests, ordered=False)
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/pymongo/_csot.py", line 105, in csot_wrapper
    return func(self, *args, **kwargs)
....
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/pymongo/message.py", line 1162, in _do_batched_op_msg
    return _batched_op_msg(operation, command, docs, ack, opts, ctx)
pymongo.errors.DocumentTooLarge: update command document too large

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pmangana/src/atomate2/a2a.py", line 97, in worker
    update_store(store=store, data=data)
  File "/home/pmangana/src/atomate2/a2a.py", line 123, in update_store
    with store as s:
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/maggma/core/store.py", line 351, in __exit__
    self.close()
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/jobflow/core/store.py", line 116, in close
    additional_store.close()
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/maggma/stores/gridfs.py", line 450, in close
    self._collection.database.client.close()
AttributeError: 'GridFS' object has no attribute 'database'

self._collection.database.client.close()

versions:
db> db.version()
6.0.2

I deployed the official docker container on an enterprise server.

conda list (truncated)
jobflow 0.1.7 pyhd8ed1ab_0 conda-forge
maggma 0.49.4 pyhd8ed1ab_0 conda-forge
atomate2 0.0.1.post912+g1fd2322 pypi_0 pypi (my fork main)
pymongo 4.2.0 pypi_0 pypi

In context, I've written a very simple script to try backfilling a database with legacy vasp runs, obviously there's some shortcomings to this, but this cannot be one of them. Very new to all this. Advice appreciated.

@munrojm
Copy link
Member

munrojm commented Oct 25, 2022

Hi @PanayotisManganaris. I will take a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants