Syncthing-android: Blackberry: "Failed to create a Syncthing config. Please check the logs"

Created on 23 Aug 2015  ·  73Comments  ·  Source: syncthing/syncthing-android

I've recently installed Syncthing 0.65 from the F-Droid repo on my BlackBerry Z30. My phone is running v 4.2.2 of Android. I'm presented with the error message in the title each time I open the app.

bug

All 73 comments

Could you paste the log here? Use adb logcat

I have the same problem once I activate the sync as root option. Running syncthing normal works fine, but without access to the external sdcard it's useless to me. I am running cm 12.1. How can I see the log? I cannot open Settings -> Open Log -> Android Log -> Share because the app crashes on startup.

You can use a logcat app on Android, or the adb tool on a pc.

Hi, I'll try and get round to trying this soon. Sorry, for the delay. I don't have any internet at home until the 1st.

I have the same issue. I can not start the application, on Samsung S4

Hello. Here are the logs from my device for this error.
https://paste.ee/p/EzwuE

Can you check if there's anything under the tag SyncthingNativeCode? That should tell us why the Syncthing binary crashed.

It is a bunch of same string, like 10 or 15 times repeat
09-01 19:19:05.592 E/SyncthingNativeCode(6398): Syncthing binary crashed
with error code 1
01.09.2015 19:15 пользователь "Felix Ableitner" [email protected]
написал:

Can you check if there's anything under the tag SyncthingNativeCode? That
should tell us why the Syncthing binary crashed.


Reply to this email directly or view it on GitHub
https://github.com/syncthing/syncthing-android/issues/449#issuecomment-136778014
.

It _should_ show the entire output from syncthing, and also the crash ino. Are you sure there's nothing before that? Alternatively, can you check if there's anything suspicious if you disable filtering?

Here is full log filtered by "Syncthing"
http://paste.ee/p/Z9rBP

I'm seeing the same issue running syncthing 0.6.5 on a Samsung Note3 + CM 12.1-nightly

after setting 'root' usage in syncthing, & granting root access == Allow @OS, on restart it fails with the reported "Failed to create a Syncthing config. Please check the logs"

Could you paste the log here?

logcat | grep -i syncthing

    I/Timeline( 1515): Timeline: Activity_launch_request id:com.nutomic.syncthingandroid time:1147548
    I/ActivityManager(  662): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=com.nutomic.syncthingandroid cmp=com.nutomic.syncthingandroid/.activities.MainActivity bnds=[364,75][540,354] (has extras)} from uid 10080 on display 0
    V/WindowManager(  662): addAppToken: AppWindowToken{164f7514 token=Token{2dbe3367 ActivityRecord{9207b26 u0 com.nutomic.syncthingandroid/.activities.MainActivity t1723}}} to stack=1 task=1723 at 0
    V/WindowManager(  662): Adding window Window{a54285f u0 Starting com.nutomic.syncthingandroid} at 5 of 10 (after Window{53edbaa u0 com.android.settings/com.android.settings.applications.InstalledAppDetails})
    I/ActivityManager(  662): Start proc 27971:com.nutomic.syncthingandroid/u0a507 for activity com.nutomic.syncthingandroid/.activities.MainActivity
    V/WindowManager(  662): Adding window Window{315cd7b0 u0 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity} at 5 of 11 (before Window{a54285f u0 Starting com.nutomic.syncthingandroid})
    W/chmod   (27998): type=1400 audit(0.0:359): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28008): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28008): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28020): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28020): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    V/WindowManager(  662): Adding window Window{6dba96b u0 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity} at 6 of 12 (before Window{a54285f u0 Starting com.nutomic.syncthingandroid})
    I/ActivityManager(  662): Displayed com.nutomic.syncthingandroid/.activities.MainActivity: +574ms
    I/Timeline(  662): Timeline: Activity_windows_visible id: ActivityRecord{9207b26 u0 com.nutomic.syncthingandroid/.activities.MainActivity t1723} time:1148258
    D/su      (28040): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28040): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28049): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28049): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:21:33 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:21:33 INFO: Device ID: ###...###
    D/su      (28020): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/chmod   (28066): type=1400 audit(0.0:360): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28076): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28076): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28087): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28087): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    D/su      (28103): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28103): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28112): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28112): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:21:37 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:21:37 INFO: Device ID: ###...###
    D/su      (28087): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/chmod   (28137): type=1400 audit(0.0:361): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28145): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28145): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28156): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28156): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    D/su      (28169): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28169): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28178): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28178): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:21:40 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:21:40 INFO: Device ID: ###...###
    D/su      (28156): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/chmod   (28191): type=1400 audit(0.0:362): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28199): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28199): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28208): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28208): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    D/su      (28223): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28223): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28232): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28232): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:21:43 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:21:43 INFO: Device ID: ###...###
    D/su      (28208): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/chmod   (28243): type=1400 audit(0.0:363): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28251): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28251): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28261): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28261): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    D/su      (28275): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28275): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28284): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28284): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:21:47 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:21:47 INFO: Device ID: ###...###
    D/su      (28261): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/chmod   (28290): type=1400 audit(0.0:364): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28298): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28298): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28309): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28309): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    D/su      (28322): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28322): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28331): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28331): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:21:50 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:21:50 INFO: Device ID: ###...###
    D/su      (28309): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/chmod   (28336): type=1400 audit(0.0:365): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28344): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28344): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28354): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28354): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    D/su      (28368): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28368): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28378): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28378): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:21:54 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:21:54 INFO: Device ID: ###...###
    D/su      (28354): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/chmod   (28480): type=1400 audit(0.0:366): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28491): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28491): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28502): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28502): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    D/su      (28530): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28530): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28540): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28540): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:21:58 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:21:58 INFO: Device ID: ###...###
    D/su      (28502): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/chmod   (28563): type=1400 audit(0.0:367): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28571): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28571): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28582): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28582): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    D/su      (28595): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28595): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28608): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28608): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:22:02 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:22:02 INFO: Device ID: ###...###
    D/su      (28582): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/chmod   (28633): type=1400 audit(0.0:368): avc: denied { setattr } for name="libsyncthing.so" dev="mmcblk0p25" ino=1574549 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file
    D/su      (28645): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28645): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28656): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28656): 10507 /system/bin/app_process32 executing 0 /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files using binary /system/bin/sh : sh -c /data/data/com.nutomic.syncthingandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncthingandroid/files
    D/su      (28678): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28678): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    D/su      (28687): Checking whether app [uid:10507, pkgName: com.nutomic.syncthingandroid] is allowed to be root
    D/su      (28687): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    I/SyncthingRunnableIoNice(27971): ionice performed on libsyncthing.so
    I/SyncthingNativeCode(27971): 18:22:05 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(27971): 18:22:05 INFO: Device ID: ###...###
    D/su      (28656): Finishing su operation for app [uid:10507, pkgName: com.nutomic.syncthingandroid]
    W/PackageManager(  863): Failure retrieving resources for com.nutomic.syncthingandroid: Resource ID #0x0

@mizhgan There's a permission denied error when the app tries to create a new config, but I'm not sure about the reason. Could it be that you enabled root and then disabled it again? That would mean the config would be owned by root and could not be accessed without root afterwards. Steps to reproduce would also be helpful.

@pgnd I don't see an error in there, just that it tries to generate a new config all the time.

To both of you, could you make a log with adb logcat -s SyncthingRunnable:v SyncthingNativeCode:v ConfigXml:v? grep isn't so good because errors can go over multiple lines, and some lines don't contain syncthing (sorry for not telling you earlier).

@Nutomic

adb logcat -s SyncthingRunnable:v SyncthingNativeCode:v ConfigXml:v
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:08 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:08 INFO: Device ID: 4NJ...
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:12 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:12 INFO: Device ID: 4NJ...
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:16 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:16 INFO: Device ID: 4NJ...
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:20 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:20 INFO: Device ID: 4NJ...
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:24 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:24 INFO: Device ID: 4NJ...
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:28 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:28 INFO: Device ID: 4NJ...
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:32 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:32 INFO: Device ID: 4NJ...
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:36 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:36 INFO: Device ID: 4NJ...
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:40 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:40 INFO: Device ID: 4NJ...
    W/ConfigXml(14935): Failed to open config, moving to config.xml.invalid and creating blank config
    I/SyncthingNativeCode(14935): 21:56:44 WARNING: Key exists; will not overwrite.
    I/SyncthingNativeCode(14935): 21:56:44 INFO: Device ID: 4NJ...

Then on my phone, I get a dialog:

"Failed to create a Syncthing config. Please check the logs"

@pgnd Can you check the permissions on /data/data/com.nutomic.syncthingandroid/files/config.xml? And does syncthing get root permissions? (eg is there a popup or logging in your root app).

@Nutomic

check the permissions on /data/data/com.nutomic.syncthingandroid/files/config.xml

ls -al /data/data/com.nutomic.syncthingandroid/files/config.xml
    -rw------- root     root         2344 2015-09-06 15:09 config.xml

And does syncthing get root permissions? (eg is there a popup or logging in your root app).

There is neither popup, nor login.

Checking 'Privacy' settings for Syncthing, it _has_ RootPerms. I.e., Root access == "allowed".

Hm, I would guess root is disabled in the app settings for some reason (so the app doesn't use root). But I have no idea how that would happen. Have you tried if a reinstall fixes it?

@Zillode Any idea on this?

@Nutomic

Have you tried if a reinstall fixes it?
Yes, and unfortunately -- no, it doesn't.

Maybe the system can't delete files owned by root. You can try to delete the /data/data/com.nutomic.syncthingandroid directory manually after uninstalling.

My 'system' is CM 12.1. I'm rooted, and other apps with 'root perms' granted (as does Syncthing) -- have no such issue.

Manual delete after uninstall, then reinstall doesn't change a thing unfortunately.

same problem here, deleted cache and data of the app, uninstalled, re-installed, starts just fine I add a new device it asks for restart and never manages only saying: Failed to create a Syncthing config. Please check the logs

This is on a Sony Xperia Z3 compact with Android 5.0.2 (rooted) and syncthing is told to run with the root option. This worked just fine until a few months ago when I had problems with syncthing on my NAS so now that I fixed that part I was trying to get it back to working but no luck.

Ah, I think I got it. The problem is that we open the config from Java to read the api key and web gui url. But Java doesn't have root, so this fails, and it tries this all the time.

You should be able to work around this by doing chmod 666 on the config file.

Oh so this is what I'm seeing here: https://github.com/syncthing/syncthing-android/issues/453#issuecomment-136799427 also

@licaon-kter Nope, that's a seperate issue (but similar).

I meant I was reporting the endless root granting in that comment that I linked, not in the issue per se.

chmod 666 didn't work for me, after a few restarts of syncthing the config file got renamed to config.xml.invalid so I wiped it and the data of the app, restarted started from scratch but as soon as I select to use root, I'm back with the same problem so I wiped again and decided to stop using the whole root option until it's fixed.

This issue started as soon as I moved Syncthing to the SD card: before that it was working fine.

Interestingly, if I do the following...

touch /data/data/com.nutomic.syncthingandroid/files/config.xml \
&& chmod 666 /data/data/com.nutomic.syncthingandroid/files/config.xml

... and then start Syncthing (resulting in the error message), config.xml is deleted.

It has been reported (in #87) that Syncthing doesn't run properly on sd card. Does moving back to system storage help?

Yes, that fixes the problem for me, although it would be nice to be able to
use it from the SD card.

On Fri, 11 Sep 2015 15:51 Felix Ableitner [email protected] wrote:

It has been reported (in #87
https://github.com/syncthing/syncthing-android/issues/87) that
Syncthing doesn't run properly on sd card. Does moving back to system
storage help?


Reply to this email directly or view it on GitHub
https://github.com/syncthing/syncthing-android/issues/449#issuecomment-139566025
.

chmod 666 didn't work for me either ((

same issue on my samsung galaxy nexus with CM 12.1.

Isn't the issue just that, with root enabled, syncthing creates config.xml as the root user and then some other piece of the code tries to access it _without_ root on startup and fails? That appears to be the behavior, here...

Been playing around with this issue a little bit, and seem to have a pretty stable fix. This allows SD card syncing, without config failed error.

Basically, run Syncthing once, go to settings and enable root, make sure to "allow" and "remember" when the prompt asks. (You may have already done this if you're already running Syncthing).

Now, force stop Syncthing, and clear all data. Start it up again.

Then configure it like you want, just DO NOT enable "Sync as root". Don't do it. Whatever you do.

Add your device(s) and folders, including SD card folders.

Here's the interesting bit... You can add an SD card folder at this point as ususal, except now it WILL be able to read and sync the files - even though you aren't specifically "syncing as root".

My theory is that the Syncthing binary is asking for SD card access (which it technically has, as we gave it root) but without running the GUI in root and messing up the config file permissions.

-rw------- u0_a65   u0_a65       2547 2015-10-05 11:49 config.xml

@bennnn That doesn't seem to make sense. If the root setting is disabled, the app won't use root at all (even if it has permission to).

As long as we're talking about things making sense or not, is it possible
that clearing the app data doesn't have the same effect when root was
enabled before (i.e., it can't clear all the data due to perms)?
On Oct 5, 2015 3:06 PM, "Felix Ableitner" [email protected] wrote:

@bennnn https://github.com/bennnn That doesn't seem to make sense. If
the root setting is disabled, the app won't use root at all (even if it has
permission to).


Reply to this email directly or view it on GitHub
https://github.com/syncthing/syncthing-android/issues/449#issuecomment-145682866
.

Hm it might be possible that Android can't delete the config, so it would stay and still be owned by root. But I'm pretty sure syncthing would not run as root (you can check with top | grep syncthing on the device).

Please disregard my 2 earlier posts (i have removed them), because I have found the real partial workaround.

I have researched bennnn's workaround and I now can understand what is happening.

"Sync as Root" functionality, which is needed to sync external SD with Android 5, is broken.
However, a partial workaround exists. It is possible to sync from external SD card in read-only mode.

The only thing you need to do is to create an empty .stfolder file inside the folder you are going to add to Syncthing.

This is what was happening when "Sync as Root" was enabled, but then the app always crashed.

So for now, if you are ok with Read-Only mode, just create .stfolder files manually, one for each separate entry in Syncthing. Do not use "Sync as Root", and you do not even need to give Root permissioins to the app AT ALL, you may even deny the permissions when asked (on Settings screen) - it will work okay.

Hope this helps.

So sync as root doesn't work at all on Android 5? If so, we should disable it for those Android versions, assuming we can't fix it in the app.

I'm also getting this on Marshmallow on a rooted Nexus5 if it's any help

So I'm assuming this is a bug that is being worked on?

Just thought I'd add my experiences to.
Running CyanogenMod 12.1 (Android 5.1.1) on latest nightly (upgrade almost every week), Galaxy S5.

Have same problems as above. After enabling "Sync as Root" the config file changes owner and group to root but the app doesn't seem to run as root although I clearly get a request to allow root for Syncthing. On restarting the app it can't read the config file and then creates a new, empty config file. The old file is renamed config.xml.invalid. Even if I go back to the old config and run chmod 777 on it doesn't seem to work. It seems that all kind of problems arise with root enabled.

I can't get any logs either. I just get "retrieving logs..." and nothing happens, both with Syncthing logs and Android logs.

When running as root I still can't pick any folders that I should be able to as root. e.g. /data appear as empty.

My ugly workaround is to run the app without root and simply change the permissions for the folders that I want to access. Basically set /storage/sdcard1/DCIM (photos on external SD card) to 777.

Please give this bug top priority as it is extremely vital for a sync app. I believe that there are a lot of people wanting to sync folders on the external SD card or, as me, even parts of the /data/data folder, e.g. my FireFox profile.

Thanks for one of the best apps out there! Keep up the great work!

I would't get your hopes up, as the last comment is from a month ago. Best way to get stuff fixed, especially in opensource, is to fix it yourself.

Don't forget, it's collaborative effort, but that doesn't mean that people will work on the bug others care the most. They will probably work on whatever they like, as all in all it's a way to spend their free time.

Thanks for the fast answer. I really hope your wrong but I hear what you're saying.

Unfortunately, I don't have the knowledge to help out with the development but maybe someone else has and is willing to spend the time.

So I'll just have to keep my hopes up :)

I faced the same issue. My scenario is: syncthing was installed and worked just fine, then I installed update and deside to setup all folders from scratch. What I did is gone to settings > applications > syncthing > clear data (this is how I expect every app can be reset to default). Then I run syncthing and it shows a progress message about generating keys and then I got "Failed to create a Syncthing config. Please check the logs".

I tried to reinstall Syncthing again - didn't help: same message. The problem is my device is not rooted and I don't want to root it, so I can't access /data/data/com.nutomic.syncthingandroid

Is there any solution for me, or does it mean I broke syncthing on my device forever?

Enable developer mode, connect to the phone via PC via ADB, and get the logs.

Here is my log

adb logcat -s SyncthingRunnable:v SyncthingNativeCode:v ConfigXml:v
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
I/ConfigXml( 7898): App started for the first time. Generating keys and config.
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/ConfigXml( 7898): Failed to open config, moving to config.xml.invalid and creating blank config
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
E/SyncthingNativeCode( 7898): Syncthing binary crashed with error code 11
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]
W/SyncthingNativeCode( 7898): sh: <stdin>[1]: grep: not found
W/SyncthingNativeCode( 7898): usage: ionice <pid> [none|rt|be|idle] [prio]

I'm also have the same symptoms as Diomas having followed the same process of updating, then Syncthing failing with the message "Failed to create a Syncthing config. Please check the logs". And then trying to reinstall with no result. My device HTC one v also not rooted.

I don't know what exit code 11 means, but I guess the binary isn't compatible with your device. If someone can figure out how to build Syncthing for Blackberry, we could probably make a seperate version for that.

@manupoletti This issue is about Blackberry, not Android. Please open a new one (with logs).

@sentriz This issue is about Blackberry. You probably want #29.

@Nutomic Ah sorry, I thought the Z30 runs Android 5. I'll check #29 out.

This exact issue also happens in exact the same way on android 6.
Doesn't matter that Blackberry happens to be the manufacturer of the Android device the OP owns.

This bug continues in the latest version of Syncthing/Android.
Since ROOT access seems to be the only way to get syncthing to work with SD cards (REAL sd cards, not the fake internal memory), that is a huge issue.

I'm now also getting this error on a CM 13 / Android 6 (on ASUS Zenfone 2 though rather than Blackberry). After much trial and error, Syncthing started syncing in the background, wi-fi only, with root, to my micro sd card. I went to the Web UI to and saw everything was going ok, except it was randomly syncing, so I switched to sequential sync based on filename, it said I have to reboot and I pressed OK. It was taking a long time to reboot so I went back and pressed reboot again with the native UI. That didn't work, so I rebooted the OS. Then I found out syncting wasn't working / the app no longer opens. Giving me "Failed to create a syncthing config. Please check the logs.". Here is the log output as a gist (after running adb logcat -d | grep -i 'syncthing') - just the last few few consecutive seconds worth.

@orlin do use https://gist.github.com to paste large texts.

@licaon-kter I edited the comment, which now links to the log text as a gist, thanks for pointing that out.

Your log talks about untrusted application, which might be the cause.

I uninstalled / installed syncthing several times since my last comment, but I still end up with the same message about the "config". After a new install it runs ok, until I try to add a folder to sync. All I do is pair it with my computer (add device), with some folders shared, and access given. Then I check 3 options: run in background, only over wi-fi, and use root. I'm guessing that root is needed because of "Warning your android version does not allow syncing to external devices". At this point I reboot. What that is left is to add a folder, which I do, and then I end up with "Syncthing isn't responding." to which I can only say "OK" (did "Wait" several times and that doesn't help). Next I can no longer open syncthing.

Ok, I found a way to trick syncthing, and now it works. I basically left enabling root as the last step. I do everything including the adding of a folder before checking root on. This includes:

  1. creating a folder manually by other means - syncthing says "Failed to create folder." probably because that's on my sd card
  2. to fix the error "Open: .stfolder permission denied" - I create that manually (an empty file) by other means in the directory I created manually in step 1
  3. go in the web ui and set the synchronization options according to preference (I prefer to sync alphabetically by file name) - this is what broke it last time (it could be that changing any setting breaks the config), not going to try that again... Shouldn't sync preferences default to those of the master folder stuff is being synced from - maybe a feature request?
  4. at this point it's a "Syncing (0%)" and not doing anything, probably because of "Warning your android version does not allow syncing to external devices." - enabling root starts the syncing.

I won't need to make any changes any time soon, but when I do - I guess I would need to turn root off, make my changes / reboot just in case, and turn root back on afterwards. Perhaps this is what syncthing needs to do as well? I haven't looked through the other syncthing issues to know if these are something new...

Hi, I just ran into a similar issue: on my bq phone, the camera stores files in a special folder and for some reason, syncthing couldn't create the .stfolder there:

05-29 14:27:14.022 16809 16972 V GetTask : API call result: {"error":"open /storage/67E4-13E0/Android/data/com.android.camerabq/.stfolder: permission denied","globalBytes":0,"globalDeleted":0,"globalFiles":0,"ignorePatterns":false,"inSyncBytes":0,"inSyncFiles":0,"invalid":"","localBytes":0,"localDeleted":0,"localFiles":0,"needBytes":0,"needFiles":0,"state":"error","stateChanged":"2016-05-29T12:26:07.649271952Z","version":0}

I created the directory manually from adb shell (I didn't even need root) and the problem was fixed. Is there something special about this Android/data folder that prevents the app from creating the directory? I can open another issue if necessary.

@sbraz The folders in Android/data/ are only writable by the respective app, and apps with access to the storage device. Because of #29, we can't write to external storage devices.

@Nutomic Thanks for the feedback, the bug is a bit long, do you plan on adding that permission to the app?

The problem is that the required API isn't supported by Go yet. Use internal storage for now if you want read/write access.

Same error here ... but for some version now (~ at least 1y)!
After some runs, syncthing crashes and says to reinstall - cause of broken config.

You are able to delete cache & data or to reinstall & to import the settings, but helps just for avarage 5 times to run the application - than you have to redo all again.

I recognized also that if I give root access to syncthing it is more likely to crash, but if i do not it is not able to read (android 6.0.1 / Ressurection Remix 5.7.1) SGS4.

I think this got fixed in recent releases, 0.10.8+ can anyone please report if the issue still persists?

Why do you believe that this got fixed?

At least we made the config save process and starting syncthing process more stable from my point of view. So, wanna try?

I bet my socks your fix had no effect on this.

What about fixes from 0.10.2, 0.10.3, 0.10.4? This issue is between 2y and 7m old!

I bet my socks it's still broken, the brokenness is in the OS not in the application.

So we cant fix it or is there a hint which has to be done? Unfortunately I dont have this phone/os combination.

Well, someone with the phone would have to roll up their sleeves and go debugging, I don't know the cause exactly but I think it was some blackberry sandbox thingy.

I have not been confronted with it since January 2018.

@coolVariable

I recognized also that if I give root access to syncthing it is more likely to crash, but if i do not it is not able to read (android 6.0.1 / Ressurection Remix 5.7.1) SGS4.
This got fixed since 0.10.6 because a root bug was addressed.

@Translator5
So, you didn't try if an update helps or the issue go resolved for you and you can use synthing now?

Anyway: This ticket is 3 years old, and blackberry really did not "evolve" their android sandbox that modern apps can be executed. If it is really like this, it's a poor thing in my opinion.

I update all my apps every week - so I think it have been fixed by any update :)

Thanks for reporting back.

how to debug that? I have "syncthing-fork" too, it can install,but fail to "configure" on first step - "see logcat", but in logcat I see nothing...

Was this page helpful?
0 / 5 - 0 ratings