Ignoring Android/obb

similar issue here: Android - Unable to exclude /Android/obb and /Android/data - #3 by auanasgheps OP says they can ignore Android. I tried that and still get the error.

Here is my .stignore:

*
**
**Android/*
Android
**Android/obb
/storage/emulated/0/Android/**
/storage/emulated/0/Android
!/DCIM/*
!/Documents/*
!/Fujifilm/*
!/Pictures/*
(?i)thumbnails
*
**

as you can see I tried to throw everything at it, but it’s still trying to access obb.

Two questions: is my sync failing because of this? Doesn’t look like it, but I just want to be sure… What’s the effect of this error? Is it just a warning, and can be ignored?

If you have any non-trivial include patters (starting with !, having any wildcards, path separators or not rooted/starting with a /) the file watcher needs to watch the entire folder → you’ll see those errors.

As @imsodin mentioned, the problem you’re experiencing is explained in a note under https://docs.syncthing.net/users/ignoring.html.

Also, it seems that you’re trying to sync the entire /sdcard partition on Android. This is usually not a good idea, because there’re many restricted and/or unneeded folders there. It also seems that you only want to sync four actual folders, so what I’d suggest is to simply add them all to Syncthing separately.

I mean these four.

/sdcard/DCIM
/sdcard/Documents
/sdcard/Fujifilm
/sdcard/Pictures

If you add them to Syncthing one by one, then you don’t need to worry about any ignores.

dang. thanks, y’all. I was kinda hoping to make a generic .stignore for all my household’s devices and have a single folder to sync to per device, instead of four.

why is this so tricky? is this the right place to start looking: syncthing/walk.go at bf7f82f7b255c80cfb0bf93110b361657ec02f3b · syncthing/syncthing · GitHub ?

does this error prevent all other files from syncing?

No, Syncthing will sync the excluded folders despite the error. However, the error itself will persist. I’d still suggest using four folders, but if you really want to have just one, the actual ignore patterns that you probably need are

(?i)thumbnails
!/DCIM
!/Documents
!/Fujifilm
!/Pictures
*

The order of ignores and exclusions does matter.

For the record, the only way to actually get rid of the error that I can think of would by to run Syncthing as root.

The error is just about file watching - that won’t work. You can disable it and it will sync with the periodic scans.

Is it “all or nothing” like that? I thought the watched would still work fine for the rest of the folders that Syncthing’s got access to…

This is assuming that OP’s seeing the exact same error message as reported in https://forum.syncthing.net/t/android-unable-to-exclude-android-obb-and-android-data/17050.

It is fairly all or nothing. If the watcher can’t watch the folder we need to scan. We could fall back to some sort of “watcher plus frequent scans” mode, but that’s not what we do.

The watcher is indeed all or nothing. And we do fall back to more frequent scans when it’s failing already.

Ah, that changes things :open_mouth:. I’d say having four separate folders is a much better solution in this case then.

exactly, except I can’t do this:

If I exclude the folder Android the error will go away

How do I exclude Android?

They say “exclude”, but they really seem to mean “ignore”. For example, if you wanted to sync the whole /sdcard partition, then you could add /Android to the ignore patterns to get rid of the error.

In your case, the problem is that you’re trying ignore everything with * and then exclude a few folders with ! at the same time, which causes the file watcher to stop working due to the permission errors. The only solutions seem to be a) adding each of the four folders to Syncthing separately, b) not using any ! exclusions, e.g. by ignoring all unneeded stuff by their name instead of using *, or c) running Syncthing as root.

1 Like

OMG… duh! I can’t believe this, I have a backup .stignore file that had the solution in there :facepalm:

solution:

cd SDCard
ls > .stignore

then edit .stignore, removing the directories that need to be sync’d.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.