[Atlas] Authentication failed for running compact command on oplog.rs with atlasAdmin role

Finally, after paying for support, i was sent an article with all the necessary steps.

The main issue the OP (and myself ) where having, is that the “dbAdmin” role has to be specifically added on “local” database as a Custom Role, and then assign it to the user performing the actions on the DB.

This doesn’t appear on the community documentation, and it would be nice to add it for future reference.

Then you can issue the compact command as db.runCommand({compact: “oplog.rs”}) on the secondaries. For the primary, you will have to use the Test Failover feature, then proceed as with the secondaries.

1 Like