Syncthing-android: Wont sync sdcard folders/files, permission denied

Created on 8 Mar 2015  Â·  21Comments  Â·  Source: syncthing/syncthing-android

The screenshot should suffice,
image

  1. folder is on /sdcard and default one Syncthing sets up
  2. (and 2./3./4.) folder is on external sd card where I assume Syncthing dosn't have permissions to

(notice 2./3. and 4. has different paths but is actully the same directory, all is mounted by system)

Device is an stock 4.4.4 Sony Xperia Z1 Compact

invalid frozen-due-to-age

Most helpful comment

Manually copying .stfolder from another working folder also fixed my syncing issue. I think syncthing has read, but no write access to the external sdcard. Can't this be mentioned in the GUI or the error? Can't the dependency on a writable .stfolder be ditched? I only want to sync from the card, not to it...

All 21 comments

As you said, syncthing doesn't have permission to access these folders.

I don't think we can do anything about this, only Google can.

Android KitKat has put a new restriction on SD cards. Apps that utilize the external SD card can access only a folder set aside for them. They cannot write to your external card's DCIM/Camera folder or a newly-created SYNC folder. If you are willing to root your phone, you can lift the restriction using NextApp's SDFix available on the play store. Otherwise, you have to put all your sync folders inside your SD card's location Android/com.nutomic.syncthingandroid. On my phone, that's /mnt/extSdCard/Android/com.nutomic.syncthingandroid.

Yep. Maybe there should be a warning dialog about this in the app.

Hm, works fine for me on external SD card on Andriod 4.4.4 in Prestigio 5454...

To be precise, only the primary sdcard is accessible, so maybe internal storage isn't accessible in your case? That or the manufacturer modified Android there.

Not sure what you mean by primary, but both internal storage and SD card are accessible.
So if manufactor modified KitKat to make it work, I have an OT question:
Do we really live in the world where companies like google make shit software that is beeing used massively?

Well it does make sense, because every app writing to sd card has some security and usability problems (eg apps can't remove their data on uninstall, apps can access other app's data).

The Storage Access Framework can be used instead to access external storage, but few apps seem to support it (it also doesn't work with syncthing).

Hi all again,
Sorry for resurrecting the thread, but right now i'm sitting here a bit frustrated that i'm not able to do such an easy action as take photos from my android and get them on my PC.
From programming point of view, if synthing android app is able to access my photos, why shouldn't it transfer them to PC?
I cannot change the default dir for my photos on my phone (it is not rooted), so i cannot switch that to syncthing dir on sdcard... but i actually don't need that.
i just need one-way-syncronization, probably even without deleting, just one-way-uploading.
or am i missing something? :(

The camera folder should be synced by default when you install the app.

You can't change the path of an existing Syncthing folder, you'll have to create a new one.

Btw, the forum or IRC are better for support ;)

Default camera folder is working with built-in storage... and my camera app is working with sdcard.
I've tried to create numerous of folders, but each of them on sdcard has 0 files and 0 size...

Anyway thanks for the answer, if you think that forum or IRC is better then i'll try to write there, hopefully we'll meet there :)

If the sdcard is your primary storage, sync should work. Otherwise, it's probably #29 (if you use Kitkat or higher).

Can you check the logs?

after creating .stignore and .stfolder and .stfolders inside dcim dir and reinstalling the app it started working...

i'm attaching logs that i was able to save...
(the interesting thing about these logs is that .stignore file was already present)

--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
I/SyncthingNativeCode(32646): [2TMB4] 21:22:55 WARNING: Loading .stignore: open /storage/sdcard1/dcim/.stignore: permission denied
I/SyncthingNativeCode(32646): [2TMB4] 21:22:55 WARNING: Loading .stignore: open /storage/sdcard1/dcim/.stignore: permission denied
I/SyncthingNativeCode(32646): [2TMB4] 21:23:05 WARNING: Loading .stignore: open /storage/sdcard1/dcim/.stignore: permission denied
I/SyncthingNativeCode(32646): [2TMB4] 21:23:05 WARNING: Loading .stignore: open /storage/sdcard1/dcim/.stignore: permission denied
I/SyncthingNativeCode(32646): [2TMB4] 21:23:15 WARNING: Loading .stignore: open /storage/sdcard1/dcim/.stignore: permission denied
I/SyncthingNativeCode(32646): [2TMB4] 21:23:15 WARNING: Loading .stignore: open /storage/sdcard1/dcim/.stignore: permission denied
I/SyncthingNativeCode( 3320): [2TMB4] 21:23:27 INFO: syncthing v0.11.9 (go1.4.2 linux-arm android) [email protected] 2015-06-14 11:52:00 UTC
I/SyncthingNativeCode( 3320): [2TMB4] 21:23:27 INFO: My ID: .....
I/SyncthingNativeCode( 3320): [2TMB4] 21:23:28 INFO: Database block cache capacity 13627 KiB
I/SyncthingNativeCode( 3320): [2TMB4] 21:23:28 FATAL: Cannot open database: resource temporarily unavailable - Is another copy of Syncthing already running?
E/SyncthingNativeCode( 3320): Syncthing binary crashed with error code 1

... but as it is working now, thanks for your help and feel free to ask me if you'll need some more debugging - i'll try to do it :+1:

what i like about the syncthing is the idea of free decentralized file distribution - it is really awesome! thank you guys ! :)

The .stignore file isn't needed for sync (just checked one of my repos, and it isn't there).

That database error and crash seem like you have a second instance of Syncthing running already, a device restart should fix that. Anyway, glad it works now :)

Manually copying .stfolder from another working folder also fixed my syncing issue. I think syncthing has read, but no write access to the external sdcard. Can't this be mentioned in the GUI or the error? Can't the dependency on a writable .stfolder be ditched? I only want to sync from the card, not to it...

The web ui would tell you that .stfolder is missing, and no, we cannot ditch it as that's the only way for us to know that the mount is still there.

Why was this issue closed as invalid? It is very valid. And the workaround is easy to: Make the user “open” the root of the SD card(s) in Android’s regular file browser. That’s what ES File Explorer does and it’s working fine.

Of course you should probably add a warning that adding a folder directly via the web interface is not supported.

And the workaround is easy to

That is not a workaround, but an implementation of the new API available since Android 5. GO does not support this API, so Syncthing cannot use it.
This was closed, because the real issue is already discussed in #29.

I have android 5.1.1 on my Samsung P605 (galaxy note tab 2014) and I cannot understand why Syncthing is not able to write to the external sd card.
If you go to settings->[..]->Apps it HAS the rights to read and write to the external sd.

I also tried to manually create the folder and copy the .stfolder file. No luck.

@lerrigatto See the discussion in #29. Tl;dr things were changed in 4.4, and we currently don't have a way to write to external storage.

Would using root a possibility through SuperSU ? Would only work on rooted devices, but it would add a very useful feature as most, if not all, of my data is on external SD(s).

For root see #453

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dantuck picture dantuck  Â·  10Comments

vladipus picture vladipus  Â·  8Comments

alerque picture alerque  Â·  6Comments

imsodin picture imsodin  Â·  9Comments

reverse-unina picture reverse-unina  Â·  3Comments