PBM restore mongo 6 failed

PBM 2.1.0 Mongo 6
Error: operation failed with: swap users ‘n’ roles: delete current roles: (Unauthorized) not authorized on admin to execute command { delete: “system.roles”, ordered: true, lsid: { id: UUID(“e62f7783-866d-4bc4-996f-c989bef9ee2e”) }, $clusterTime: { clusterTime: Timestamp(1681895759, 4), signature: { hash: BinData(0, 2FC265DC20F7B58B08ABC16BF1DDDD61513442C7), keyId: 7223636036931289094 } }, $db: “admin” }

When I use root also get this error.

Any ideas?

After I add the role __system to the root user then restore the success

The __system role is a built-in role in MongoDB that grants privileges required for system actions, such as creating or modifying indexes or working with the system collection.
So looks like you restored systems collections and that is why such permission was required


I think the error is from the method, swapUsers it will delete roles from the collection system.roles
PBM need to handle the system.roles