Rdiff-backup crashes when backing up to an nfs share

Help with issues regarding installation of Debian
Post Reply
Message
Author
l3u
Posts: 3
Joined: 2022-11-21 11:52

Rdiff-backup crashes when backing up to an nfs share

#1 Post by l3u »

Hi all!

I'm migrating a server from Gentoo. I have most of my stuff up and running, but I have a problem with my automated backup using rdiff-backup. Rdiff-backup crashes when I try to create a backup on an nfs share. This works without a problem from my Gentoo and Artix machines, so I think my nfs server is okay, but this is a Debian specific problem.

I can produce this with a naked fresh install of Bullseye, only having installed nfs-common and rdiff-backup.

When I mount my nfs share at /mnt and try to backup a directory containing a single file, this happens:

Code: Select all

# rdiff-backup foo/ /mnt/test/
Exception '[Errno 22] Invalid argument' raised of class '<class 'OSError'>':
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 395, in error_check_Main
    Main(arglist)
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 417, in Main
    take_action(rps)
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 353, in take_action
    Backup(rps[0], rps[1])
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 442, in Backup
    backup.Mirror(rpin, rpout)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 39, in Mirror
    DestS.patch(dest_rpath, source_diffiter)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 269, in patch
    ITR(diff.index, diff)
  File "/usr/lib/python3/dist-packages/rdiff_backup/rorpiter.py", line 313, in __call__
    last_branch.fast_process(*args)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 587, in fast_process
    if self.patch_to_temp(mirror_rp, diff_rorp, tf):
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 636, in patch_to_temp
    rpath.copy_attribs(diff_rorp, new)
  File "/usr/lib/python3/dist-packages/rdiff_backup/rpath.py", line 238, in copy_attribs
    rpout.write_ea(rpin.get_ea())
  File "/usr/lib/python3/dist-packages/rdiff_backup/rpath.py", line 1664, in write_ea
    ea.write_to_rp(self)
  File "/usr/lib/python3/dist-packages/rdiff_backup/eas_acls.py", line 131, in write_to_rp
    self.clear_rp(rp)
  File "/usr/lib/python3/dist-packages/rdiff_backup/eas_acls.py", line 106, in clear_rp
    rp.conn.xattr.remove(rp.path, name, rp.issym())

Traceback (most recent call last):
  File "/usr/bin/rdiff-backup", line 32, in <module>
    rdiff_backup.Main.error_check_Main(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 395, in error_check_Main
    Main(arglist)
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 417, in Main
    take_action(rps)
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 353, in take_action
    Backup(rps[0], rps[1])
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 442, in Backup
    backup.Mirror(rpin, rpout)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 39, in Mirror
    DestS.patch(dest_rpath, source_diffiter)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 269, in patch
    ITR(diff.index, diff)
  File "/usr/lib/python3/dist-packages/rdiff_backup/rorpiter.py", line 313, in __call__
    last_branch.fast_process(*args)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 587, in fast_process
    if self.patch_to_temp(mirror_rp, diff_rorp, tf):
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 636, in patch_to_temp
    rpath.copy_attribs(diff_rorp, new)
  File "/usr/lib/python3/dist-packages/rdiff_backup/rpath.py", line 238, in copy_attribs
    rpout.write_ea(rpin.get_ea())
  File "/usr/lib/python3/dist-packages/rdiff_backup/rpath.py", line 1664, in write_ea
    ea.write_to_rp(self)
  File "/usr/lib/python3/dist-packages/rdiff_backup/eas_acls.py", line 131, in write_to_rp
    self.clear_rp(rp)
  File "/usr/lib/python3/dist-packages/rdiff_backup/eas_acls.py", line 106, in clear_rp
    rp.conn.xattr.remove(rp.path, name, rp.issym())
OSError: [Errno 22] Invalid argument
Running rdiff-backup with a higher verbosity level shows that the file is copied, but the attributes setting causes the crash:

Code: Select all

# rdiff-backup -v 9 foo/ /mnt/test/
...
2022-11-21 13:12:45.982259 +0100  <CLIENT-469>  -----------------------------------------------------------------
Detected abilities for destination (read/write) file system:
  Ownership changing                           On
  Hard linking                                 On
  fsync() directories                          On
  Directory inc permissions                    On
  High-bit permissions                         On
  Symlink permissions                          Off
  Extended filenames                           On
  Windows reserved filenames                   Off
  Access control lists                         Off
  Extended attributes                          On
  Windows access control lists                 Off
  Case sensitivity                             On
  Escape DOS devices                           Off
  Escape trailing spaces                       Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
2022-11-21 13:12:46.185891 +0100  <CLIENT-469>  Exception '[Errno 22] Invalid argument' raised of class '<class 'OSError'>':
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 395, in error_check_Main
    Main(arglist)
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 417, in Main
    take_action(rps)
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 353, in take_action
    Backup(rps[0], rps[1])
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 442, in Backup
    backup.Mirror(rpin, rpout)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 39, in Mirror
    DestS.patch(dest_rpath, source_diffiter)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 269, in patch
    ITR(diff.index, diff)
  File "/usr/lib/python3/dist-packages/rdiff_backup/rorpiter.py", line 313, in __call__
    last_branch.fast_process(*args)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 587, in fast_process
    if self.patch_to_temp(mirror_rp, diff_rorp, tf):
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 636, in patch_to_temp
    rpath.copy_attribs(diff_rorp, new)
  File "/usr/lib/python3/dist-packages/rdiff_backup/rpath.py", line 238, in copy_attribs
    rpout.write_ea(rpin.get_ea())
  File "/usr/lib/python3/dist-packages/rdiff_backup/rpath.py", line 1664, in write_ea
    ea.write_to_rp(self)
  File "/usr/lib/python3/dist-packages/rdiff_backup/eas_acls.py", line 131, in write_to_rp
    self.clear_rp(rp)
  File "/usr/lib/python3/dist-packages/rdiff_backup/eas_acls.py", line 106, in clear_rp
    rp.conn.xattr.remove(rp.path, name, rp.issym())

2022-11-21 13:12:46.029392 +0100  <CLIENT-469>  Backup: escape_dos_devices = 0
2022-11-21 13:12:46.029426 +0100  <CLIENT-469>  Backup: escape_trailing_spaces = 0
2022-11-21 13:12:46.053391 +0100  <CLIENT-469>  Making directory /mnt/test/rdiff-backup-data/increments
2022-11-21 13:12:46.071947 +0100  <CLIENT-469>  Starting mirror foo to /mnt/test
2022-11-21 13:12:46.131118 +0100  <CLIENT-469>  Processing changed file .
2022-11-21 13:12:46.132515 +0100  <CLIENT-469>  Processing changed file bar
2022-11-21 13:12:46.136514 +0100  <CLIENT-469>  Regular copying (b'bar',) to /mnt/test/rdiff-backup.tmp.1
2022-11-21 13:12:46.136537 +0100  <CLIENT-469>  Writing file object to /mnt/test/rdiff-backup.tmp.1
2022-11-21 13:12:46.163604 +0100  <CLIENT-469>  Copying attributes from (b'bar',) to /mnt/test/rdiff-backup.tmp.1
Traceback (most recent call last):
  File "/usr/bin/rdiff-backup", line 32, in <module>
    rdiff_backup.Main.error_check_Main(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 395, in error_check_Main
    Main(arglist)
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 417, in Main
    take_action(rps)
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 353, in take_action
    Backup(rps[0], rps[1])
  File "/usr/lib/python3/dist-packages/rdiff_backup/Main.py", line 442, in Backup
    backup.Mirror(rpin, rpout)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 39, in Mirror
    DestS.patch(dest_rpath, source_diffiter)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 269, in patch
    ITR(diff.index, diff)
  File "/usr/lib/python3/dist-packages/rdiff_backup/rorpiter.py", line 313, in __call__
    last_branch.fast_process(*args)
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 587, in fast_process
    if self.patch_to_temp(mirror_rp, diff_rorp, tf):
  File "/usr/lib/python3/dist-packages/rdiff_backup/backup.py", line 636, in patch_to_temp
    rpath.copy_attribs(diff_rorp, new)
  File "/usr/lib/python3/dist-packages/rdiff_backup/rpath.py", line 238, in copy_attribs
    rpout.write_ea(rpin.get_ea())
  File "/usr/lib/python3/dist-packages/rdiff_backup/rpath.py", line 1664, in write_ea
    ea.write_to_rp(self)
  File "/usr/lib/python3/dist-packages/rdiff_backup/eas_acls.py", line 131, in write_to_rp
    self.clear_rp(rp)
  File "/usr/lib/python3/dist-packages/rdiff_backup/eas_acls.py", line 106, in clear_rp
    rp.conn.xattr.remove(rp.path, name, rp.issym())
OSError: [Errno 22] Invalid argument
Having rdiff-backup making backups to my nfs share is crucial for this server! Can anybody help?

Thanks in advance!

l3u
Posts: 3
Joined: 2022-11-21 11:52

Re: Rdiff-backup crashes when backing up to an nfs share

#2 Post by l3u »

Okay, I think I found it. Neither do I use xattrs, nor have I set the user_xattr option for any entry in my fstab.

Nevertheless, rdiff-backup seems to think that I use xattrs:

Code: Select all

# rdiff-backup -v 5 foo/ /nas/backup/test/
...
-----------------------------------------------------------------
Detected abilities for source (read only) file system:
...
  Extended attributes                          On
...
-----------------------------------------------------------------
...
Detected abilities for destination (read/write) file system:
...
  Extended attributes                          On
...
-----------------------------------------------------------------
Explicitely disabling the use of xattrs via the --no-eas option makes it work.

Seems to be a bug?!

l3u
Posts: 3
Joined: 2022-11-21 11:52

Re: Rdiff-backup crashes when backing up to an nfs share

#3 Post by l3u »

Just in case anybody else runs into this and finds this post: I created a bug report about this: https://github.com/rdiff-backup/rdiff-backup/issues/789

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5362
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 6 times
Been thanked: 40 times

Re: Rdiff-backup crashes when backing up to an nfs share

#4 Post by dilberts_left_nut »

You're probably better to file a bug report against the Debian package (unless, of course, you are actually running the upstream version).
Upstream devs can get grumpy getting reports about bugs they may have already fixed (see xscreensaver saga), or even just against "outdated" versions ("install the latest and call me back if it persists").
When you report it via the Debian bugtracker, the maintainer can confirm the issue, look to incorporate any available bugfixes, or push the report upstream / provide a patch if appropriate.
AdrianTM wrote:There's no hacker in my grandma...

l3u
Posts: 3
Joined: 2022-11-21 11:52

Re: Rdiff-backup crashes when backing up to an nfs share

#5 Post by l3u »

This is actually an upstream bug (or more some situation rdiff-backup should detect properly). They already confirmed it, and there's even already a patch: https://github.com/rdiff-backup/rdiff-b ... be9cc17308 – If we're lucky, this will be fixed in the next release.

The reason this didn't happen on my Gentoo machine is that I simply didn't build xattr support into my kernel. Apparently, ext4 doesn't have to be mounted with xattr support being set explicitely anymore. The Debian kernel supports it, so the source has xattr support. However, rdiff-backup should properly detect that the target is on nfs and that it can't sync xattrs.

But when we're speaking of the Debian bugtracker:

I recently added some info to an existing bug report ( https://bugs.debian.org/cgi-bin/bugrepo ... 1017433#10 ) – does Debian really only have this email driven bug tracking system (instead of a "real" Bugzilla or such)? Sorry for the dumb question, but I'm new here ;-)
Last edited by l3u on 2022-11-23 13:31, edited 1 time in total.

Post Reply