Urbackup on truenas does not mount after restart of docker container

I have everything working until I attempt to restart the container. After the restart of the container I can no longer mount either backup images or file backups. I receive the following LOG.

One point of interest is invalid argument error:
Guestunmount…
guestunmount: failed to unmount /backups/chris-pc9/241109-1404_Image_C_mnt0: fusermount: failed to unmount /backups/chris-pc9/241109-1404_Image_C_mnt0: Invalid argument

and possible permission issue

2024-11-09 16:34:30: ERROR: Error opening Bitmap file “/backups/chris-pc9/241109-1404_Image_C/Image_C_241109-1404.raw.bitmap” for writing


024-11-09 16:33:43: Started UrBackup…
2024-11-09 16:33:43: Removing temporary files…
2024-11-09 16:33:43: Recreating temporary folder…
2024-11-09 16:33:44: InternetService: Server started up successfully!
2024-11-09 16:33:44: UrBackup Server start up complete.
2024-11-09 16:33:44: Looking for old Sessions… 0 sessions
2024-11-09 16:33:44: Server started up successfully!
2024-11-09 16:33:44: Unmounting mounted image backup id 3 partition 0 path “/backups/chris-pc9/241109-1404_Image_C/Image_C_241109-1404.raw” mounted 2m 42s ago
2024-11-09 16:33:44: Backup destination does handle subvolumes and snapshots. Snapshots enabled for image and file backups.
2024-11-09 16:33:44: Emulating reflinks via copying
2024-11-09 16:33:44: Reflink ioctl failed. errno=11
2024-11-09 16:33:44: Broadcasting on ipv4 interface enp2s0 addr 192.168.1.235
2024-11-09 16:33:44: Broadcasting on ipv4 interface br-125dd94be5ed addr 172.16.1.1
2024-11-09 16:33:44: Broadcasting on ipv4 interface docker0 addr 172.16.0.1
2024-11-09 16:33:44: Broadcasting on ipv6 interface enp2s0 addr fe80::6ebf:b5ff:fe02:ee4e
2024-11-09 16:33:44: Broadcasting on ipv6 interface br-125dd94be5ed addr fe80::42:34ff:fe56:5a58
2024-11-09 16:33:44: Broadcasting on ipv6 interface vethe3ef57d addr fe80::20b0:3cff:fe71:182c
2024-11-09 16:33:45: Downloading version file…
2024-11-09 16:33:46: Downloading version file…
2024-11-09 16:33:46: Downloading server version info…
2024-11-09 16:33:47: Downloading dataplan database…
2024-11-09 16:34:15: ERROR: Image mounting failed: Mountpoint: /backups/chris-pc9/241109-1404_Image_C_mnt0
Guestunmount…
guestunmount: failed to unmount /backups/chris-pc9/241109-1404_Image_C_mnt0: fusermount: failed to unmount /backups/chris-pc9/241109-1404_Image_C_mnt0: Invalid argument
USER PID ACCESS COMMAND
/backups/chris-pc9/241109-1404_Image_C_mnt0:
root kernel mount /backups
Unmounting “/backups/chris-pc9/241109-1404_Image_C_mnt0” failed.

2024-11-09 16:34:15: ERROR: Unmounting image backup id 3 path “/backups/chris-pc9/241109-1404_Image_C/Image_C_241109-1404.raw” mounted 2m 42s ago failed: Mountpoint: /backups/chris-pc9/241109-1404_Image_C_mnt0
Guestunmount…
guestunmount: failed to unmount /backups/chris-pc9/241109-1404_Image_C_mnt0: fusermount: failed to unmount /backups/chris-pc9/241109-1404_Image_C_mnt0: Invalid argument
USER PID ACCESS COMMAND
/backups/chris-pc9/241109-1404_Image_C_mnt0:
root kernel mount /backups
Unmounting “/backups/chris-pc9/241109-1404_Image_C_mnt0” failed.

2024-11-09 16:34:16: New Backupclient: chris-pc9
2024-11-09 16:34:30: ERROR: Error opening Bitmap file “/backups/chris-pc9/241109-1404_Image_C/Image_C_241109-1404.raw.bitmap” for writing
2024-11-09 16:34:31: ERROR: Error opening Bitmap file “/backups/chris-pc9/241109-1404_Image_C/Image_C_241109-1404.raw.bitmap” for writing
2024-11-09 16:34:31: ERROR: Error opening Bitmap file “/backups/chris-pc9/241109-1404_Image_C/Image_C_241109-1404.raw.bitmap” for writing
2024-11-09 16:34:45: ERROR: Cannot open “/backups/chris-pc9/241109-1318”: No such file or directory (2)
2024-11-09 16:34:49: ERROR: Cannot open “/backups/chris-pc9/241109-1318”: No such file or directory (2)
2024-11-09 16:34:53: ERROR: Cannot open “/backups/chris-pc9/241109-1318”: No such file or directory (2)
root@truenas:/var/log#

Here is the docker compose
version: “2”
services:
urbackup:
image: uroni/urbackup-server:latest-zfs
privileged: true
container_name: urbackup
restart: unless-stopped
environment:
- PUID=0 # Enter the UID of the user who should own the files here
- PGID=0 # Enter the GID of the user who should own the files here
- TZ=Australia/… # Enter your timezone
volumes:
- /mnt/tank/docker/urbackup/db:/var/urbackup
- /mnt/tank/docker/urbackup/backups:/backups
- /mnt/tank/docker/urbackup/config:/etc/urbackup
# Uncomment the next line if you want to bind-mount the www-folder
#- /path/to/wwwfolder:/usr/share/urbackup
network_mode: host
# Uncomment the following two lines if you’re using BTRFS support
#cap_add:
# - SYS_ADMIN
# Uncomment the following two lines if you’re using ZFS support
devices:
- /dev/zfs:/dev/zfs
networks:
ix-dockge_default:
external: true

and the file structure
tank/docker/urbackup 473G 3.05T 112K /mnt/tank/docker/urbackup
tank/docker/urbackup/backups 134M 3.05T 134M /mnt/tank/docker/urbackup/backups
tank/docker/urbackup/config 104K 3.05T 104K /mnt/tank/docker/urbackup/config
tank/docker/urbackup/db 193M 3.05T 193M /mnt/tank/docker/urbackup/db
tank/docker/urbackup/files 300G 3.05T 96K /mnt/tank/docker/urbackup/files
tank/docker/urbackup/files/chris-pc9 300G 3.05T 96K /mnt/tank/docker/urbackup/files/chris-pc9
tank/docker/urbackup/files/chris-pc9/241109-1318 300G 3.05T 300G /mnt/tank/docker/urbackup/files/chris-pc9/241109-1318
tank/docker/urbackup/images 173G 3.05T 96K /mnt/tank/docker/urbackup/images
tank/docker/urbackup/images/chris-pc9 173G 3.05T 104K /mnt/tank/docker/urbackup/images/chris-pc9
tank/docker/urbackup/images/chris-pc9/241109-1404_Image_C 172G 3.05T 172G /mnt/tank/docker/urbackup/images/chris-pc9/241109-1404_Image_C
tank/docker/urbackup/images/chris-pc9/241109-1404_Image_ESP 32.7M 3.05T 32.7M /mnt/tank/docker/urbackup/images/chris-pc9/241109-1404_Image_ESP
tank/docker/urbackup/images/chris-pc9/241109-1404_Image_SYSVOL 690M 3.05T 690M /mnt/tank/docker/urbackup/images/chris-pc9/241109-1404_Image_SYSVOL

and storage files
root@truenas:/var/log# cd /etc/urbackup
root@truenas:/etc/urbackup# ls
backupfolder dataset dataset_file
root@truenas:/etc/urbackup# cat backupfolder
/backupsroot@truenas:/etc/urbackup# cat dataset
tank/docker/urbackup/images
root@truenas:/etc/urbackup# cat dataset_file
tank/docker/urbackup/files
root@truenas:/etc/urbackup#

I also have installed libguestfs-tools in the container.

I have managed to get backup files working with a work around when I restart the container. If I run zfs mount -a in the docker container; I can now mount the file backups in the gui.

The images are still not mounting in subsequent restarts unlike when I 1st boot of the container so that is still is not working.

Does anyone have a more permanent fix other than manually running the zfs mount -a command in the container once it has started.

My thought to this workaround is the container requires a specific mapping from /backups. which looses the mounts when the container restarts… Unfortunately zfs does not auto mount when the container is restarted unlike the ffull operating restart where it should automatically reload the mount points. That is only wild speculation so dont trust my thoughts!