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

error occur when inserting example Li2O into db: “pymongo.errors.OperationFailure: Authentication failed” #97

Open
wangzyphysics opened this issue Feb 27, 2024 · 0 comments

Comments

@wangzyphysics
Copy link

Describe the bug
after i config the db.json and download Li2O example, when i run code
mgdb insert -c db.json Li2O

Traceback (most recent call last):
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/bin/mgdb", line 442, in <module>
    args.func(args)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/bin/mgdb", line 64, in update_db
    drone = VaspToDbTaskDrone(
  File "/public/home/gaobo/honglin/atomate2/pymatgendb-test/package/pymatgen-db/pymatgen/db/creator.py", line 173, in __init__
    if self.db.counter.count_documents({"_id": "taskid"}) == 0:
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/collection.py", line 1913, in count_documents
    return self._retryable_non_cursor_read(_cmd, session)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/collection.py", line 1923, in _retryable_non_cursor_read
    return client._retryable_read(func, self._read_preference_for(s), s)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1492, in _retryable_read
    return self._retry_internal(
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/_csot.py", line 107, in csot_wrapper
    return func(self, *args, **kwargs)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1462, in _retry_internal
    ).run()
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/mongo_client.py", line 2315, in run
    return self._read() if self._is_read else self._write()
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/mongo_client.py", line 2439, in _read
    with self._client._conn_from_server(self._read_pref, self._server, self._session) as (
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1330, in _conn_from_server
    with self._checkout(server, session) as conn:
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/mongo_client.py", line 1252, in _checkout
    with server.checkout(handler=err_handler) as conn:
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/pool.py", line 1637, in checkout
    conn = self._get_conn(handler=handler)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/pool.py", line 1756, in _get_conn
    conn = self.connect(handler=handler)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/pool.py", line 1607, in connect
    conn.authenticate()
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/pool.py", line 1078, in authenticate
    auth.authenticate(creds, self, reauthenticate=reauthenticate)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/auth.py", line 625, in authenticate
    auth_func(credentials, conn)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/auth.py", line 530, in _authenticate_default
    return _authenticate_scram(credentials, conn, "SCRAM-SHA-1")
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/auth.py", line 257, in _authenticate_scram
    res = conn.command(source, cmd)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/helpers.py", line 322, in inner
    return func(*args, **kwargs)
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/pool.py", line 968, in command
    return command(
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/network.py", line 192, in command
    helpers._check_command_response(
  File "/public/home/gaobo/lihl/miniconda3/envs/pmdb-test/lib/python3.10/site-packages/pymongo/helpers.py", line 230, in _check_command_response
    raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'}

To Reproduce
Steps to reproduce the behavior:

  1. create a new python env
  2. install the pymatgen-db from github by downloading zip file, then pip install -e . to install
  3. after finishing db.json, I try to insert Li2O into db, and the error occur
  4. I have check the username, password, host, port and databasename by pymongo interface and it can make connection with mongodb

Provide any example files that are needed to reproduce the error,
especially if the bug pertains to parsing of a file.

Expected behavior
None

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • NAME="CentOS Linux"
  • VERSION="7 (Core)"
  • Python 3.10.13
  • pymatgen 2024.2.23
  • pymatgen-db 2023.7.18
  • pymongo 4.6.2
  • MongoDB 7.0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant