Parent directories above the snapshot source path: Fatal Error Permission Denied

Hello everyone,
I’m having the same issue that u/Sevos had in Jul 2022. You can see his post here: Can’t use an absolute path (maybe only as an user?)

Example: restic -r /srv/dev-disk-by-uuid-06812e1a-0930-4e39-9ec3-39b9949d537c/Restic/test/ backup /srv/remotemount/x/Document/ leads to this:

Fatal: unable to save snapshot: NodeFromFileInfo: Listxattr: xattr.list /srv/remotemount/x : permission denied

Current setup:

  • Using the latest beta binary: restic 0.16.3 (self-update) from 0.11
  • root user

As a workaround, I can go to the directory of the target and include/pass the main folder.

Example:

cd /home/sevos/x cd /srv/remotemount/x/Document/
restic -r /srv/dev-disk-by-uuid-06812e1a-0930-4e39-9ec3-39b9949d537c/Restic/test/ backup .

That will work just fine. However, not perfect if I want to do multiple --files-from paths.

Is there any way to fix this nicely or is it particularly restic related issue?

Now in his post there is a marked solution from u/MichaelEischer :

This is issue unable to save snapshot: NodeFromFileInfo: Listxattr: xattr.list /home : permission denied · Issue #3600 · restic/restic · GitHub .

The issue also describes a workaround. 3600 is still an open issue.

Unfortunately all we have are workarounds and no solutions.

u/MichaelEischer seemed to have created a solution here, but no one at the time was interested in testing.

If anyone is interested in solving this, I promise to test it out.

Thanks in advance for anyone’s help!

PS: I can only create 2 links according to the rules. Otherwise the solution link would be a link :slight_smile:

Maybe you can take the PR Michael created and rebase it and test it?

Unfortunately that’s a little out of my capabilities. I’m ok testing the changes, but actually rebasing code is too out of my league.

1 Like

@mikesmith I’ve rebased the PR (or rather rebuilt the commits): backup: Ignore xattr.list permission error for parent directories by MichaelEischer · Pull Request #4668 · restic/restic · GitHub .

Cool ok, looks like I’ll have to check it out and build it for my system.

I’m using this on a Debian bullseye on intel hardware. Might take me a couple days to figure this out.

A bit more work then I expected, but if u/MichaelEischer is willing to help I’m obliged to try.

But it will be tested!

Just give me a couple days (maybe weekend lol)

Compiling go code is actually rather simple.

Either use the golang-go package from bullseye-backports (the non backport version is too old) or just grab the latest compiler version from All releases - The Go Programming Language .
Then clone the git repository and checkout the branch from the PR. Afterwards run cd checked/out/restic/folder && go build ./cmd/restic after a few minutes there will be a new restic binary in the current folder.

Will report back tonight. Give me 12 hours!

Ok so I did everything and I’m currently building the PR#4668

So I have the restic executable. Now I just need to figure out where it goes lol

I assume if I simply run it in the directory it should be fine correct?

How do I know I actually have the PR version and not the stable build?

Should I simply run the commands that failed in the past?

./restic version yields: restic 0.16.3-dev (compiled manually) compiled with go1.21.6 on linux/amd64

Ok so on the right track I think. I forgot to run ./ and it was using the normal restic executable.

Very nice, great success!

Ok so good news with 15 minutes to spare.

I was able to test your PR and I’m happy to report your changes succeeded. Granted the test wasn’t extensive but it looks successful.

Here is a sample of my test:

Testing stock restic

restic version
restic 0.16.3 compiled with go1.21.6 on linux/amd64
restic -r /srv/dev-disk-by-uuid-06812e1a-0930-4e39-9ec3-39b9949d537c/Restic/test2/ backup /srv/remotemount/d/AI\ Images/
enter password for repository:
repository 684716d0 opened (version 2, compression level auto)
no parent snapshot found, will read all files

Fatal: unable to save snapshot: nodeFromFileInfo /srv/remotemount/d: xattr.list /srv/remotemount/d: permission denied

Testing PR#4668

./restic version
restic 0.16.3-dev (compiled manually) compiled with go1.21.6 on linux/amd64
./restic -r /srv/dev-disk-by-uuid-06812e1a-0930-4e39-9ec3-39b9949d537c/Restic/test2/ backup /srv/remotemount/d/AI\ Images/
enter password for repository:
repository 684716d0 opened (version 2, compression level auto)
no parent snapshot found, will read all files
[0:00]          0 index files loaded

is xattr.Error true
permission denied; 0xd; syscall.Errno

true false true

Files:          18 new,     0 changed,     0 unmodified
Dirs:            4 new,     0 changed,     0 unmodified
Added to the repository: 4.306 MiB (4.300 MiB stored)

processed 18 files, 4.298 MiB in 0:00
snapshot 21233ffe saved

Looking at Snapshot

./restic -r /srv/dev-disk-by-uuid-06812e1a-0930-4e39-9ec3-39b9949d537c/Restic/test2/ snapshots
enter password for repository:
repository 684716d0 opened (version 2, compression level auto)
ID        Time                 Host        Tags        Paths
-----------------------------------------------------------------------------------
21233ffe  2024-01-31 23:40:28  omvh3                   /srv/remotemount/d/AI Images
-----------------------------------------------------------------------------------
1 snapshots

Not sure where to go from here. If you need any more testing just ask.

1 Like

Thanks a lot for testing. That information should be enough for me to finish the PR. It will probably take a few days/weeks until I get around to that.

All good no rush. Thank you for creating the PR and all the heavy lifting.