Skip to main content

Hi all

I’m busy doing some MongoDB testing in our lab. I have a 3 node Mongo cluster. The backups work as required and I ran a restore succesfully.

I have 2 issues during a restore process. The first is that the Mongo services won’t restart post restore. I’ll spend more time investigating that, as it’s easy to manually bring the instance up.

When I try to run a point in time restore, I get the below error where the oplog won’t replay. From the looks of things, it looks like a permission issue. The account we’re using has the permissions below:

 

 

 

Error Code: 7:255]
Description: Failed to replay the oplog dump [/opt/commvault/iDataAgent/jobResults/CV_JobResults/2/0/3940/local/oplog_rs0_1677651150.bson] on mongod at port m27017] for replica set ors0]. mongorestore return code is r1], command output c2023-03-03T14:31:40.284+0200 preparing collections to restore from 2023-03-03T14:31:40.285+0200 replaying oplog 2023-03-03T14:31:40.286+0200 Failed: restore error: error applying oplog: applyOps: (Unauthorized) command applyOps requires authentication 2023-03-03T14:31:40.286+0200 0 document(s) restored successfully. 0 document(s) failed to restore. ]
Source: mongo2, Process: CVMongoDBUtil
 

 

Is there anything else I’m missing on the permissions side of things?

Hey @Mauro,

I’m no MongoDB expert but I found a case that maches your symtoms almost exactly. The issue was some parameters in the mongodb configuration file that caused the issue. The settings they had may not exactly match your issue but perhaps this is somewhere to start looking.

 

Customer had below option set in their MongoDB configuration file and this was not present in the commvault created config file, which caused the compressor issue. On setting the below registry key to pass the additional parameters while starting the server, restore completed successfully.
 

Option set in the MongoDB config file:

wiredTiger:

    engineConfig:

      journalCompressor: zlib

 

Registry key added:

sMongoDbRecoveryArgs

Path:iDataAgent

Type:String

- For a single argument: arg1 (converted to --arg1)
- For two or more arguments: arg1#arg2#..#argn (converted to --arg1 --arg2 --argn)
- For arguments with a value: arg1#arg2+arg2value#arg3 (converted to --arg1 --arg2 arg2value --arg3)

Value:wiredTigerJournalCompressor+zlib

 

https://documentation.commvault.com/additionalsetting/?q=sMongoDbRecoveryArgs

 


Hi

Just an update. I found additional information on the required permissions and have applied them with the same error. 

 

 


I just want to give a short update. We’ve created a custom role in Mongo and it seems to have resolved the restore error. I want to just complete a few more tests, before I post what we did.

 

 


Hi all

 

The solution to the oplog issue was to use the below permissions.
 

Use the built in dbAdmin and dbAdminAnyDatabase role.
For the oplog replay, create a custom role with anyAction on anyResource.

 

That sorts the issue out.


Reply