plynx-team / plynx

PLynx is a domain agnostic platform for managing reproducible experiments and data-oriented workflows.
https://plynx.com
Apache License 2.0
301 stars 37 forks source link

`pymongo.database.Database.authenticate()` has been dropped since pymongo 4.0 #129

Closed fwanghe closed 2 years ago

fwanghe commented 2 years ago

The mongodb connection fails when username and password are available in the config.yaml.

plynx-master-worker         | INFO:root:Try db connection
plynx-master-worker         | Traceback (most recent call last):
plynx-master-worker         |   File "<string>", line 1, in <module>
plynx-master-worker         |   File "/app/plynx/bin/__init__.py", line 15, in main
plynx-master-worker         |     args.func(kwargs)
plynx-master-worker         |   File "/app/plynx/bin/cli.py", line 48, in worker
plynx-master-worker         |     run_worker(**args)
plynx-master-worker         |   File "/app/plynx/service/worker.py", line 209, in run_worker
plynx-master-worker         |     check_connection()
plynx-master-worker         |   File "/app/plynx/utils/db_connector.py", line 59, in check_connection
plynx-master-worker         |     get_db_connector().client.server_info()
plynx-master-worker         |   File "/app/plynx/utils/db_connector.py", line 50, in get_db_connector
plynx-master-worker         |     _DB.authenticate(connection_config.user, connection_config.password)
plynx-master-worker         |   File "/usr/local/lib/python3.8/site-packages/pymongo/collection.py", line 3160, in __call__
plynx-master-worker         |     raise TypeError(
plynx-master-worker         | TypeError: 'Collection' object is not callable. If you meant to call the 'authenticate' method on a 'Database' object it is failing because no such method exists.
khaxis commented 2 years ago

Thank you! Your PR has been merged