Skip to content
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

attrs: [Errno 1] Operation not permitted: '<FD 7>' #5092

Closed
Peitemoukiemena opened this issue Apr 9, 2020 · 12 comments · Fixed by #5592
Closed

attrs: [Errno 1] Operation not permitted: '<FD 7>' #5092

Peitemoukiemena opened this issue Apr 9, 2020 · 12 comments · Fixed by #5592
Assignees
Milestone

Comments

@Peitemoukiemena
Copy link

Have you checked borgbackup docs, FAQ, and open Github issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

Issue

System information. For client/server mode post info for both machines.

Your borg version (borg -V).

borg 1.1.9 on the server being backed up
borg 1.1.7 on the server with the remote repository

Operating system (distribution) and version.

centos 7 on the server being backed up
Linux synology on the server with the remote repository

Hardware / network configuration, and filesystems used.

ext4 on both

How much data is handled by borg?

16 GB original size

Full borg commandline that lead to the problem (leave away excludes and passwords)

borg extract /path/to/repo::my-files home/USERNAME/src

Describe the problem you're observing.

I run the above command to extract some files from a certain path and I get the error

attrs: [Errno 1] Operation not permitted: '<FD 7>'

Even though I see the error when extracting, I check the file afterwards and it has been extracted and the size is normal. Then why do I see this error? Could it mean that the file is corrupted?

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

I run borg create on the centos server. The repository is remote on the synology. The backup run succesfully. Then when I am extracting on synology, I see the error.

Include any warning/errors/backtraces from the system logs

No logs on synology.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Apr 9, 2020

try to reproduce with a current borg version (to which you want to upgrade anyway, see changelog).

also try as root.

"attrs" means that it happens when trying to set xattrs (or ACLs or selinux stuff). That needs to be supported by your filesystem to work.

@ambis
Copy link

ambis commented May 7, 2020

I got this too. Running 1.1.11 everywhere and backup to Borgbase.

Backup is created on a Centos 7 with SELinux set to enforcing.

I tested by running a borg docker image on my docker-for-mac (also 1.1.11) and against the same borgbase remote.

When I ran the same restore command on the Centos 7 host, no errors were given. File was always extracted OK, regardles of the env/error.

@ambis
Copy link

ambis commented May 7, 2020

"attrs" means that it happens when trying to set xattrs (or ACLs or selinux stuff). That needs to be supported by your filesystem to work.

Oh. Could it be possible to detect this in Borg code and maybe tell the user that some attrs couldn't be restored, and the usual culprit being that current fs not supporting some attrs.

It also threw me off for a while, I tought the extract command had errored, especially when it says Errno 1 and not warning. Error means non-recoverable usually. I only checked if the file was extracted when someone in one of these issues mentioned that the file did extract OK.

@ThomasWaldmann ThomasWaldmann added this to the 1.1.12 milestone May 7, 2020
@Peitemoukiemena
Copy link
Author

True, I restored a backup and even though each and every file had this Error, the restored backup was complete.

@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.12, 1.1.13 Jun 1, 2020
@ThomasWaldmann
Copy link
Member

a general thing to check/improve here: it refers to an FD number, does it also show the filename? if not, we should find some way to do that. this is especially an issue in master branch, where a lot of stuff happens based on the FD (and not the filename).

@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.14, 1.1.15 Sep 8, 2020
@Peitemoukiemena
Copy link
Author

Indeed it shows the full path and filename before the [Errno 1] Operation not permitted: '<FD num>'

@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.15, 1.1.16 Nov 10, 2020
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 22, 2020
emit a warning message giving the path and the xattr key,
which is better than the previous output only refering to a
FD and not giving the xattr key.

also: continue trying to restore other xattrs and bsdflags afterwards
(it did not continue with this before this fix).
@ThomasWaldmann ThomasWaldmann self-assigned this Dec 22, 2020
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.16, 1.1.15 Dec 22, 2020
@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Dec 22, 2020

I just noted that the bigger problem related to this is that other xattrs and bsdflags (of same file) got skipped by the bad exception handling.

ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 22, 2020
…gbackup#5092

emit a warning message giving the path, xattr key and error message.

also: continue trying to restore other xattrs and bsdflags afterwards
(it did not continue with this before this fix).
@ThomasWaldmann
Copy link
Member

@Peitemoukiemena @ambis can you check the patch in #5583, like:

  • reproduce the issue without patch
  • try patched code in same circumstances

ThomasWaldmann added a commit that referenced this issue Dec 24, 2020
extract: catch EPERM when setting xattrs, fixes #5092
@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Dec 24, 2020

now merged into 1.1-maint branch (and released in 1.1.15) and tagged for forward porting to master.

@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.15, hydrogen-rc1 Dec 24, 2020
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 25, 2020
…gbackup#5092

emit a warning message giving the path, xattr key and error message.

also: continue trying to restore other xattrs and bsdflags afterwards
(it did not continue with this before this fix).
@Peitemoukiemena
Copy link
Author

Peitemoukiemena commented Dec 29, 2020

@Peitemoukiemena @ambis can you check the patch in #5583, like:

  • reproduce the issue without patch
  • try patched code in same circumstances

@ThomasWaldmann Would I need to update Borg to the latest version to try patched code?

@ThomasWaldmann
Copy link
Member

@Peitemoukiemena you need to use 1.1.15. if there are no packages from your favourite dist yet, you can either use the fat binary from github releases or install via pip or git (from source).

@mnpenner
Copy link

mnpenner commented May 1, 2021

Thanks for the pointers about the attrs not being supported. I found there's a few options to simply ignore these.

I'm extracting my backup to Windows now like this:

borg extract --progress --noacls --noxattrs --nobsdflags ::Desktop-C-Drive-2021-04

No errors yet.

@ghost ghost mentioned this issue Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants