[SOLVED] Cant backup only unprivileged container I have.

DVDIsDead

New Member
Dec 19, 2021
11
1
3
30
Code:
INFO: starting new backup job: vzdump 125 --notes-template '{{guestname}}' --remove 0 --compress zstd --mode stop --node pve --storage raid1-backups
INFO: filesystem type on dumpdir is '-' -using /var/tmp/vzdumptmp4105384_125 for temporary files
INFO: Starting Backup of VM 125 (lxc)
INFO: Backup started at 2022-11-08 20:05:20
INFO: status = stopped
INFO: backup mode: stop
INFO: ionice priority: 7
INFO: CT Name: mailserver
INFO: including mount point rootfs ('/') in backup
INFO: excluding bind mount point mp0 ('/Storage') from backup (not a volume)
INFO: creating vzdump archive '/backups/proxmox/dump/vzdump-lxc-125-2022_11_08-20_05_20.tar.zst'
INFO: tar: ./dev/lxc-125.log: Cannot open: Permission denied
INFO: Total bytes written: 3133184000 (3.0GiB, 19MiB/s)
INFO: tar: Exiting with failure status due to previous errors
ERROR: Backup of VM 125 failed - command 'set -o pipefail && lxc-usernsexec -m u:0:100000:1000 -m g:0:100000:1000 -m u:1000:1000:1 -m g:1000:1000:1 -m u:1001:101001:64534 -m g:1001:101001:64534 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' --one-file-system '--warning=no-file-ignored' '--directory=/var/tmp/vzdumptmp4105384_125' ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw '--directory=/mnt/vzsnap0' --no-anchored '--exclude=lost+found' --anchored '--exclude=./tmp/?*' '--exclude=./var/tmp/?*' '--exclude=./var/run/?*.pid' ./ | zstd --rsyncable '--threads=1' >/backups/proxmox/dump/vzdump-lxc-125-2022_11_08-20_05_20.tar.dat' failed: exit code 2
INFO: Failed at 2022-11-08 20:08:03
INFO: Backup job finished with errors
job errors
 
Hello,

Can you please try to set the `tmpdir` variable in the `/etc/vzdump.conf` to a world writable such as /tmp and test the backup again?
 
no change, but I just realized the console in proxmox web interface no longer works for any container however SSH works fine:
Code:
failed waiting for client: timed out
TASK ERROR: command '/usr/bin/termproxy 5900 --path /vms/125 --perm VM.Console -- /usr/bin/dtach -A /var/run/dtach/vzctlconsole125 -r winch -z lxc-console -n 125 -e -1' failed: exit code 1
error:
Code:
INFO: starting new backup job: vzdump 125 --mode snapshot --node pve --remove 0 --storage raid1-backups --notes-template '{{guestname}}' --compress zstd
INFO: Starting Backup of VM 125 (lxc)
INFO: Backup started at 2022-11-11 00:47:49
INFO: status = stopped
INFO: backup mode: stop
INFO: ionice priority: 7
INFO: CT Name: mailserver
INFO: including mount point rootfs ('/') in backup
INFO: excluding bind mount point mp0 ('/Storage') from backup (not a volume)
INFO: creating vzdump archive '/backups/proxmox/dump/vzdump-lxc-125-2022_11_11-00_47_49.tar.zst'
INFO: tar: ./dev/lxc-125.log: Cannot open: Permission denied
INFO: Total bytes written: 3119308800 (3.0GiB, 22MiB/s)
INFO: tar: Exiting with failure status due to previous errors
ERROR: Backup of VM 125 failed - command 'set -o pipefail && lxc-usernsexec -m u:0:100000:1000 -m g:0:100000:1000 -m u:1000:1000:1 -m g:1000:1000:1 -m u:1001:101001:64534 -m g:1001:101001:64534 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' --one-file-system '--warning=no-file-ignored' '--directory=/tmp/vzdumptmp1708357_125/' ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw '--directory=/mnt/vzsnap0' --no-anchored '--exclude=lost+found' --anchored '--exclude=./tmp/?*' '--exclude=./var/tmp/?*' '--exclude=./var/run/?*.pid' ./ | zstd --rsyncable '--threads=1' >/backups/proxmox/dump/vzdump-lxc-125-2022_11_11-00_47_49.tar.dat' failed: exit code 2
INFO: Failed at 2022-11-11 00:50:10
INFO: Backup job finished with errors
TASK ERROR: job errors

permissions:
host /tmp:

Code:
ls -la / |grep tmp
drwxrwxrwt  12 root root  4096 Nov 11 01:06 tmp

container /dev:
Code:
drwxr-xr-x   6 root   root      500 Nov 11 06:13 dev
 
Last edited:
Hello,

You can try to use Backup Mode "Snapshot" instead of "Stop" or make sure that there is enough space available on the local disk to fit the mountpoint / rootfs of the container into the /tmp directory.
 
Hello,

You can try to use Backup Mode "Snapshot" instead of "Stop" or make sure that there is enough space available on the local disk to fit the mountpoint / rootfs of the container into the /tmp directory.
i had tried all three, all did the same error.

i fixed it though: i had to stop the container, mount the disk image file in a tmp directory, and remove
Code:
(container root)/dev/lxc-125.log
, which was not present when the container was running.
 
  • Like
Reactions: Moayad
I understand this is an old thread, but I got there when googling: "cant backup unprivileged container".

I had few containers that were set to privileged and were backing up without any problems and few unprivileged that errored with the following message:

Code:
INFO: creating vzdump archive '/mnt/pve/ds1515-backups/dump/vzdump-lxc-105-2023_10_01-15_30_48.tar.zst'
INFO: tar: /mnt/pve/ds1515-backups/dump/vzdump-lxc-105-2023_10_01-15_30_48.tmp: Cannot open: Permission denied
INFO: tar: Error is not recoverable: exiting now
INFO: cleanup temporary 'vzdump' snapshot
  Logical volume "snap_vm-105-disk-0_vzdump" successfully removed.
ERROR: Backup of VM 105 failed - command 'set -o pipefail && lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' --one-file-system '--warning=no-file-ignored' '--directory=/mnt/pve/ds1515-backups/dump/vzdump-lxc-105-2023_10_01-15_30_48.tmp' ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw '--directory=/mnt/vzsnap0' --no-anchored '--exclude=lost+found' --anchored '--exclude=./tmp/?*' '--exclude=./var/tmp/?*' '--exclude=./var/run/?*.pid' ./ | zstd '--threads=1' >/mnt/pve/ds1515-backups/dump/vzdump-lxc-105-2023_10_01-15_30_48.tar.dat' failed: exit code 2
INFO: Failed at 2023-10-01 15:30:49
INFO: Backup job finished with errors
TASK ERROR: job errors

My situation was as @Moayad described - backup location on NFS share (exported from Synology), and his suggestion also fixed my problem.

I have opened console, and did:
Code:
nano -w d /etc/vzdump.conf

then uncommented tmpdir line and changed it to:
Code:
# vzdump default settings


tmpdir: /tmp
 
Another option would be to make sure that UID 0 as well as UID 100000 got rights to write to the backup storage.
 
Another option would be to make sure that UID 0 as well as UID 100000 got rights to write to the backup storage.

I was afraid that I would have to do that. Fortunately, the other solution worked.

The reason why I didn't want to do anything with access rights is that I'm using Synology and quite disappointingly, it doesn't even have user/password authentication for NFS (it authenticates only by IP address). The whole UI for managing NFS looks quite bare, more like "let's just throw in the NFS, but nobody will use it anyway".

I could probably change those UIDs somehow on Proxmox box, but I want to leave the configuration as close to default as possible, so I can add/retire more nodes without wondering why it works on one of them, but not on the others.

The other option would be to set up CIFS/SMB share, but I wanted to use something more native to Linux.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!