psy0rz / zfs_autobackup

ZFS autobackup is used to periodicly backup ZFS filesystems to other locations. Easy to use and very reliable.
https://github.com/psy0rz/zfs_autobackup
GNU General Public License v3.0
583 stars 62 forks source link

Running without root on ZoL throws transient errors #258

Closed sevmonster closed 1 month ago

sevmonster commented 2 months ago

Under ZFS On Linux, it is not possible to mount ZFS filesystems even if you grant the mount permission to a user. For some reason, the maintainers of ZoL decided to raise an error in this situation, which causes zfs-autobackup to choke when creating parent and target datasets on the target host.

  #### Synchronising
  [Target] tank/neo: Creating filesystem and parents
! [Target] STDERR > filesystem successfully created, but it may only be mounted by root
! [Target] Command "ssh user@host 'zfs create -p target/tank/neo'" returned exit code 1 (valid codes: [0])
! [Source] tank/neo: FAILED: Last command returned error
  [Source] tank/neo: sending to target/tank/neo
  [Target] target/tank/neo@offsite1-20240619062656: receiving full
! [Target] STDERR > cannot open 'target/tank/neo': dataset does not exist
! [Target] STDERR > cannot receive new filesystem stream: unable to restore to destination
! [Target] Command "ssh user@host 'zfs recv -u -x refreservation -v -s target/tank/neo'" returned exit code 1 (valid codes: [0])
! [Source] tank/neo: FAILED: Last command returned error

This error specifically should be ignored under ZoL, since it is not fatal.

Re-running the same command will eventually create all the required parent and target datasets, so after another run or two, the errors will go away.

Lastly, a correction on the wiki: The permissions provided in the Running without root section are not always sufficient. You must also have the hold and userprop permissions for default operations to succeed.

psy0rz commented 2 months ago

can you try with the latest v3.3 beta version? i has a different way of mounting.

psy0rz commented 2 months ago

(i updated the running without root docs)

sevmonster commented 2 months ago

Is the branch available on GitHub or has it been published elsewhere? I am not seeing it.

psy0rz commented 2 months ago

nope the master is the latest.

or use pip install --upgrade zfs-autobackup --pre to get an actual release

psy0rz commented 1 month ago

did this solve it?

sevmonster commented 1 month ago

Sorry, I have not had time to test and forgot. I will check this afternoon.

sevmonster commented 1 month ago

Looks like this issue is fixed on 3.3b3. Thank you.