Android Device Always Has Local Changes


This is a bit of a rant about Android, so apologies for that :slight_smile:

I’ve just got a new phone (Nokia 5.4 running Android 10) and one of the first things I tried was using Syncthing to sync my music to my phone.

SPOILER: I’m about 99.9% sure the problem here is the exfat filesystem.

The plan is (or was): Server (send only, ignore perms) → Phone (receive only to SD card, ignore perms).

[I notice that there’s a new permissions system in Android 10, so I was able to choose a normal directory on the root of the SD card, instead of only one under Android/Data/com.numatic.syncthingandroid/files. I also notice that Android 10 forces a .nomedia file in Android/data, and if you remove it, it comes back a minute later… anyway…]

The problem is that after letting the files sync, the Android device always says there are local changes. I haven’t changed any files, and I assume Android itself hasn’t (does the media scanner change anything?).

There are a couple of things that spring to mind relating to FAT filesystems:

  • mtime window (although, fixed I think. See this post
  • case sensitive filesystem (although a quick experiment suggests that syncthing can detect collisions, and i get no such message when syncing my music).

And it’s worth noting that rsyncing files to an android SD card (via termux) often re-transfers unchanged files too, even with the switches to account for permissions and mtime window. So this isn’t unique to syncthing it seems.

I had planned to mount the SD card as “internal storage” so as to avoid FAT filesystems entirely, but the kind folks at Nokia have disabled this feature, so I’m stuck with FAT if I want to sync to the SD card.

So, is this a losing battle? Should I give up and sync a subset of my music to my internal storage?

The folks at google are sure doing a great job of making this really annoying.

[And don’t get me started on the large google search bar that you can’t remove from the home screen!]

1 Like

Don’t know. Maybe I will hazard a guess if I know what Syncthing sees as different. Can you query /rest/db/file? If I remember correctly that works fine with curl in an adb shell.

Now as to the rant (I won’t grudge anyone a good rant about android :slight_smile: ):

Before anyone gets exited: That’s not Android 10, that’s Nokia. Please do not ask smart questions, I know nothing about why and so on. I just know that on my Android 10 and according to docs, it’s still supposed to be restricted. And on my last Nokia I also did have access to the sd card (unfortunately I had to retire it while working perfectly because of missing upgrades - thanks for that).

For media there’s Android/media/… instead.

It’s not entirely fair to give all the credit for Android pain to google: Vendors (for you Nokia) inflict their fair share too. I’d tend to give them even more credit than google. At least I don’t have that bar on lineageos+microg (aka android how it should be :slight_smile: ).

Well, I’ve been trying but it seems the phone becomes very unstable as soon as you turn on USB debugging, rebooting randomly.

I also tried in termux, but there you don’t have permissions to /.

Is there any other way?

What was your theory?

By the way, what device do you use for this?

Been to brief there: I meant GET /rest/db/file — Syncthing v1 documentation. You shouldn’t need access to /. You can get the api key from the web ui and that should be enough.

I agree with you that timing is the likely culprit. I’d like to see what the time difference actually is. No further theory unfortunately.

Sony xperia xa2. Criteria: Supported by lineageos, is smallish (I wanna be able to type with one hand without getting cramps), has extensible storage (or a reasonable amount of internal storage - how do phones still have so ridiculously tiny storage when storage is so cheap today), headphone jack. Nice to have (which the xa2 doesn’t all tick): Available second hand with guarantee, reasonably good camera, dual sim, …

Ah, I see, via the rest interface.

I’m doing this via termux on the phone:

$ curl -X GET -H "X-API-Key: <redacted>" --insecure https://localhost:8384/rest/db/file
No such object in the index

Is that what we expected, or am I doing something wrong?

I expected a JSON payload I think?

(FWIW, the /rest/system/browse endpoint works and returns JSON)

I somehow misremember having done lots of debugging with you and /rest/db/file, thus have been too brief: What I need is the output of that endpoint for one of the locally changed files. So the url will be something like /rest/db/file?folder=*folder-id*&file=*path/to/locally/changed/file/relative/to/folder/root.

Gotcha. No worries, it probably doesn’t help that I don’t know what I’m doing either.

I’ll try and get that info!

1 Like

I think this is a dead end.

The android app is now telling me that the OS isn’t allowing write access to the SD card. I tried removing the folder from ST and re-adding, and even uninstalling and re-installing ST.

What’s weird is I certainly have written the SD card in this way before. When adding the folder to ST there is even a popup asking if I want to grant ST access to the folder. I can’t see anything in settings to grant specific SD paths to apps either.

I think the Nokia SD implementation is buggy. I give up – I’ll sync a subset to my internal storage! :stuck_out_tongue:

@imsodin Thanks for your patience with this and sorry for the noise.

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