# Logical Backup with TLS Cluster fails

**URL:** <https://forums.percona.com/t/logical-backup-with-tls-cluster-fails/31980>\
**Category:** Percona Backup for MongoDB\
**Created:** [August 2, 2024, 2:25pm UTC](https://forums.percona.com/t/logical-backup-with-tls-cluster-fails/31980 "2024-08-02T14:25:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ltouve](https://avatars.discourse-cdn.com/v4/letter/l/f14d63/32.png) [@ltouve](https://forums.percona.com/u/ltouve)\
**Post date:** [August 2, 2024, 2:25pm UTC](https://forums.percona.com/t/logical-backup-with-tls-cluster-fails/31980/1 "2024-08-02T14:25:56Z")

</div>

Running version 2.1 of the pbm agent  
Percona MongoDB sharded cluster with TLS and X509 authentication (version 6.0.6-5)

We are able to perform the following types of backups:

- physical (pbm backup --type=physical)
- incremental base (pbm backup --type=incremental --base)
- incremental (pbm backup --type=incremental)
- incremental base with NS (pbm backup --type=incremental --base --ns=dbname.\*)
- incremental with NS (pbm backup --type=incremental --ns=dbname.\*)

Note that incremental base with NS appears to be the same as incremental base (entire cluster)

However, when we attempt a logical backup or logical with namespace we get the following error:

```auto
Starting backup '2024-08-02T13:59:43Z'...
Waiting for ''2024-08-02T13:59:43Z' backup... fails
Error: mongodump: decompose: prelude: read: I/O failure reading beginning of archive: write to: init: can't create session: error configuring the connector: error configuring client, can't load client certificate: tls: private key does not match public key

```

We can log in to the cluster ($ mongosh …) using the same keys as we have in the mongodb-uri: PBM\_MONGODB\_URI=mongodb://localhost:27017/?tls&tlsCAFile=&tlsCertificateKeyFile=&authMechanism=MONGODB-X509&authSource=$external

Is there something wrong with the cluster configuration, or maybe with the agent configuration? All the other pbm commands work fine (status, cleanup, delete-backup, etc.).

---

<div class="post-metadata">

**Author:** ![oleksandr.havryliak](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/oleksandr.havryliak/32/5703_2.png) [@oleksandr.havryliak](https://forums.percona.com/u/oleksandr.havryliak)\
**Post date:** [August 5, 2024, 2:15pm UTC](https://forums.percona.com/t/logical-backup-with-tls-cluster-fails/31980/2 "2024-08-05T14:15:48Z")

</div>

Hi @ltouve!  
I suggest you to upgrade PBM to the latest version.  
Your issue looks very similar to [https://jira.mongodb.org/browse/TOOLS-2598](https://jira.mongodb.org/browse/TOOLS-2598)  
Since PBM depends on mongo-tools and in PBM 2.1.0 we have older version of the mongo-tools library - the problem you described might occur.  
Unaffected mongo-tools library was included in PBM version [2.3.0](https://github.com/percona/percona-backup-mongodb/pull/869)

---

<div class="post-metadata">

**Author:** ![ltouve](https://avatars.discourse-cdn.com/v4/letter/l/f14d63/32.png) [@ltouve](https://forums.percona.com/u/ltouve)\
**Post date:** [August 6, 2024, 12:18pm UTC](https://forums.percona.com/t/logical-backup-with-tls-cluster-fails/31980/3 "2024-08-06T12:18:24Z")

</div>

Thanks, that did the trick. Everything is working fine now.
