-
-
Notifications
You must be signed in to change notification settings - Fork 763
"attrs: [Errno 12] Cannot allocate memory" when restoring ACLs without associated user id #8750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
OS is Linux I suspect?
Please add the borg command you used for restoring. You say you noticed a lot of these errors. I am wondering about the "attrs: " part - is that a file name? Is that always the same in all error msgs you see? |
I could reproduce using the repo linked above:
|
That's the archived access ACL that blows things up:
This gets converted via
And if that is fed into
|
Right, OS is Linux, and |
There are multiple issues here with As field0 is "user", it tries to convert the name from field1 to a local uid. But, if samba is not running, that fails (the mapping is unknown then) and it defaults to the contents of field3 (which usually should contain the archived uid, but is a name here!?). Using So guess the root cause of this issue is field3 not containing an archived uid. Additionally, there is also non-borg issue with |
So, it looks like maybe samba was not running at |
Reproduce the non-borg bug:
Result:
Any non-existent username leads to this error, even simple ones like "foo". Update: seems fixed since a while: https://git.savannah.nongnu.org/cgit/acl.git/commit/?id=56abe432b65801f31277fb9a3bca0f9e31502315 Not released yet, bug is still present in libacl 2.3.2. |
About field3: I think there is only one way how a name can end up being there (and getting into the archived ACL): If the lookup username -> userid (or groupname -> groupid) fails at The @jernejs please check. ^^^ |
How would I check for this? |
@jernejs Maybe check if all services required for the lookup run all the time while the backup is running, check cron jobs and other timers, logs. |
I've been running this since yesterday evening, and it hasn't exited yet: import pwd
import time
import sys
def user2uid(user, default=None):
try:
return user and pwd.getpwnam(user).pw_uid
except KeyError:
return default
while str(user2uid('YGGDRASIL\\ender','YGGDRASIL\\ender')) == "1101104":
print(".", end="", flush=True)
time.sleep(1) (I did test it first by stopping Samba, which caused it to exit immediately). |
Maybe make the sleep much shorter (like 1ms), so you could also notice "outages" shorter than a second. |
OK, commented out the print line and changed interval to |
Did you use Then 2 outcomes are possible:
|
When I was doing real archive extract, I did use --numeric-ids; while doing tests with the above archive, I tested both with and without (and it didn't make any difference). |
Hmm, maybe we can take another approach (as I miss the necessary samba/winbind environment here to reproduce): Can you reproduce the bug without involving samba/winbind? The bug to reproduce is If it's a borg bug, that should be possible and if it is not, guess the samba devs need to analyse/debug this. Maybe you can also try if this script is enough to reproduce in your samba environment:
If that makes the bug visible in the samba environment, try to produce the same bug without samba. |
I had to do a bare metal restore of my server today, and during restore I noticed a lot of "attrs: [Errno 12] Cannot allocate memory" errors. It appears that Borg (v1.4.0) stores ACLs as username only (no numeric id), and then fails to restore them with that error message when the user is not present on the system.
Here's a minimal test case — restore archive test3 to reproduce (the test was done by setting ACLs to user belonging to an Active Directory domain; after stopping Samba, restoring the backup produces the above error; if I make a backup while Samba is stopped, Borg stores numeric id in ACL, and restore then works regardless of whether Samba is running or not).
The text was updated successfully, but these errors were encountered: