bugrdiff-backup - Bugs: bug #26847, Eliminating "AF_UNIX path too...


bug #26847: Eliminating "AF_UNIX path too long" when backing up sockets

Submitted by:  Joe Steele <j_steele>
Submitted on:  Fri 19 Jun 2009 08:02:12 PM UTC  
Votes:  100  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 12 Feb 2016 08:47:59 AM UTC, comment #4: 

patched committed already.
Please followup on github:

david kempe <davekempe>
Project Administrator
Tue 30 Jun 2015 07:49:31 AM UTC, comment #3: 


I've had the issue on our server, and it seems that it was making rdiff-backup completely miss the previous backup, thus re-creating all files on each and every backup that happens to hit this bug, i.e. basically all.  This made our backup system save way more than it was supposed to (like 7x more...). I thus consider this an important bug, I don't see why not just using mknod.


Samuel Thibault <sthibaul>
Thu 30 Dec 2010 05:52:59 PM UTC, comment #2: 

I had the similiar problem and finally I found solution:

bobby lee <bobmarty>
Fri 19 Jun 2009 08:11:53 PM UTC, comment #1: 


The example 114 character path in the original post did not display as intended.  Here it is again (it will probably be wrapped on more than 1 line):


Joe Steele <j_steele>
Fri 19 Jun 2009 08:02:12 PM UTC, original submission:  

Currently, rdiff-backup (v. 1.2.8) will attempt to back up socket files by using socket() and bind() to recreate the socket file on the destination system.  I suggest using os.mknod() instead.  The main advantage for mknod() is that it can create socket type files using paths of arbitrary length, whereas bind() is limited to a maximum of 107 characters.  A disadvantage is that os.mknod() is only available for python >= 2.3.

Using mknod() instead of bind() should help to eliminate the error:

SpecialFileError somewhere/foo/bar/socket Socket error: AF_UNIX path too long

I've attached a file to this bug report that contains a patch to rpath.py which seems to work for me.  It's written so that if mknod() fails, the program reverts to its current behavior for creating sockets using bind().

By the way, I don't see where anyone has ever mentioned it, but one of the reasons the "AF_UNIX path too long" error occurs is because, sooner or later, the socket changes (e.g., when a daemon is restarted) and another backup is run, creating an increment/snapshot file that looks something like this:


At 114 characters, this path will generate the "AF_UNIX path too long" error when passed to bind(), even though the lengths of the paths for the original socket (/somewhere/foo/bar/socket) and the backup destination (/somewhere-else/my-backup) are not particularly long.

Another approach for eliminating these errors would be to do what the tar command does -- ALWAYS ignore sockets when backing up (don't even permit them to be optionally backed up).  After all, there really isn't much point in backing up sockets.

Joe Steele <j_steele>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #18293:  rpath.py.patch.txt added by j_steele (788B - text/plain)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by davekempe (Posted a comment)
  • -email is unavailable- added by sthibaul (Posted a comment)
  • -email is unavailable- added by sthibaul (Voted in favor of this item)
  • -email is unavailable- added by bobmarty (Posted a comment)
  • -email is unavailable- added by j_steele (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 100 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-02-12 davekempe Open/ClosedOpen => Closed
    2015-06-30 sthibaul Carbon-Copy- => Added sthibaul
    2009-06-19 j_steele Attached File- => Added rpath.py.patch.txt, #18293

    Back to the top

    Powered by Savane 3.5