Skip to content

pymongo.errors.OperationFailure: No keys found for HMAC that is valid for time #2871

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

Open
JustAnotherVeryNormalDeveloper opened this issue Feb 3, 2025 · 0 comments

Comments

@JustAnotherVeryNormalDeveloper
Copy link

JustAnotherVeryNormalDeveloper commented Feb 3, 2025

I have a program that worked all the time.
Another team made multiple changement on the servers hardware and IP.
Now it works 90% of the time.
10% of the time, the script fail.
I added 5 retries with time.sleep.
I upgraded pymongo version: 4.3.3 -> 4.10.1
It still happens (it feels to happen a little bit less but I have no proper way to test it easely).

Have you advices on how to improve this ? what this error means precisely? I am running out of ideas. :/

TRACE:

File \"/app/src/databases/servers/mongo_server_common.py\", line 18, in __init__", "    MongoServer.__init__(self, mongo_uri)", "  File \"/app/src/databases/servers/mongo_server.py\", line 14, in __init__", "    self._client = self.createMongoClient()", "  File \"/app/src/databases/servers/mongo_server.py\", line 34, in createMongoClient", "    client.server_info() # Test connection", "  File \"/usr/local/lib/python3.9/site-packages/pymongo/synchronous/mongo_client.py\", line 2125, in server_info", "    self.admin.command(", "  File \"/usr/local/lib/python3.9/site-packages/pymongo/_csot.py\", line 119, in csot_wrapper", "    return func(self, *args, **kwargs)", "  File \"/usr/local/lib/python3.9/site-packages/pymongo/synchronous/database.py\", line 930, in command", "    return self._command(", "  File \"/usr/local/lib/python3.9/site-packages/pymongo/synchronous/database.py\", line 770, in _command", "    return conn.command(", "  File \"/usr/local/lib/python3.9/site-packages/pymongo/synchronous/helpers.py\", line 45, in inner", "    return func(*args, **kwargs)", "  File \"/usr/local/lib/python3.9/site-packages/pymongo/synchronous/pool.py\", line 538, in command", "    return command(", "  File \"/usr/local/lib/python3.9/site-packages/pymongo/synchronous/network.py\", line 218, in command", "    helpers_shared._check_command_response(", "  File \"/usr/local/lib/python3.9/site-packages/pymongo/helpers_shared.py\", line 247, in _check_command_response", "    raise OperationFailure(errmsg, code, response, max_wire_version)", "pymongo.errors.OperationFailure: No keys found for HMAC that is valid for time: { ts: Timestamp(xxx, 2) } with id: xxx, full error: {'ok': 0.0, 'errmsg': 'No keys found for HMAC that is valid for time: { ts: Timestamp(xxx, 2) } with id: xxx', 'code': 211, 'codeName': 'KeyNotFound', '$clusterTime': {'clusterTime': Timestamp(xxx, 1), 'signature': {'hash': xxx', 'keyId': xxx}}, 'operationTime': Timestamp(xxx, 1)}"]}
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