Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncthing from F-Droid does not work under Marshmallow (Android 6) #528

Closed
dvaerum opened this issue Dec 30, 2015 · 10 comments
Closed

Syncthing from F-Droid does not work under Marshmallow (Android 6) #528

dvaerum opened this issue Dec 30, 2015 · 10 comments

Comments

@dvaerum
Copy link

dvaerum commented Dec 30, 2015

Syncthing cannot or are not allowed to browse internal storage on Android Marshmallow.
I fixed the problem by re-compiling Syncthing with Android 6.0 (API 23), but I am not sure if this is a problem that should be fixed here or at F-Droid.

Reproduce:
  1. Install and run Syncthing from F-Droid
  2. Press the + icon and add a new folder.
  3. Press "Directory" in "Create Folder"
  4. Now I am showed 4 dirs ("/storage/emulated", "/storage/emulated/0", "/storage/self", "/storage/emulated/0/Android/data/com.nutomic.syncthingandroid/files" and "/storage/self"), but I cannot see or create other folders inside these dirs.

Syncthing version: 0.12.6
Syncthing-Android version: 0.7.5
Android Verison: 6.0.1
Device Model: GT-I9300 (Samsung Galaxy S3)
CyanogenMod version: 13.0-20151228-NIGHTLY-i9300

log and config.zip

@C0R10L4NU2
Copy link

Did you give Syncthing explicit permission to access storage?
Under Apps -> Settings -> App Permissions?

Apart from the random crashes in idle mode, f-droid's syncthing works fine on CM13 on shamu.

@dvaerum
Copy link
Author

dvaerum commented Jan 6, 2016

Yes I did, Syncthing pop-up and asks for it.

@dvaerum
Copy link
Author

dvaerum commented Jan 6, 2016

Okay, If I force Syncthing to stop after granted it access to storage and then run it again, it works.
The program, may need to ask for access to the storage. After the access have been granted.

@XDjackieXD
Copy link

I have a similar problem where the syncthing binary won't start because of some permission error after the marshmallow upgrade (cm12.1 to cm13 on a Nexus5). I made sure CM and Android permissions are both granted and I rebooted several times.

01-11 20:16:47.369   818   837 I ActivityManager: Displayed com.nutomic.syncthingandroid/.activities.MainActivity: +382ms
01-11 20:16:47.374  8083  8107 I SyncthingNativeCode: [6YZYV] 19:16:47 INFO: syncthing v0.12.6 "Beryllium Bedbug" (go1.5beta3-853-g525d4bd android-arm default) jenkins@android.syncthing.net 2015-12-01 10:24:30 UTC
01-11 20:16:47.376  8083  8107 I SyncthingNativeCode: [6YZYV] 19:16:47 INFO: My ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
01-11 20:16:47.721  8083  8107 I SyncthingNativeCode: [6YZYV] 19:16:47 INFO: Single thread hash performance is ~35 MB/s
01-11 20:16:47.735  8083  8107 I SyncthingNativeCode: [6YZYV] 19:16:47 FATAL: Cannot open database: open /data/user/0/com.nutomic.syncthingandroid/files/index-v0.11.0.db/LOCK: permission denied - Is another copy of Syncthing already running?
01-11 20:16:47.739  8083  8102 E SyncthingNativeCode: Syncthing binary crashed with error code 1
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3285): avc: denied { getattr } for path="/proc/1" dev="proc" ino=5765 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:init:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3286): avc: denied { search } for name="1" dev="proc" ino=5765 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:init:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3287): avc: denied { search } for name="1" dev="proc" ino=5765 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:init:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3288): avc: denied { getattr } for path="/proc/2" dev="proc" ino=97428 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3289): avc: denied { search } for name="2" dev="proc" ino=97428 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3290): avc: denied { search } for name="2" dev="proc" ino=97428 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3291): avc: denied { getattr } for path="/proc/3" dev="proc" ino=97429 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3292): avc: denied { search } for name="3" dev="proc" ino=97429 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3293): avc: denied { search } for name="3" dev="proc" ino=97429 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3294): avc: denied { getattr } for path="/proc/6" dev="proc" ino=97432 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3295): avc: denied { search } for name="6" dev="proc" ino=97432 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3296): avc: denied { search } for name="6" dev="proc" ino=97432 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3297): avc: denied { getattr } for path="/proc/7" dev="proc" ino=97433 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3298): avc: denied { search } for name="7" dev="proc" ino=97433 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3299): avc: denied { search } for name="7" dev="proc" ino=97433 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3300): avc: denied { getattr } for path="/proc/8" dev="proc" ino=97434 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3301): avc: denied { search } for name="8" dev="proc" ino=97434 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3302): avc: denied { search } for name="8" dev="proc" ino=97434 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3303): avc: denied { getattr } for path="/proc/13" dev="proc" ino=97435 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3304): avc: denied { search } for name="13" dev="proc" ino=97435 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3305): avc: denied { search } for name="13" dev="proc" ino=97435 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3306): avc: denied { getattr } for path="/proc/14" dev="proc" ino=97436 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3307): avc: denied { search } for name="14" dev="proc" ino=97436 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3308): avc: denied { search } for name="14" dev="proc" ino=97436 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3309): avc: denied { getattr } for path="/proc/15" dev="proc" ino=97437 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3310): avc: denied { search } for name="15" dev="proc" ino=97437 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3311): avc: denied { search } for name="15" dev="proc" ino=97437 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3312): avc: denied { getattr } for path="/proc/17" dev="proc" ino=97438 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3313): avc: denied { search } for name="17" dev="proc" ino=97438 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3314): avc: denied { search } for name="17" dev="proc" ino=97438 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3315): avc: denied { getattr } for path="/proc/18" dev="proc" ino=97439 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3316): avc: denied { search } for name="18" dev="proc" ino=97439 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3317): avc: denied { search } for name="18" dev="proc" ino=97439 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3318): avc: denied { getattr } for path="/proc/19" dev="proc" ino=97440 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.294  8121  8121 W ps      : type=1400 audit(0.0:3319): avc: denied { search } for name="19" dev="proc" ino=97440 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.304  8121  8121 W ps      : type=1400 audit(0.0:3320): avc: denied { search } for name="19" dev="proc" ino=97440 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.304  8121  8121 W ps      : type=1400 audit(0.0:3321): avc: denied { getattr } for path="/proc/20" dev="proc" ino=97441 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.304  8121  8121 W ps      : type=1400 audit(0.0:3322): avc: denied { search } for name="20" dev="proc" ino=97441 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.304  8121  8121 W ps      : type=1400 audit(0.0:3323): avc: denied { search } for name="20" dev="proc" ino=97441 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
01-11 20:16:48.347  8083  8120 W SyncthingNativeCode: ionice: exec be: Permission denied
01-11 20:16:48.350  8083  8109 I SyncthingRunnableIoNice: ionice performed on libsyncthing.so
01-11 20:16:48.350  8083  8109 E SyncthingRunnableIoNice: Failed to set ionice 127

And the syncthing app (version 0.7.5) will constantly display the loading screen...

@Zillode
Copy link
Contributor

Zillode commented Jan 11, 2016

@XDjackieXD if you rebooted several times and it still doesn't work you can rm /data/user/0/com.nutomic.syncthingandroid/files/index-v0.11.0.db/LOCK

@XDjackieXD
Copy link

@Zillode after deleteing the file and restarting syncthing (force closing it using the app settings) I get exactly the same error message and the file doesn't get created.
Could it be that the app/native executeable lost access to the folder for some reason after the Marshmallow upgrade?

@Zillode
Copy link
Contributor

Zillode commented Jan 14, 2016

@XDjackieXD: it's probably a different error if the file doesn't exist?

01-11 20:16:47.735 8083 8107 I SyncthingNativeCode: [6YZYV] 19:16:47 FATAL: Cannot open database: open /data/user/0/com.nutomic.syncthingandroid/files/index-v0.11.0.db/LOCK: permission denied - Is another copy of Syncthing already running?

@Nutomic Nutomic added the bug label Jan 21, 2016
@Nutomic
Copy link
Contributor

Nutomic commented Feb 15, 2016

I just got a new phone with Android 6, and I didn't experience this issue.

Did you guys do anything special, like restore a backup of Syncthing?

@XDjackieXD
Copy link

Oh sorry... I forgot closing the issue...
The solution was to export the settimgs, reinstall the app and import them again.
No I did not do anything special during upgrade. I was just flashing a cm13 nightly over a cm12.1 nightly.

@Nutomic
Copy link
Contributor

Nutomic commented Feb 15, 2016

I see. I think problems are expected if you do a dirty flash to a new major version of Android.

@Nutomic Nutomic closed this as completed Feb 15, 2016
@Nutomic Nutomic added invalid and removed bug labels Feb 15, 2016
@syncthing syncthing locked and limited conversation to collaborators Nov 9, 2018
acolomb pushed a commit to acolomb/syncthing-android that referenced this issue Nov 12, 2023
Folder status UI: Indicate "Local Additions" for a receive only folder.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants