# Unable to execute any pbm commands

**URL:** <https://forums.percona.com/t/unable-to-execute-any-pbm-commands/17316>\
**Category:** Percona Backup for MongoDB\
**Created:** [September 5, 2022, 8:33pm UTC](https://forums.percona.com/t/unable-to-execute-any-pbm-commands/17316 "2022-09-05T20:33:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Heckel](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/tim_heckel/32/5834_2.png) [@Tim\_Heckel](https://forums.percona.com/u/Tim_Heckel)\
**Post date:** [September 5, 2022, 8:33pm UTC](https://forums.percona.com/t/unable-to-execute-any-pbm-commands/17316/1 "2022-09-05T20:33:14Z")

</div>

Hi - I’ve installed the pbm backup agent via helm and have confirmed backups are getting saved to my s3 bucket, but I am unable to run any pbm command while running in the terminal on any of the backup-agents.

When I run pbm status like this:

```auto
pbm status --mongodb-uri="mongodb://userAdmin:xxx@localhost:27017/admin?replicaSet=rs0&authSource=admin"

```

I consistently get an unauthorized error like this (obviously I’m using the correct password):

```auto
Error: connect to mongodb: setup a new backups db: ensure cmd collection: (Unauthorized) not authorized on admin to execute command { create: "pbmCmd", capped: true, size: 1048576, lsid: { id: UUID("2740453e-daa1-43fc-af5a-70ece30da84c") }, $clusterTime: { clusterTime: Timestamp(1662409558, 2), signature: { hash: BinData(0, D368D32A3078885405C2CB9D2900A83C5A120495), keyId: 7102840975084486657 } }, $db: "admin", $readPreference: { mode: "primary" } }

```

I am able to connect to mongo using the same credentials from the same ssh session like this:

```auto
 mongo "mongodb://userAdmin:xxx@localhost:27017/admin?replicaSet=rs0&authSource=admin"

```

And can create collections, etc.

I’d like to be able to list and restore backups…I appreciate any help!

Tim

---

<div class="post-metadata">

**Author:** ![Andrew\_Pogrebnoi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrew_pogrebnoi/32/77_2.png) [@Andrew\_Pogrebnoi](https://forums.percona.com/u/Andrew_Pogrebnoi)\
**Post date:** [September 6, 2022, 12:03pm UTC](https://forums.percona.com/t/unable-to-execute-any-pbm-commands/17316/2 "2022-09-06T12:03:35Z")

</div>

Hi @Tim_Heckel,  
Is this a single replica set or a shared cluster?  
Can you try `pbm status --mongodb-uri="mongodb://userAdmin:xxx@localhost:27017/` ?

---

<div class="post-metadata">

**Author:** ![Tim\_Heckel](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/tim_heckel/32/5834_2.png) [@Tim\_Heckel](https://forums.percona.com/u/Tim_Heckel)\
**Post date:** [September 8, 2022, 9:16pm UTC](https://forums.percona.com/t/unable-to-execute-any-pbm-commands/17316/3 "2022-09-08T21:16:58Z")

</div>

Hi Andrew - thank you - it is a replica set, the result of the standalone is unfortunately the same as the replica connection.

```auto
pbm status --mongodb-uri="mongodb://userAdmin:xxx@localhost:27017/admin?authSource=admin"

```

Perhaps an outlier here is that this cluster is running on [k3](https://k3s.io/) instead of k8, using [MicroOS](https://microos.opensuse.org/) as the operating system. I use [this project](https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner) to create the cluster.

Thanks so much for any pointers!

Tim
