Hello everyone,
I’ve been dealing with some permission-related issues with my Restic backup repository over SFTP and wanted to ask for your help.
• Version: restic 0.9.4 compiled with go1.11.6 on linux/amd64
.
1- Initial Problem:
I encountered the following error in my backup logs:
Load(<index/1c73fc4299>, 0, 0) returned error, retrying after 583.982418ms: sftp: "Permission denied" (SSH_FX_PERMISSION_DENIED)
2- I compared the index file permissions between two installations (A and B):
Installation A (working):
-r-------- 1 root root [size] [date] [index files]
-r-------- 1 root root [size] [date] [index file]
Installation B (problematic) → Had mixed ownership:
-r-------- 1 root root [size] [date] [index file]
-r-------- 1 userX userX [size] [date] [index file]
-r-------- 1 userX userX [size] [date] [index file]
-r-------- 1 userX userX [size] [date] [index file]
Since the most recent index file was owned by root:root, I changed ownership to userX:userX, since the previous ones in this installation had been working.
3- Then I ran restic rebuild-index
, which resulted in new errors, but this time in data:
``Load(<data/81b447e5b9>, 591, 13778406) returned error, retrying after 409.551505ms: sftp: “Permission denied” (SSH_FX_PERMISSION_DENIED)`
After rebuild-index, I noticed:
- Old index files disappeared
- Only one new index remained, owned by root:root:
4- Afterwards , running restic check
showed:
created new cache in /tmp/restic-check-cache-720761760
create exclusive lock for repository
load indexes
check all packs
pack 81b447e5: not referenced in any index
pack d79761a5: not referenced in any index
2 additional files were found in the repo, which likely contain duplicate data.
You can run `restic prune` to correct this.
check snapshots, trees and blobs
error for tree f003cd40:
tree f003cd4010c50c0d818d47e65c5f5f4f3519284f7930e0d5153d8d91602ff1c2 not found in repository
5- As suggested I ran restic prune
, but got more permission errors in data again:
Load(<data/81b447e5b9>, 591, 13778406) returned error, retrying after 376.970741ms: sftp: "Permission denied" (SSH_FX_PERMISSION_DENIED)
But then, again comparing both installations A and B, they have the same permissions in data, e.g.
Installation A:
/data/00 →
-r-------- 1 userX userX [size] [date] [index file]
-r-------- 1 userX userX [size] [date] [index file]
Installation B:
/data/00 →
-r-------- 1 userX userX [size] [date] [index file]
-r-------- 1 userX userX [size] [date] [index file]
I’m hesitant to make any further changes as I don’t want to risk damaging anything or make irreversible changes to the repository. Any guidance would be appreciated.
Thank you all in advance for your help!