Problems with Rsync replication to older qnap ts-212

Trying rsync my immich data to my old ts-212 qnap, but im getting an error which i cant overcome.

Im positive that target system user has needed permissions. What should i check, rsync manages to create one folder on target.

By googleing it might have something to do with file permissions, different filesystem etc. ? I have disabled all the flags and tried several thats in truenas rsyng task creation page.

rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/.immich": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1739664000012.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1739750400011.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1739836800008.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1739923200009.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740009600013.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740096000008.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740182400011.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740268800014.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740355200013.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740441600011.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740528000012.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740614400013.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740700800011.sql.gz": Permission denied (13)
rsync: recv_generator: failed to stat "/share/Backups/Truenas_Rsync/phone-media/immich-db-backup-1740787200007.sql.gz": Permission denied (13)
rsync: recv_generator: mkdir "/share/Backups/Truenas_Rsync/phone-media/1993b6f0-fee0-4f76-a06b-6bbe945a907e" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/share/Backups/Truenas_Rsync/phone-media/b3756257-2f56-42c2-8c68-2eb0fb65a348" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]

Also found this https://bobcares.com/blog/rsync-error-cannot-stat-destination/ But dunno how to try it out…

EDIT: itried rsync from commandline and it works … ?

rsync -avzhvvv /truenas/phone-media/ tontze@qnap:/share/Backups/Truenas_Rsync/

Works, sort of. It makes funny ownerships …

drwxrwxrwx    4 admin    administ      4096 Aug 15 08:07 ./
drwxr-xr-x   19 admin    administ      4096 Aug 12 08:26 ../
----rwx---    1 tontze   administ        13 Mar  1 14:14 .immich*
--w-------    1 tontze   everyone  25690112 Aug 15 08:09 .immich-db-backup-1739664000012.sql.gz.8XL4A0
d-w-rwx---    2 tontze   administ      4096 Mar  1 15:14 1993b6f0-fee0-4f76-a06b-6bbe945a907e/
d---------    2 tontze   everyone      4096 Aug 15 08:05 b3756257-2f56-42c2-8c68-2eb0fb65a348/

I’d suggest documenting permissions at each side…

FromGoogle:

The rsync: recv_generator: failed to stat error indicates that rsync, specifically on the receiving end, encountered an issue when trying to obtain information (stat) about a file or directory. This typically points to problems with permissions, file system corruption, or issues with how the destination is mounted.

Here are the common causes and potential solutions:

  • Permission Denied:

    • The user running the rsync command on the destination machine lacks the necessary permissions to read, write, or access the target files or directories.
    • Solution:
      • Verify and adjust the permissions of the destination directory and its contents using chmod and chown.
      • Ensure the user running rsync has appropriate privileges, potentially by running rsync with sudo or by adjusting user permissions.
  • File System Issues:

    • Corruption or errors within the destination file system can prevent rsync from properly statting files.
    • Solution:
      • Check the integrity of the destination file system using tools like fsck (for Linux) or chkdsk (for Windows).
      • If the issue is with a network file system (like NFS), review the mount options and ensure proper configuration (e.g., no_root_squash for NFSv3 if needed).

It has been a long time and I don’t have QNAP setup anymore, but when I used rsync to connect Truenas to a QNAP box I had to setup SSH keys for the admin user of the QNAP box. It’s under the logged in QNAP admin user, → Login and Security SSH Keys. If I remember correctly you then use the key in Truenas when setting up to allow Truenas access to the QNAP box. In Truenas I think you need to add it under Credentials -->Backup Credentials -->SSH connections.

Yeah, i believe its filesystem differences thats causing problems. Alltho, i can run rsync and it copies more if i run it from truenas shell, with truenas gui it manages to just make one dir…

At receiving side attleast qnap says filesystem and smart should be fine.

Yes i have made required ssh keys and synced them through rsync. Truenas reports that it should be fine, and rsync manages to create one dir in qnap, so connection seems to be fine. I quess its a problem with different filesystem or something.

If that is the case, it may be a bug.

However, pretty weird since it gets most of the way there and we know rsync works.

Please report bug if you can’t see a credential problem.

I did more tests, i created another directory where to rsync from, it is samba share where i copied files through samba. It did rsync like it should, no errors…

Directory i tried to rsync earlier is immich data storage, might it have something that prevents rsyncing ?

Difference in source datasets is that rsync user is owner of the dataset that works, on the immich dataset rsync user is not owner, but has full control.

1 Like

Sounds like immich is locking the data???

Yeah i dont know anymore, i deleted all the rsync tasks and created them again, exactly same way(i think) and now it just works … Its very slow tho …

1 Like