Getting below error during restore on latest mongodb version 6.0.14
“2024-07-17T13:56:35.294+0500 Failed: restore error: error applying oplog: applyOps: (KeyNotFound) No keys found for HMAC that is valid for time: { ts: Timestamp(1721206595, 5) } with id: 0
2024-07-17T13:56:35.294+0500 0 document(s) restored successfully. 0 document(s) failed to restore.”
Hi there!
Since there wasn’t a reply to your message, I tried to run it by our documentation bot. Here is the response I got
Based on the error message you provided, it seems that you are encountering a “KeyNotFound” error during the restore process. This error occurs when MongoDB is unable to find the keys necessary for the HMAC validation during the restore.
To restore without encountering this error, you can try the following steps:
- Make sure that the data files stored in your backup medium are accessible on the host. This may involve mounting the backup volume or extracting the data to disk using a software utility or another tool.
- Copy the
mongod
data files from the backup data location to the data directory on the target host. You can use the following command to copy the files:
cp -a /backup/mongodb/path/to/mongodb /path/to/mongodb
The -a
option recursively copies the contents of the source path to the destination path while preserving folder and file permissions.
3. Comment out or omit the following configuration file settings in the mongod.conf
file:
# replication# replSetName: myShardName# sharding# clusterRole: shardsvr
- Start the
mongod
process using the--config
option to specify the full path to the configuration file:
mongod --config /path/to/mongodb/mongod.conf
If you are restoring from a namespace-filtered snapshot, you should also specify the --restore
option:
mongod --config /path/to/mongod/mongod.conf --restore
If you are performing a manual restoration of a Cloud Manager or Ops Manager backup, you need to specify the disableLogicalSessionCacheRefresh
server parameter prior to startup:
mongod --config /path/to/mongodb/mongod.conf \ --setParameter disableLogicalSessionCacheRefresh=true
If you have mongod
configured to run as a system service, start it using the recommended process for your system service manager.
5. Once the mongod
process starts, you can connect to it using the mongo
shell to verify the restore process.
Please note that these steps are based on the MongoDB documentation for restoring a sharded cluster. If you are not restoring a sharded cluster or if these steps do not resolve the issue, please provide more details
Related resources:
New & Unread Topics
Topic | Replies | Views | Activity |
---|---|---|---|
mongocxx generate build files failed | 2 | 668 | May 2024 |
Using OpenAI Latest Embeddings In A RAG System With MongoDB community Edition | 1 | 476 | May 2024 |
Error “Invalid UTF-8 string in BSON document” after rebuild on Windows | 0 | 150 | Aug 2024 |
SERVER RUNNING PROBLEM | 0 | 35 | Jan 2 |
Issue Restoring Data After Upgrading MongoDB from 4.4.29 to 8.0.3 | 1 | 41 | Mar 5 |