Hey!
I have syncthing running on a docker container on my unraid nas, and wanted to sync my obsidian vault between it and my local computer. When I set up the initial link, everything syncs fine, the folder and files get created on my local computer, and all is good, but the moment I open the vault on my computer it already gets out of sync (I imagine because obsidian changes files when it opens), and whenever I change any file by myself, they also get out of sync, and don’t get synced over to my NAS.
The container is using pgid and puid of 1000, my local user on my computer has pgid and puid of 1000 as well (by default the container is configured to use 99 and 100, which also leads to the same problem).
On the container logs, I have the following:
2024-08-25 11:28:56,107 DEBG 'start-script' stdout output:
[264JB] 2024/08/25 11:28:56 INFO: Puller (folder "Obsidian" (qvtc3-zewjk), item "Personal/.obsidian/workspace.json"): syncing: finishing: opening temp file: open /media/files/Obsidian/Personal/.obsidian/.syncthing.workspace.json.tmp: permission denied
[264JB] 2024/08/25 11:28:56 INFO: Puller (folder "Obsidian" (qvtc3-zewjk), item "Personal/Random/To-do installing containers.md"): syncing: finishing: opening temp file: open /media/files/Obsidian/Personal/Random/.syncthing.To-do installing containers.md.tmp: permission denied
[264JB] 2024/08/25 11:28:56 INFO: "Obsidian" (qvtc3-zewjk): Failed to sync 2 items
[264JB] 2024/08/25 11:28:56 INFO: Folder "Obsidian" (qvtc3-zewjk) isn't making sync progress - retrying in 8m0s.
all values are hidden
2024-08-25 11:29:19,757 DEBG 'start-script' stdout output:
[264JB] 2024/08/25 11:29:19 INFO: quic://0.0.0.0:22000 resolved external address quic://[redacted]:1028 (via stun.syncthing.net:3478)
And on the list of out-of-sync files, I have the following:
Personal/.obsidian/workspace.json | 8.57 KiB | 2024-08-25 11:15:40 | gabe-arch |
---|---|---|---|
Personal/Random/To-do installing containers.md | 79 B | 2024-08-25 11:25:09 | gabe-arch |
I also tried ticking the “Ignore Permissions” under the advanced tab on both my machine and on my nas (both checked even before the initial sync), and still have the problem
Checking the permissions on the files that get out of sync, I get the following:
.rw-r--r-- 79 gabe 25 Aug 11:25 ď’Š 'To-do installing containers.md'
$ id gabe
uid=1000(gabe) gid=1000(gabe) groups=1000(gabe) [...]
On my container start, I get the following:
2024-08-25 10:58:08.971132 [info] Host is running unRAID
2024-08-25 10:58:08.996223 [info] System information: Linux faab5072461a 6.1.99-Unraid #1 SMP PREEMPT_DYNAMIC Tue Jul 16 10:06:03 PDT 2024 x86_64 GNU/Linux
2024-08-25 10:58:09.015807 [info] Image tags: IMAGE_RELEASE_TAG=1.27.10-1-01
2024-08-25 10:58:09.044596 [info] PUID defined as '1000'
2024-08-25 10:58:09.124100 [info] PGID defined as '1000'
2024-08-25 10:58:09.220425 [info] UMASK defined as '000'
So the container is getting the correct puid and pgid. I also tried running the container with PCAP=cap_chown,cap_fowner+ep
suggested on syncthing/README-Docker.md at main · syncthing/syncthing · GitHub, but it also didn’t help
If I let the container run as a privileged user and set it to puid and pgid of 0, it syncs fine, but then I get the annoying message that it shouldn’t run as a privileged user.
Also, sorry for the long post, I know these perm issues get posted here quite a lot, but most of the things I tried above I found while searching here, and none of them worked in my case…
I just wanted a lightweight alternative to nextcloud (which can sync this folder without a problem), but this permission issue is driving me crazy