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

 
 
Show feedback again

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  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Thu 30 Dec 2010 05:52:59 PM UTC, comment #2:

I had the similiar problem and finally I found solution:
http://www.tooLongPath.com

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

Hmm...

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):

/somewhere-else/my-backup/rdiff-backup-data/increments/somewhere/foo/bar/socket.2009-06-12T19:35:55-04:00.snapshot

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 File(s):
   
   
Comment:
   

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
  • -unavailable- added by bobmarty (Posted a comment)
  • -unavailable- added by j_steele (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 19 Jun 2009 08:02:12 PM UTCj_steeleAttached File-=>Added rpath.py.patch.txt, #18293
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup