Mongorestore command always fails with expected an object

I am using MongoDB version 4.4.
mongodump and mongorestore version: 100.1.0

mongorestore --port 27017 --oplogReplay “/365784/local/oplog_replay_input”
[2020-10-09T15:12:08.618+0530 preparing collections to restore from
2020-10-09T15:12:08.618+0530 replaying oplog
2020-10-09T15:12:08.676+0530 Failed: restore error: error applying oplog: applyOps: (Location10065) invalid parameter: expected an object ()
2020-10-09T15:12:08.676+0530 0 document(s) restored successfully. 0 document(s) failed to restore.
]

# bsondump oplog.bson
.
.
2020-10-09T15:19:47.624+0530    1350 objects found

It again failed with this error. This is just the dump of oplog collection that is being applied during restore.

mongorestore --port 27019 --oplogReplay “365916/local/oplog_replay_input”
2020-10-09T18:31:41.317+0530 preparing collections to restore from
2020-10-09T18:31:41.318+0530 replaying oplog
2020-10-09T18:31:41.392+0530 Failed: restore error: error applying oplog: applyOps: (Location40528) Direct writes against config.transactions cannot be performed using a transaction or on a session.
2020-10-09T18:31:41.392+0530 0 document(s) restored successfully. 0 document(s) failed to restore.

Hi,

Anyone can help on this. Seeing the below error again while applying the dump of the oplog collection.

Failed: restore error: error applying oplog: applyOps: (Location40528) Direct writes against config.transactions cannot be performed using a transaction or on a session.

Thanks,
Akshaya Srinivasan

I am also getting the same error while running mongodb restore -
restore command is: /mongodb44_software/mongodb-linux-x86_64-rhel70-4.4.1//bin/mongorestore --authenticationDatabase admin --port 27017 -u mongo-root --oplogReplay /tmp/era_recovery_staging_area/logs_0/20220117174232_20220117175522/local/oplog.rs.bson --oplogLimit 1642444226:0 --verbose -p
2022-01-18T12:38:15.526+0530 using write concern: &{majority false 0}
2022-01-18T12:38:15.545+0530 checking for collection data in /tmp/era_recovery_staging_area/logs_0/20220117174232_20220117175522/local/oplog.rs.bson
2022-01-18T12:38:15.545+0530 found metadata for collection at /tmp/era_recovery_staging_area/logs_0/20220117174232_20220117175522/local/oplog.rs.metadata.json
2022-01-18T12:38:15.545+0530 replaying oplog
2022-01-18T12:38:15.550+0530 skipping applying the config.system.sessions namespace in applyOps
2022-01-18T12:38:15.550+0530 skipping applying the config.system.sessions namespace in applyOps
2022-01-18T12:38:15.550+0530 skipping applying the config.system.sessions namespace in applyOps
2022-01-18T12:38:15.552+0530 skipping applying the config.system.sessions namespace in applyOps
2022-01-18T12:38:15.552+0530 skipping applying the config.system.sessions namespace in applyOps
2022-01-18T12:38:15.554+0530 Failed: restore error: error applying oplog: applyOps: (Location40528) Direct writes against config.transactions cannot be performed using a transaction or on a session.

Did you find any solution for this, I am also getting the same error

I was getting a similar error message when running mongorestore V2.6 on a backup:

assertion: 10065 invalid parameter: expected an object (options)

While the backup I was trying to restore came from a V2.6 replica set, it turns out the dump was unexpectedly taken with mongodump V4.2