Docker on QNAP QTShero (ZFS) results in Database crashes

Hi !
I used UrBackup für a long time on an QNAP NAS with QTS (linux) on ext4.
I used docker pull uroni/urbackup-server:latest.
Now I switched to a QNAP NAS with QTShero (linux) on zfs.
Here I also used docker pull uroni/urbackup-server:latest
(not docker pull uroni/urbackup-server:latest-zfs which I saw later).

I applied the lines as stated here to my compose.yml

    devices:
      - /dev/zfs:/dev/zfs

But I always have errors that result in database crash and so I have to re-setup everything.

After a database crash I usually get this error:
ERROR: Error preparing Query [PRAGMA cache_size = -2048]: SQL logic error

In the log before the crash there is :
Files WAL file urbackup/backup_server_files.db-wal greater than 1000 MB. Doing full WAL checkpoint…
Full checkpoint of urbackup/backup_server_files.db-wal done.

After a docker restart the I receive the PRAGMA error (above) and everything is broken.

Does anyone know what could cause this and what I could do against it ?

The block size of the share where the database lives is 128k.

Now my actual next try is skipping the ZFS-thing - so I suppose it will work as normal - and hope it will not break the database again …

btw:
What would be my benefits when using the /dev/zfs directive in compose.yml ?
Just the copy on write snapshots ?
Will the underlying ZFS also dedup and compress if not using the ZFS directive ? (I guess yes) and do I need to work with datasets ?
On QTS i have to use the given storage pool.

root@NAS:/# urbackup_snapshot_helper test
Testing for btrfs...
TEST FAILED: Creating test btrfs subvolume failed
Testing for zfs...
TEST FAILED: Dataset is not set via /etc/urbackup/dataset

so I think it’s useless to use the ZFS-image on a NAS ?

Now my actual next try is skipping the ZFS-thing - so I suppose it will work as normal - and hope it will not break the database again …

This also did not work …
Same error occurred …

2024-11-17 02:25:02: ERROR: Error preparing Query [PRAGMA synchronous=NORMAL]: SQL logic error. Retrying in 1s...
2024-11-17 02:25:03: WARNING: SQLite: SQL logic error in "PRAGMA synchronous=NORMAL" errorcode: 1

This error repeats all the time while booting the container

My next try was now using the ZFS-Docker-Image with the ZFS directives activated in compose.yml - without any luck:

2024-11-17 03:11:54: ERROR: Error preparing Query [PRAGMA cache_size = -2048]: SQL logic error. Retrying in 1s...
2024-11-17 03:11:55: WARNING: SQLite: SQL logic error in "PRAGMA cache_size = -2048" errorcode: 1
2024-11-17 03:11:55: ERROR: Error preparing Query [PRAGMA cache_size = -2048]: SQL logic error

I’m really out of ideas :frowning:

Seems like it’s similar or identical to the issue described here.

I think it is mmap error 19 ENODEV which probably means that the -shm file is on file system which does not support mmaped files. Move it to a file system that supports this and it should be fixed…

I consider moving from QTShero to QTS (which comes without ZFS :frowning: but with ext4 and worked beforehand)

a short question:

the underlying filesystem is ZFS.
Now the files are mounted via a bind-mount.
Could it help to put the database-files info a named volume ?

I took a try but same error - since it’s just an overlay FS …

reverting back to ext4 …

To finalize this:

It seems that QTShero does not support mapped files, so a VM or revert to ext4 using QTS is the way to go.