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.

@mikesmith I’ve cleaned up the bugfix implementation in backup: Ignore xattr.list permission error for parent directories by MichaelEischer · Pull Request #4668 · restic/restic · GitHub . Can you give it another try?

Sure, give me a bit here and I’ll report back

Ok just going to document my steps as it took me way to long to figure out what I did last time so please excuse the verbosness of this response. It’s more notes for me than it is for you.

mkdir gitclones
git --version
git version 2.30.2
git clone https://github.com/restic/restic.git
cd restic
git fetch origin pull/4668/head:xattr
git switch xattr
Switched to branch 'xattr'
go build ./cmd/restic
[BUILDING]
./restic version
restic 0.16.4-dev (compiled manually) compiled with go1.21.6 on linux/amd64
restic version
restic 0.16.3 compiled with go1.21.6 on linux/amd64
restic -r /srv/dev-disk-by-uuid-********-0930-4e39-****-39b9949d537c/Restic/test3/ backup /srv/remotemount/d/Images/
enter password for repository:******
repository b345ca87 opened (version 2, compression level auto)
found 1 old cache directories in /srv/dev-disk-by-uuid-********-104a-4d4f-****-d48b2ebad690/Home/user1/.cache/restic, run `restic cache --cleanup` to remove them no parent snapshot found, will read all files

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

./restic -r /srv/dev-disk-by-uuid-********-0930-4e39-****-39b9949d537c/Restic/test3/ backup /srv/remotemount/d/Images/
enter password for repository:******
repository b345ca87 opened (version 2, compression level auto)
found 1 old cache directories in /srv/dev-disk-by-uuid-********-104a-4d4f-****-d48b2ebad690/Home/user1/.cache/restic, run `restic cache --cleanup` to remove them no parent snapshot found, will read all files
[0:00]          0 index files loaded

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 ca1fe132 saved

So I take this as a success?

If you need me to do anything happy to help. Sorry for the delay.

Thanks for testing! Yes that looks like the fix worked.

Woot woot.

So what are the next steps?

When will this go into “production”?

It will be part of restic 0.17.0, but that will still take some time, there’s still quite a bit left to do on the roadmap Restic 0.17 roadmap · GitHub .

Cool, how come I don’t see #4668 on that list?

Good to know progress is being made and I had a small part in it :innocent:

Yay open source.

The roadmap is currently largely focused on issues/PRs that were planned for the next release. I haven’t taken the time to add the flurry of small fixes there, and now it’s too late for that.