Skip to content

3.5.0 receiver: --xattrs with --link-dest fails with "gen_entry_copy_xattrs: secure open ... No such file or directory" (works without -X) #1126

Open

Description

@JiriPrchal

Summary

Since the receiving host runs rsync 3.5.0, my snapshot backup (push over ssh, --link-dest to the previous snapshot, --xattrs) fails in the generator with:

rsync: [generator] gen_entry_copy_xattrs: secure open of "/snapshots/<user>/20261012-132605/Documents/<dir>" failed: No such file or directory (2)

The same error is reported for all entries, not only this one. The identical command without --xattrs (still with --link-dest=../last and --acls) completes successfully.

Environment

  • Sender (client): rsync 3.2.7, protocol 31
  • Receiver (server): rsync 3.5.0, protocol 32 debian amd64 / 3.5.0+ds1-0+deb13u1
  • Transport: ssh (-e ssh)
  • Filesystem of the destination (/snapshots): ext4
  • User rsync runs as on the receiver: root
  • Last successful snapshot: 20260930-110733. Receiver was upgraded to 3.5.0 on about 2026-09-30.

Command

rsync -e ssh --archive --executability --xattrs --acls --one-file-system \
  --human-readable --verbose --compress --itemize-changes --update \
  --numeric-ids --force --exclude-from=<file> --delete-after --delete-excluded \
  --link-dest=../last /home/<user>/ <server>:/snapshots/<user>/<YYYYmmdd-HHMMSS>

Destination layout

  • /snapshots and /snapshots/<user>: root:root, 0755
  • /snapshots/<user>/last is a root-owned symlink to the previous snapshot (20260930-110733)
  • The new snapshot directory (20261012-132605) is created by this run, so subdirectories do not exist yet when the error occurs, while they do exist under last.

Source

The directory named in the first error is a plain directory (not a symlink), owned by the user running the backup, mode 0755, with no subdirectories.

Expected

Backup completes as with earlier versions.

Actual

Error as above, for all entries, with --xattrs + --link-dest. Without --xattrs it works.

Notes

3.5.0 changed how --link-dest and ACL/xattr handling resolve paths (secure resolver), so this may be a regression there. An old bug with a similar pattern (xattrs/ACL ENOENT with --link-dest when the directory exists only in the alt-dest) is https://bugzilla.samba.org/show_bug.cgi?id=6576, though I do not know whether it is related.

Activity

  1. steadytao commented on Oct 13, 2026

    @steadytao
    Member

    Could be 03535a6 but I could not reproduce it with a 3.2.7 sender, 3.5.0 receiver, real xattrs and the same relative last symlink. Please retry with 3.5.1 and provide both full rsync --version outputs, complete --debug=GENR3 stderr and a minimal tree preserving the failing ACLs and xattrs.

  2. JiriPrchal commented on Oct 13, 2026

    @JiriPrchal
    Author

    Is this strace usefull?

    315506 newfstatat(5, "Documents", {st_mode=S_IFDIR|0775, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
    315506 getxattr("/snapshots/home_jirka/last/.wine/drive_c/users/Public/Documents", "system.posix_acl_access", 0x7ffef78a0760, 132) = -1 ENODATA (No data available)
    315506 newfstatat(AT_FDCWD, "/snapshots/home_jirka/last/.wine/drive_c/users/Public/Documents", {st_mode=S_IFDIR|0775, st_size=4096, ...}, 0) = 0
    315506 getxattr("/snapshots/home_jirka/last/.wine/drive_c/users/Public/Documents", "system.posix_acl_default", 0x7ffef78a0760, 132) = -1 ENODATA (No data available)
    315506 newfstatat(AT_FDCWD, "/snapshots/home_jirka/last/.wine/drive_c/users/Public/Documents", {st_mode=S_IFDIR|0775, st_size=4096, ...}, 0) = 0
    315506 llistxattr("/snapshots/home_jirka/last/.wine/drive_c/users/Public/Documents", "", 1024) = 0
    315506 newfstatat(5, "Documents", {st_mode=S_IFLNK|0777, st_size=21, ...}, AT_SYMLINK_NOFOLLOW) = 0
    315506 readlink("/snapshots/home_jirka/last/.wine/drive_c/users/jirka/Documents", "/home/jirka/Documents", 4095) = 21
    315506 llistxattr("/snapshots/home_jirka/last/.wine/drive_c/users/jirka/Documents", "", 1024) = 0
    315506 newfstatat(5, "My Documents", {st_mode=S_IFLNK|0777, st_size=21, ...}, AT_SYMLINK_NOFOLLOW) = 0
    315506 readlink("/snapshots/home_jirka/last/.wine/drive_c/users/jirka/My Documents", "/home/jirka/Documents", 4095) = 21
    315506 llistxattr("/snapshots/home_jirka/last/.wine/drive_c/users/jirka/My Documents", "", 1024) = 0
    315506 newfstatat(5, "Documents", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
    315506 getxattr("/snapshots/home_jirka/last/Documents", "system.posix_acl_access", 0x7ffef78a0760, 132) = -1 ENODATA (No data available)
    315506 newfstatat(AT_FDCWD, "/snapshots/home_jirka/last/Documents", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
    315506 getxattr("/snapshots/home_jirka/last/Documents", "system.posix_acl_default", 0x7ffef78a0760, 132) = -1 ENODATA (No data available)
    315506 newfstatat(AT_FDCWD, "/snapshots/home_jirka/last/Documents", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
    315506 llistxattr("/snapshots/home_jirka/last/Documents", "", 1024) = 0
    315506 openat(0, "Documents", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    315506 newfstatat(5, "Documents", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
    315506 openat(5, "Documents", O_RDONLY|O_NOFOLLOW|O_PATH|O_DIRECTORY) = 4
    315506 getxattr("/snapshots/home_jirka/last/Documents/20151220_143951.mp4", "system.posix_acl_access", 0x7ffef78a07d0, 132) = -1 ENODATA (No data available)
    315506 newfstatat(AT_FDCWD, "/snapshots/home_jirka/last/Documents/20151220_143951.mp4", {st_mode=S_IFREG|0644, st_size=247563892, ...}, 0) = 0
    315506 llistxattr("/snapshots/home_jirka/last/Documents/20151220_143951.mp4", "", 1024) = 0
    315506 newfstatat(5, "Documents", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
    315506 openat(5, "Documents", O_RDONLY|O_NOFOLLOW|O_PATH|O_DIRECTORY) = 4
    315506 getxattr("/snapshots/home_jirka/last/Documents/20151220_144309.mp4", "system.posix_acl_access", 0x7ffef78a07d0, 132) = -1 ENODATA (No data available)
    315506 newfstatat(AT_FDCWD, "/snapshots/home_jirka/last/Documents/20151220_144309.mp4", {st_mode=S_IFREG|0644, st_size=95498263, ...}, 0) = 0
    315506 llistxattr("/snapshots/home_jirka/last/Documents/20151220_144309.mp4", "", 1024) = 0
    315506 newfstatat(5, "Documents", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
    
  3. steadytao commented on Oct 13, 2026

    @steadytao
    Member

    Yes. openat(0, "Documents", ...) = ENOENT is the failing fallback while the same lookup immediately succeeds relative to fd 5. Most likely 03535a6. Had some semi-related changes near this so confirm whether 3.5.1 fails; if so, rerun with strace -f -yy -e trace=%file so the fd roots are shown. Will fix the underlying cause though.

  4. added
    Bug
    on Oct 13, 2026
  5. steadytao commented on Oct 13, 2026

    @steadytao
    Member

    Nvm might not be that. Something in the Debian ports possibly.

  6. steadytao commented on Oct 13, 2026

    @steadytao
    Member

    Alright. The trace narrows this down so thank you but I rebuilt the exact Debian 3.5.0+ds1-0+deb13u1 patch stack with ACL/xattr support and still cannot reproduce it with a 3.2.7 sender and the reported options. Please rerun the failing command with strace -f -yy -e trace=%file and provide the full --debug=GENR3 stderr. The -yy annotations matter here as this trace shows Documents missing relative to fd 0 and present relative to fd 5 but not what those descriptors reference.

  7. DomAsProgrammer commented on Nov 15, 2026

    @DomAsProgrammer

    I see the very same issue on FreeBSD since rsync v3.5.0 and now on v3.5.1, too.
    For me also removing -X does not solve the issue. (But I use even more options:
    -v -r -l -t -o -p -g -p -H -A -E -S -U -z)

    However, is there any progress on this bug yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions