rsync : pack_smb_acl: sys_acl_init(): Cannot allocate memory (12) error

parse error

A few days ago, my (self-made) backup system (based on rsync) started to complain :

rsync: pack_smb_acl: sys_acl_init(): Cannot allocate memory (12)

Googling the error led me to this thread where the almighty Mike Bombich was asking some question about rsync source code. To demonstrate his issue, he wrote :

On Mac OS X, a file with the system limit of 128 ACEs will consistently run into the error noted in the subject.

D*mn ! What if some file somewhere on the server had more than 128 ACEs ? That could explain the error !

So, once more, I fired up Terminal and wrote a little shellscript to find files that have a suspicious high number of ACEs.

First, write a very simple program that will count ACEs :

#!/bin/sh

nb=$(ls -lde "$1" | wc -l | tr -d " ")
nbACE=$(($nb-1))

if [ $nbACE -gt 10 ]    # Change "10" with the value that best suits your need.
then
    echo "$1 ($nbACE)"
fi

exit 0

Save it as nbACE.sh and make it runnable.

And then, just use find like this (and as root) :

find "/Your/Path" -exec nbACE.sh {} \; > ./TooManyACEs.log

It can take a while to run, so be patient :) But when finished, you'll find the culprit(s) in TooManyACEs.log.