Hello, I am at my wits end trying to get this working on TrueNAS Scale. I had Urbackup installed in the compose plugin and it wasn’t working properly. So I figured I’d run it as a “Launch docker image” but I get the same issues.
The issue is, urbackup creates the ZFS dataset data/Backups/urbackup/files/DC-2022. This is readable in truenas gui and exists on the file system.
It then creates data/Backups/urbackup/files/DC-2022/231012-0753. But this says Path /mnt/data/Backups/urbackup/files/DC-2022/231012-0753 not found.
If I shell into the container, the files are there and the symlinks from backups > files work.
If I shell into the host, the files are not there.
If I restart the container, the files that were once there, are no longer there.
This is some of the log that I can see problem areas
2023-10-12 11:51:34.751517+00:00Testing for zfs...
2023-10-12 11:51:35.107444+00:00Destroyed subvol data/Backups/urbackup/images/testA54hj5luZtlorr494 successfully.
2023-10-12 11:51:35.107471+00:00ZFS TEST OK
2023-10-12 11:51:35.586693+00:00Destroyed subvol data/Backups/urbackup/files/testA54hj5luZtlorr494 successfully.
2023-10-12 11:51:35.587038+00:002023-10-12 07:51:35: Backup destination does handle subvolumes and snapshots. Snapshots enabled for image and file backups.
2023-10-12 11:51:35.587068+00:002023-10-12 07:51:35: Emulating reflinks via copying
2023-10-12 11:51:35.587253+00:002023-10-12 07:51:35: Reflink ioctl failed. errno=95
2023-10-12 11:53:21.980408+00:002023-10-12 07:53:21: New Backupclient: DC-2022
2023-10-12 11:53:22.563365+00:002023-10-12 07:53:22: Starting scheduled incremental file backup...
2023-10-12 11:53:22.563455+00:002023-10-12 07:53:22: WARNING: Cannot retrieve last file backup when doing incremental backup. Doing full backup now...
2023-10-12 11:53:22.568754+00:00Checking data/Backups/urbackup/files/DC-2022/231012-0753 for dependencies...
2023-10-12 11:53:22.571179+00:00cannot open 'data/Backups/urbackup/files/DC-2022/231012-0753@ro': dataset does not exist
2023-10-12 11:53:22.571463+00:002023-10-12 07:53:22: ERROR: No permission to access "/mnt/data/Backups/urbackup/backups/DC-2022/231012-0753"
2023-10-12 11:53:22.958013+00:002023-10-12 07:53:22: Starting scheduled full file backup...
2023-10-12 11:53:29.062201+00:002023-10-12 07:53:29: Change block tracking active on volume C:
2023-10-12 11:53:29.062230+00:002023-10-12 07:53:29: Indexing of "Desktop" done. 3 filesystem lookups 0 db lookups and 0 db updates
i have the same issue. i managed to get urbackup working with zfs on my truenas scale. with duduplication. but the issues i have with the datasets is the same like yours. i restart the container and the files are gone. the datasets in truenas are there, but with no user management. and when i try to access them on true nas, i get an error, that the path dont exist.
what i did, is to compile urbackupserver with the new urbackup_snapshot_helper on a test vm. i took the compiled urbackup_snapshot_helper and put it on my truenas. than i mounted the file directly as app storage to the urbackup container.
the new urbackup_snapshot_helper is working this way. unfortunatly it don’t resolve the problem. the datasets created by urbackup are still faulty. and after the container restart, the backup files are gone from urbackup. in the truenas gui, one can see the urbackup datasets, with error [ENOENT] Path /xxx/xxx/xxx not found, so they are not visible from the cli.
Yeah, I’m doing this at work. I can’t mess around with stuff that may or may not work. Unfortunately I could’ve saved a lot of money with urbackup. But… it is what it is.
maybe the zfsutils, what are in the container, need an update. i don’t know. and right now i am not in the mood to teach myself, how to make a deb from source, to build a new container for docker. i tried a little bit the last days, but i failed.
i guess i have to wait for a new release. and how i know urbackup, this can be tomorrow, or in one year …
i just created a docker with debian bookworm and the latest zfsutils. still the same problem.
i found out something strange. if i mount the files dataset with the mountpoint 1:1 inside the container, it works for 1 child dataset, which is the dataset for the client. its created correctly, with the settings inherited. but than the child of this dataset, which are the actual backups - JJMMDD-HHMM, behave the same again and don’t show up mounted on the host, with no quotas and acl.
i stop the container and make a host path 1:1 from the client dataset. than the backup dataset is created properly, but the files inside the dataset cannot be accessed.
so, everything what is 2 level bellow the parent dataset, is broken. i don’t know if this is a problem with zfs itself, or just a mess with urbackup docker.
I’m setting up TrueNAS Scale and urbackup with docker+ZFS. I have exactly that problem: datasets tht are not readable outside the docker, and gone after a container restart. Did anyone ever find a solution?
I’m using uroni/urbackup-server:latest-zfs
I been trying to get urbackup and turenas scale working with zfs support. I have successfully got file backups, delleting snaps and recovery working. However the same cant be said for image deletes and recovery which I totaly ready to pass in the towel. Attempting to mount an ibacked up mage seems to very hit and miss with the more like a miss with very cryptic error messages (even with debug enables) which just say failed to mount or failed to unmount an image. The deletes also fail to work and generate errors. PS. the image for latest-zfs appears to missing libguestfs-tools which I had to install manually. I also had to add zfs mount -a command to get startup script in the docker container as it failed to sometimes auto mount the directories when I restarted the container. I think the current root cause of my current build is related guestunmount as per the log messages but no explanation as to why… Appears the possible root cause is the failure to failure to mount and unmout images. I have managed to get it to work occassionally but is seems be rare and adhoc where I could pin point a pattern.
2024-11-13 23:08:45: ERROR: Image mounting failed: Mountpoint: /backups/chris-pc9/241112-2305_Image_ESP_mnt0
Guestunmount…
guestunmount: failed to unmount /backups/chris-pc9/241112-2305_Image_ESP_mnt0: fusermount: failed to unmount /backups/chris-pc9/241112-2305_Image_ESP_mnt0: Invalid argument
USER PID ACCESS COMMAND
/backups/chris-pc9/241112-2305_Image_ESP_mnt0:
root kernel mount /backups
Unmounting “/backups/chris-pc9/241112-2305_Image_ESP_mnt0” failed.
2024-11-13 23:08:46: New Backupclient: chris-pc9
Checking tank/urbackup/files/chris-pc9/241112-2341 for dependencies…
Dependencies exist…
Promoting tank/urbackup/files/chris-pc9/241112-2344…
Destroying subvol tank/urbackup/files/chris-pc9/241112-2341…
cannot destroy ‘tank/urbackup/files/chris-pc9/241112-2341’: dataset is busy
Checking tank/urbackup/files/chris-pc9/241112-2344 for dependencies…
Dependencies exist…
Promoting tank/urbackup/files/chris-pc9/241113-2003…
Destroying subvol tank/urbackup/files/chris-pc9/241112-2344…
cannot destroy ‘tank/urbackup/files/chris-pc9/241112-2344’: dataset is busy
2024-11-13 23:17:27: Deleting image backup ( id=4, path=/backups/chris-pc9/241112-2305_Image_SYSVOL/Image_SYSVOL_241112-2305.raw ) …
Checking tank/urbackup/images/chris-pc9/241112-2305_Image_SYSVOL for dependencies…
cannot open ‘tank/urbackup/images/chris-pc9/241112-2305_Image_SYSVOL@ro’: dataset does not exist
2024-11-13 23:23:30: Deleting image backup ( id=4, path=/backups/chris-pc9/241112-2305_Image_SYSVOL/Image_SYSVOL_241112-2305.raw ) …
Checking tank/urbackup/images/chris-pc9/241112-2305_Image_SYSVOL for dependencies…
cannot open ‘tank/urbackup/images/chris-pc9/241112-2305_Image_SYSVOL@ro’: dataset does not exist
2024-11-13 23:23:30: Deleting image backup failed.
Steps I needed to take to get this far.
used :latest-zfs image
update docker compose to privileged: true
update docker compose PUID and GUID to 0 and 0 respectively ← perhaps this is could be problem
created additional dataset config and linked its container as - /mnt/tank/urbackup/config:/etc/urbackup in docker compose
created additional datasets for db, backups, images and files. linked volumes db and backups in docker compose. See admin manual for details images and files under zfs for dataset details.
created files for dataset, dataset_files and backupfiles and saved to /mnt/tank/urbackup/config (ala linked to /etc/urbackup in docker compose). See admin manual under zfs for details.
logged into container as interactive terminal to and run the following commands
7a. apt update
7b apt upgrade
7c apt install libguestfs-tools
9d apt install nano (I like nano; apologies to vi fans)
9e nano /etc/default/urbackupsrv and update LOGLEVEL to “debug” and save - this is price of asking for help on this forum; I did not consider updating the USER as “root” as looking at TOP in the container, it indicated that urbackupsrv was running as root anyway. Perhaps I will try that out of frustration.
using nano added “zfs mount -a” to /usr/bin/entrypoint.sh just prior to starting the server; I also added sleep 5 to ensure the zfs mount was completed before starting the server. This command according to what I read should not have been needed but seemed to be only thing that I could to do get the container to reliable mount all zfs volumes on restart of the container.
restart the container…
Next Steps to fix image deletes and recovery
I dont have any; I may try the setting the user to root but all out of ideas for now.
Some of the these steps in the container could have been done in the dockerfile and rebuilding it. I am just lazy and will get to it eventually.assuming I dont abandon ubackup on truenas scale which is becoming more and more likely.
Thanks chris for your explanations.
It seems that urbackup + truenas scale + zfs need some additional testing and bugfixing.
I had it running in core with the “official” jail, switched to scale 24.10 for some reasons and thought: wow now with docker, this will be easy! … not x)
I have only 4 PCs here at home and just want reliable backups so i might just run it without ZFS for the moment. Really dont want to abandon urbackup…
Did you get it working successfully in Truenas Core in a jail. I was wondering if I switched to Proxmox which runs LXC’s; I may get it working. I have one proxmox machine aready running as a NAS in LXC (although not as fancy as Truenas). It could be path forward for me if I could get it running in LXC (which may be similar to Jail??). I have slow wireless and cant afford the b/w for regular full backups so would appreciate what snapshots offer. Rather keep URBACKUP and if that means going with PROXMOX so be it.