# Unable to take incremental/physical backup using pbm

**URL:** https://forums.percona.com/t/unable-to-take-incremental-physical-backup-using-pbm/36355
**Category:** Percona Backup for MongoDB
**Tags:** pbm
**Created:** [January 27, 2025, 9:12am UTC](https://forums.percona.com/t/unable-to-take-incremental-physical-backup-using-pbm/36355 "2025-01-27T09:12:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![turbozjeb](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@turbozjeb](https://forums.percona.com/u/turbozjeb)
#### Post date: [January 27, 2025, 9:12am UTC](https://forums.percona.com/t/unable-to-take-incremental-physical-backup-using-pbm/36355/1 "2025-01-27T09:12:05Z")

</div>

Hi,

I’m testing backups using the PBM agent. Logical backups work without any issues, but I’m unable to perform physical or incremental backups.

I’ve read that to use these types of backups, I need to use PSMDB. I can confirm that I’m using this distribution in version 8.0.4.

For example, when trying to perform an incremental backup, I get the following output:

```auto
bash-5.1$ pbm backup --wait --type incremental --base
Starting backup '2025-01-27T08:55:02Z'....
Waiting for '2025-01-27T08:55:02Z' backup... error
Error: upload data files: upload file `/mongodb/data/db/journal/WiredTigerLog.0000000033`: get file stat: stat /mongodb/data/db/journal/WiredTigerLog.0000000033: no such file or directory

```

The logs look like this:

```auto
2025-01-27T08:55:03.000+0000 I got command backup [name: 2025-01-27T08:55:02Z, compression: s2 (level: default)] <ts: 1737968102>, opid: 679749e60ea13dc92517970b
2025-01-27T08:55:03.000+0000 I got epoch {1737967784 8}
2025-01-27T08:55:03.000+0000 D [backup/2025-01-27T08:55:02Z] init backup meta
2025-01-27T08:55:03.000+0000 D [backup/2025-01-27T08:55:02Z] nomination list for rs0: [[mongodb-primary:27017]]
2025-01-27T08:55:03.000+0000 D [backup/2025-01-27T08:55:02Z] nomination rs0, set candidates [mongodb-primary:27017]
2025-01-27T08:55:04.000+0000 I [backup/2025-01-27T08:55:02Z] backup started
2025-01-27T08:55:05.000+0000 D [backup/2025-01-27T08:55:02Z] flush incremental backup history
2025-01-27T08:55:05.000+0000 D [backup/2025-01-27T08:55:02Z] backup cursor id: 2b430e29-b2dd-4376-91ec-319768a02790
2025-01-27T08:55:07.000+0000 D [backup/2025-01-27T08:55:02Z] set journal up to {1737968105 2}
2025-01-27T08:55:07.000+0000 I [backup/2025-01-27T08:55:02Z] uploading data
2025-01-27T08:55:07.000+0000 I [backup/2025-01-27T08:55:02Z] mark RS as error `upload data files: upload file `/mongodb/data/db/journal/WiredTigerLog.0000000033`: get file stat: stat /mongodb/data/db/journal/WiredTigerLog.0000000033: no such file or directory`: <nil>
2025-01-27T08:55:07.000+0000 I [backup/2025-01-27T08:55:02Z] mark backup as error `upload data files: upload file `/mongodb/data/db/journal/WiredTigerLog.0000000033`: get file stat: stat /mongodb/data/db/journal/WiredTigerLog.0000000033: no such file or directory`: <nil>
2025-01-27T08:55:07.000+0000 E [backup/2025-01-27T08:55:02Z] backup: upload data files: upload file `/mongodb/data/db/journal/WiredTigerLog.0000000033`: get file stat: stat /mongodb/data/db/journal/WiredTigerLog.0000000033: no such file or directory
2025-01-27T08:55:07.000+0000 D [backup/2025-01-27T08:55:02Z] releasing lock
2025-01-27T08:55:07.000+0000 D [backup/2025-01-27T08:55:02Z] stop cursor polling: <nil>, cursor err: <nil>

```

I inspected the database’s filesystem and can confirm that the file existed before starting the backup, but after PBM reported the error, the file name changed from `33` to `35`.

Currently, I have a single instance of PSMDB with an initialized replica set.

I can confirm that I created the required role and user according to the documentation.

Here is the connection string I’m using:

```auto
mongodb://pbmuser:secretpwd@mongodb:27017/?authSource=admin

```

My config file

```auto
storage:
  type: filesystem
  filesystem:
    path: /pbm/backup
pitr:
  enabled: true
  oplogSpanMin: 10
  compression: s2
backup:
  oplogSpanMin: 0
  compression: s2
restore:
  batchSize: 500
  numInsertionWorkers: 10
  mongodLocation: /opt/pbm/bin/mongod

```

Running in container environment, pbm-agent and mongo are in separated containers

---

<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: [January 27, 2025, 1:38pm UTC](https://forums.percona.com/t/unable-to-take-incremental-physical-backup-using-pbm/36355/2 "2025-01-27T13:38:02Z")

</div>

Hi, for physical backups, pbm container needs to access the data volume and also to run under the same user id as mongod. Please see [Run in Docker - Percona Backup for MongoDB](https://docs.percona.com/percona-backup-mongodb/install/docker.html?h=docker#prerequisites) for more details

---

<div class="post-metadata">

### Author: ![turbozjeb](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@turbozjeb](https://forums.percona.com/u/turbozjeb)
#### Post date: [January 27, 2025, 1:50pm UTC](https://forums.percona.com/t/unable-to-take-incremental-physical-backup-using-pbm/36355/3 "2025-01-27T13:50:09Z")

</div>

Hi, thanks for your answer

Please be informed that these processes run with the same uid

psmdb

```auto
bash-5.1$ id
uid=1001(1001) gid=0(root) groups=0(root),1001(1001)
bash-5.1$ whoami
1001
bash-5.1$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
1001 1 1.1 0.7 4061508 205272 ? SLsl 13:43 0:01 /opt/mongodb/bin/mongod --config=/opt/mongodb/conf/mongodb.conf

```

pbm

```auto
bash-5.1$ id
uid=1001(1001) gid=0(root) groups=0(root),1001(1001)
bash-5.1$ whoami
1001
bash-5.1$ ps aux
bash: ps: command not found
bash-5.1$ top
bash: top: command not found
bash-5.1$ cat /proc/1/status | grep Uid
Uid: 1001 1001 1001 1001

```

---

<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: [January 27, 2025, 1:52pm UTC](https://forums.percona.com/t/unable-to-take-incremental-physical-backup-using-pbm/36355/4 "2025-01-27T13:52:38Z")

</div>

does PBM container also have read-write access to MongoDB data volume ?

---

<div class="post-metadata">

### Author: ![turbozjeb](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@turbozjeb](https://forums.percona.com/u/turbozjeb)
#### Post date: [January 27, 2025, 1:57pm UTC](https://forums.percona.com/t/unable-to-take-incremental-physical-backup-using-pbm/36355/5 "2025-01-27T13:57:35Z")

</div>

> [@Ivan\_Groenewold](#):
>
> for physical backups, pbm container needs to access the data volume and also to run under

Shoud I mount mongodb data volume right into pbm container or the read write operations are going to be executed via network?

---

<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: [January 27, 2025, 2:01pm UTC](https://forums.percona.com/t/unable-to-take-incremental-physical-backup-using-pbm/36355/6 "2025-01-27T14:01:59Z")

</div>

it should be mounted

---

<div class="post-metadata">

### Author: ![turbozjeb](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@turbozjeb](https://forums.percona.com/u/turbozjeb)
#### Post date: [January 27, 2025, 2:14pm UTC](https://forums.percona.com/t/unable-to-take-incremental-physical-backup-using-pbm/36355/7 "2025-01-27T14:14:51Z")

</div>

Jesus Christ, I thought these operation are gonna be established via network, instead of local file system.

Thank you so much for your assistance

Mounting data volume in the same path as it is on mongodb container to the pbm container resolved an issue
