My ST on Android stopped synchronizing my DCIM/Camera folder because of the following error:
Error on folder “Camera” (abcde-fghij): folder marker missing (this indicates potential data loss, search docs/forum to get information about how to proceed)
I’ve checked that .stfolder directory exists and that in advanced settings of the Camera folder there is Marker Name set to .stfolder too. I’ve tried to restart ST or the folder, to recreate the .stfolder, but nothing helped.
I don’t think that this is related with ST version 1.7, last successful synchronization was about in May. I’ve got several folders set up on this mobile phone, but only the “Camera” folder reports this problem.
The synchronization on “Camera” is set up as unidirectional (phone -> NAS). .stfolder exists both on the phone and on NAS. NAS does not report any error.
Permissions are per file/folder. So it’s entirely possible this is still the cause. Just because another folder has the correct permissions, doesn’t mean the folder in question does. The permissions for an SD card are not identical across dirs, it’s like any other file system. Check permissions with a file app on the known good folders and make sure the problematic folder matches.
this is a good observation granting some insight into how the Android OS on your phone works. I can make a guess this has to do with the scoped storage implementation which I expect does some recording of which app/process does tinker with which files on your SDcard. To create the marker yourself, Android sees the world like another app does “own” the file. “own” is not meant in the context of a unix file owner in this case.
Android asks if the app can access the card when you first start the app, but this is just Android checking if you want the app to even have visibility of it and permission to use it.
The file system of the card itself is entirely different. If you manually create a folder instead of letting syncthing do it, the permissions may be wrong. This is why deleting the app and reinstalling did not help. Once you deleted the folder and allowed syncthing to recreate it, it was created correctly with the correct permissions.
If granting an app permission to see a card from an Android OS perspective changed all the file system permissions on it at the same time, it would be disastrous for other apps that have specific permissions.
I still don’t understand this, I’ll have to read something about how Android handles permissions on SD-cards. The thing is that this has changed many times in the last few years, and as @Catfriend1 suggests, each vendor may implement it differently. I am no expert for Android, I treat it like Linux :-).
A house has a front door you either have a key or you don’t. The house is the SD card, the key is when you say you want the app to access the card.
Inside the house, there are multiple belongings that could belong to multiple users/apps (files and folders). Each of these you may or may not touch (permissions).
There is also a security guard in the house to make sure you don’t touch anything you should not (the OS kernel). If you don’t have permissions to touch it, you can’t.
If the person who owns the belonging gives you permission, you can touch something. But just because you are allowed in the house doesn’t mean all the stuff belongs to you.
And, if you create a file/folder without giving access to someone else, they cannot touch it. So when you created the folder you didn’t give the syncthing app permission. When it creates it, it creates it as it’s own.
I understood what you wrote even in your previous post. But it contradicts what I thought I knew about this. What you’re describing feels to me rather as a description of the internal storage than of an SD-card. And even when I accept what you write (I do not doubt you know what you’re writing) such a behaviour seems inconsistent to me and there are many aspects of it I do not understand. I’ll have to read something about it.
Ok, but last comment on it: The OS doesn’t care whether it’s internal storage (flash) or an SD card. For most situations, storage is storage. It will all behave the same. Each has access permissions (the entire thing) and individual file folder permissions on a file system level.
I do not know how it is now, but a few years ago (Android 6/7?) there was a huge distinction between how OS treated privileges in the internal storage and in the SD-card. But as I said, this probably has changed again since then.
There may have been some differences with certain locations and their “standard” permissions (like in the root dir) on previous versions, but I am unaware of any massive differences that would affect this… maybe with 4 or 2. But I could be totally wrong though as I am not familiar with every android version. If you find anything post back here as it’d be good to know