My sync heavily relies on ignore patterns and followed the advice of pointing my .stignore to a .stglobalignore file. So far everything worked fine until I tried to exclude all hidden files by adding “(?d.*)” excluding my global ignore file at the end of my global ignore file. Suddenly Syncthing tries to traverse directories that were previously ignored.
For example I have the following ruleset (the complete file attached):
#snapshot
!/.stglobalignore
(?d).*
Now Syncthing tries to traverse “#snapshot”. I don’t understand it because I thought the order mattered and the first matching rule wins.
error while traversing /volume1/Grafik/#snapshot/GMT+01-2019.01.10-19.01.03/@eaDir/SYNO@.fileindexdb: permission denied
If I delete “!/.stglobalignore” everything works as expected but then my global ignore won’t get synced. Is this expected behaviour?
Ignore patterns are not regexps. “.*” means to ignore files and directories with names starting with a period. “#snapshot” does not begin with a period.
The error you are seeing is coming for the “watching for changes” feature which does not take ignores into account when setting up watches if there are any include patterns (!...). Events are still filtered by ignore patterns when they happen. I am afraid the only workaround is to either disable that feature or not use include patterns.