Fixing Time Machine / Netatalk (error (null))

Fri 19 February 2016 by feld

Recently I was setting up a new Time Machine backup on my wife's MacBook so it would use my FreeBSD/ZFS server. My own personal MacBook was already backing up to it successfully and has been for quite some time. When I attempted to start a new backup to the server I received a strange error after a few minutes:

The backup disk image "/Volumes/backup/Michelle's MacBook.sparsebundle" could not be accessed (error (null)).

After digging through the OSX system logs I also found these entries:

Feb 12 07:29:54 Michelles-Macbook[12798]: Attempting to soft mount network destination URL: afp://shell@skeletor._afpovertcp._tcp.local/backup
Feb 12 07:29:55 Michelles-Macbook[12798]: Mounted network destination at mount point: /Volumes/backup using URL: afp://shell@skeletor._afpovertcp._tc
Feb 12 07:29:57 Michelles-Macbook[12798]: Network destination already mounted at: /Volumes/backup
Feb 12 07:30:25 Michelles-Macbook[12798]: Creating disk image /Volumes/backup/Michelle's Macbook.sparsebundle
Feb 12 07:30:44 Michelles-Macbook[12798]: error processing extended attributes: Input/output error
Feb 12 07:30:44 Michelles-Macbook[12798]: Error moving disk image from /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/'s Macbook.tmp.sparsebundle to /Volume
s/backup/Michelle's Macbook.sparsebundle - Error Domain=NSCocoaErrorDomain Code=512 "“Michelle's Macbook.tmp” couldn’t be moved to “backup”." UserInfo={NSDestinationFilePath=/Volumes/backup/Michelle's Macbook.
tmp, NSUserStringVariant=Move, NSFilePath=/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/'s Macbook.tmp.sparsebundle, NSUnderlyingError=0x7fc1a9529660 {Error Domain=NSCocoaEr
rorDomain Code=512 "“0” couldn’t be copied to “bands”." UserInfo={NSSourceFilePathErrorKey=/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/'s Macbook.tmp.sparsebundle/bands/0,
        ), NSDestinationFilePath=/Volumes/backup/Michelle's Macbook.tmp/bands/0, NSFilePath=/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/'s Macbook.tmp.sparsebundle/bands/0
, NSUnderlyingError=0x7fc1a954d2e0 {Error Domain=NSPOSIXErrorDomain Code=5 "Input/output error"}}}}
Feb 12 07:30:44 Michelles-Macbook[12798]: Failed to create disk image /Volumes/backup/Michelle's Macbook.sparsebundle, status: 512
Feb 12 07:30:44 Michelles-Macbook[12798]: Network destination already mounted at: /Volumes/backup
Feb 12 07:30:44 Michelles-Macbook[12798]: Backup failed with error 20: 20
Feb 12 07:30:45 Michelles-Macbook[12798]: statfs call failed, error: 2 No such file or directory
Feb 12 07:30:45 Michelles-Macbook[12798]: Ejected Time Machine network volume.

I managed to recreate the issue by going into /var/folders/zz on the MacBook and finding a file with extended attributes. When attempting to cp it to /Volumes/backup, the location where the Time Machine backups are supposed to go, it produced an error which was easy and quick to reproduce. I investigated the netatalk documentation and found that the ea setting was auto by default. This was not sufficient. The fix was to edit the afp.conf and add the following:

ea = ad

After restarting the netatalk services I was able to successfully cp the file manually from the MacBook to my server which was the first indication that this problem was solved. The next attempt of a Time Machine backup was successful. Mystery solved.