# PBM Agent failed status

**URL:** <https://forums.percona.com/t/pbm-agent-failed-status/38764>\
**Category:** Percona Backup for MongoDB\
**Created:** [July 21, 2025, 11:58am UTC](https://forums.percona.com/t/pbm-agent-failed-status/38764 "2025-07-21T11:58:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aranjith0](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aranjith0/32/13012_2.png) [@aranjith0](https://forums.percona.com/u/aranjith0)\
**Post date:** [July 21, 2025, 11:58am UTC](https://forums.percona.com/t/pbm-agent-failed-status/38764/1 "2025-07-21T11:58:11Z")

</div>

Hi Team,

PBM agents are in failed status, even if i start it.. after sometime it went to failed state.  
I don’t find any error messages in the pbm logs.  
how to trouble shoot it.

```auto
[mongod@tora-pl211 ~]$ pbm status
Cluster:
========
shard3ReplSet:
  - shard3ReplSet/pmgo-pl206.int.compumark.com:27018 [P]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092393
  - shard3ReplSet/pmgo-pl205.int.compumark.com:27018 [S]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092394
  - shard3ReplSet/pmgo-pl201.int.compumark.com:27028 [S]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092394
shard2ReplSet:
  - shard2ReplSet/pmgo-pl204.int.compumark.com:27018 [P]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092393
  - shard2ReplSet/pmgo-pl202.int.compumark.com:27018 [S]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092394
  - shard2ReplSet/pmgo-pl205.int.compumark.com:27028 [S]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092394
configReplSet:
  - configReplSet/pmgo-pl204.int.compumark.com:27019 [S]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092394
  - configReplSet/pmgo-pl202.int.compumark.com:27019 [P]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092391
  - configReplSet/pmgo-pl206.int.compumark.com:27029 [S]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092393
shard1ReplSet:
  - shard1ReplSet/pmgo-pl203.int.compumark.com:27018 [P]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092393
  - shard1ReplSet/pmgo-pl201.int.compumark.com:27018 [S]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092394
  - shard1ReplSet/pmgo-pl202.int.compumark.com:27028 [S]: pbm-agent FAILED status:
      > ERROR with ERROR: lost agent, last heartbeat: 1753092394

```

```auto
[mongod@tora-pl211 ~]$ cat /etc/pbm_config.yaml
pitr:
  enabled: false
  oplogSpanMin: 0
  compression: s2
storage:
  type: s3
  s3:
    region: us-east-1
    bucket: cm-mongo- ******
    prefix: percona/backup/
    credentials:
      access-key-id: ***
      secret-access-key: *********
    maxUploadParts: 10000
    storageClass: STANDARD
    insecureSkipTLSVerify: false
    retryer:
      numMaxRetries: 10
      minRetryDelay: 60
      maxRetryDelay: 60

```

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [July 21, 2025, 12:07pm UTC](https://forums.percona.com/t/pbm-agent-failed-status/38764/2 "2025-07-21T12:07:06Z")

</div>

Hi, pbm logs are stored in journal usually. Can you check

```auto
journactl -u pbm-agent -f

```

also check that you have configured properly the pbm-agent URI so that each agents points to their local host

---

<div class="post-metadata">

**Author:** ![aranjith0](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aranjith0/32/13012_2.png) [@aranjith0](https://forums.percona.com/u/aranjith0)\
**Post date:** [July 21, 2025, 12:29pm UTC](https://forums.percona.com/t/pbm-agent-failed-status/38764/3 "2025-07-21T12:29:10Z")

</div>

> [@Ivan\_Groenewold](#):
>
> `journactl -u pbm-agent -f`

```auto
-- Logs begin at Tue 2025-07-15 03:23:38 CDT. --
Jul 15 08:23:47 tora-pl211 systemd[1]: Started pbm-agent.
Jul 15 08:24:18 tora-pl211 pbm-agent[4856]: 2025/07/15 08:24:18 Exit: connect to PBM: create mongo connection: ping: server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] }
Jul 15 08:24:18 tora-pl211 systemd[1]: pbm-agent.service: Main process exited, code=exited, status=1/FAILURE
Jul 15 08:24:18 tora-pl211 systemd[1]: pbm-agent.service: Failed with result 'exit-code'.

```

This is the pbm-agent URI used.

````auto
export PBM_MONGODB_URI="mongodb://pbmuser:pbmuser@pmgo-pl206.int.compumark.com:27029,pmgo-pl202.int.compumark.com:27019,pmgo-pl204.int.compumark.com:27019/?authSource=admin&replicaSet=configReplSet"```
````

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [July 21, 2025, 1:48pm UTC](https://forums.percona.com/t/pbm-agent-failed-status/38764/4 "2025-07-21T13:48:18Z")

</div>

The configuration of pbm-agent is not correct. It seems your replset runs on port 27029 but agent is pointed to 27017.

---

<div class="post-metadata">

**Author:** ![aranjith0](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aranjith0/32/13012_2.png) [@aranjith0](https://forums.percona.com/u/aranjith0)\
**Post date:** [July 23, 2025, 7:47am UTC](https://forums.percona.com/t/pbm-agent-failed-status/38764/5 "2025-07-23T07:47:53Z")

</div>

Not sure what’s wrong. the same setup works earlier for me.

Please assist how to fix it.

[mongod@tora-pl211 ~]$ echo $PBM\_MONGODB\_URI  
mongodb://pbmuser:pbmuser@pmgo-pl206.int.compumark.com:27029,[pmgo-pl202.int.compumark.com:27019](http://pmgo-pl202.int.compumark.com:27019),[pmgo-pl204.int.compumark.com:27019/?authSource=admin&replicaSet=configReplSet](http://pmgo-pl204.int.compumark.com:27019/?authSource=admin&replicaSet=configReplSet)

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [July 23, 2025, 12:59pm UTC](https://forums.percona.com/t/pbm-agent-failed-status/38764/6 "2025-07-23T12:59:29Z")

</div>

the variable PBM\_MONGODB\_URI only affects the current shell session. What I mean is to check the configuration of the pbm-agent that is installed on each node. In RHEL this is typically stored in /etc/sysconfig/pbm-agent.  
See this section if you have doubts: [Configure authentication in MongoDB - Percona Backup for MongoDB](https://docs.percona.com/percona-backup-mongodb/install/configure-authentication.html#set-the-mongodb-connection-uri-for-pbm-agent)
