Hi there,
Here are my environments:
- My backup server: TrueNAS SCALE, ElectricEel-24.10.1
- My other servers: Debian 12 bookworm, Linux 6.1.0-29-amd64 with OpenZFS 2.2.7
I take snapshots on my Debian servers using Sanoid, a Perl-based tool developed by Jim Salter. Sanoid.
I’m having some issues these days. When I replicated the snapshots on my Debian server using TrueNAS SCALE’s Data Protection > Replication Tasks function, it sometimes failed because Zettarepl thought some snapshots should be earlier than others. We can get a precise snapshot chronal sequence by invoking zfs list -t snapshot
, so this issue can be avoided.
This is the task log:
[2025/01/12 14:01:56] INFO [Thread-67] [zettarepl.paramiko.replication_task__task_25] Connected (version 2.0, client OpenSSH_9.2p1)
[2025/01/12 14:01:56] INFO [Thread-67] [zettarepl.paramiko.replication_task__task_25] Authentication (publickey) successful!
[2025/01/12 14:01:57] INFO [replication_task__task_25] [zettarepl.replication.pre_retention] Pre-retention destroying snapshots: []
[2025/01/12 14:01:57] INFO [replication_task__task_25] [zettarepl.replication.run] For replication task 'task_25': doing pull from 'zroot' to 'DapuStor_R5100_RAID-Z1/machines/r740-debian' of snapshot='autosnap_2025-01-12_06:00:01_hourly' incremental_base='autosnap_2025-01-12_05:00:04_hourly' include_intermediate=False receive_resume_token=None encryption=False
[2025/01/12 14:01:57] INFO [replication_task__task_25] [zettarepl.paramiko.replication_task__task_25.sftp] [chan 5] Opened sftp connection (server version 3)
[2025/01/12 14:01:57] INFO [replication_task__task_25] [zettarepl.transport.ssh_netcat] Automatically chose connect address '10.2.1.33'
[2025/01/12 14:02:02] INFO [replication_task__task_25] [zettarepl.replication.run] For replication task 'task_25': doing pull from 'zroot' to 'DapuStor_R5100_RAID-Z1/machines/r740-debian' of snapshot='autosnap_2025-01-12_06:00:01_monthly' incremental_base='autosnap_2025-01-12_06:00:01_hourly' include_intermediate=False receive_resume_token=None encryption=False
[2025/01/12 14:02:02] INFO [replication_task__task_25] [zettarepl.transport.ssh_netcat] Automatically chose connect address '10.2.1.33'
[2025/01/12 14:02:05] ERROR [replication_task__task_25] [zettarepl.replication.run] For task 'task_25' unhandled replication error SshNetcatExecException(ExecException(1, 'WARNING: could not send zroot@autosnap_2025-01-12_06:00:01_monthly:\nincremental source (zroot@autosnap_2025-01-12_06:00:01_hourly) is not earlier than it\nWARNING: could not send zroot/home@autosnap_2025-01-12_06:00:01_monthly:\nincremental source (zroot/home@autosnap_2025-01-12_06:00:01_hourly) is not earlier than it\nWARNING: could not send zroot/ROOT@autosnap_2025-01-12_06:00:01_monthly:\nincremental source (zroot/ROOT@autosnap_2025-01-12_06:00:01_hourly) is not earlier than it\nWARNING: could not send zroot/ROOT/debian@autosnap_2025-01-12_06:00:01_monthly:\nincremental source (zroot/ROOT/debian@autosnap_2025-01-12_06:00:01_hourly) is not earlier than it\nno error\n'), ExecException(1, 'cannot receive: failed to read from stream\n'))
Traceback (most recent call last):
... 29 more lines ...
zroot@autosnap_2025-01-12_06:00:01_hourly or delete snapshot
zroot@autosnap_2025-01-12_06:00:01_monthly from both the source and destination.
WARNING: could not send zroot/home@autosnap_2025-01-12_06:00:01_monthly:
incremental source (zroot/home@autosnap_2025-01-12_06:00:01_hourly) is not earlier than it
WARNING: could not send zroot/ROOT@autosnap_2025-01-12_06:00:01_monthly:
incremental source (zroot/ROOT@autosnap_2025-01-12_06:00:01_hourly) is not earlier than it
WARNING: could not send zroot/ROOT/debian@autosnap_2025-01-12_06:00:01_monthly:
incremental source (zroot/ROOT/debian@autosnap_2025-01-12_06:00:01_hourly) is not earlier than it
no error
Active side: cannot receive: failed to read from stream
Obviously, the monthly one is earlier than the hourly one but TrueNAS zettarepl claims that the hourly one should be the incremental stream’s source. It is definitely wrong!
cat /etc/sanoid/sanoid.conf
# My sanoid config slice
[zroot]
recursive=zfs
hourly=48
daily=14
autosnap=yes
autoprune=yes
Is there a method to adjust Zettarepl’s sending policy?
Here are some unpleasant experiences with Sanoid/TrueNAS and I have the solution already, put them here.
- Creating recursive snapshots using Sanoid config like
recursive = yes
will make TrueNAS unable to deal with that. You should userecursive = zfs
in Sanoid’s config alternatively.