Syncthing won't start anymore and config.xml is empty
Syncthing could not start again, I had to delete all the data. The config.xml was empty. It's the first time this happens in 2 years or so that I've been using the app, so I don't expect to be able to reproduce it (unfortunately I was not able to get logs). I'm still wondering if this would have happened if this "renameTo" were atomic:
https://github.com/syncthing/syncthing-android/blob/master/app/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java#L362
Is renameTo atomic on Android?
Version Information
App Version: 1.3.3
Android Version: LineageOS 16
Hi,
Did you use root option for syncthing?
Hi, no I didn't (I did use it in a file browser to check the content of the file obviously).
Yes, it should be atomic but I don't know where you've lost the config... Do you have a settings backup at hand to import, this would help in this case to restore the phone's syncthing identity.
Are there any other part of the code writing to the config file?
Are you sure it's atomic? According to https://stackoverflow.com/a/17715859 this would depend on where the temporary file is created, do you know if it's created under the same mounted directory?
Of course these are just wild guesses, but is there any drawback to replace the move by Files.move(src, dst, StandardCopyOption.ATOMIC_MOVE);, just in case?
I've just reconfigured my phone settings, I don't have that many devices and folders, but thanks for the suggestion!
Could do this... I more suspect Syncthing was running while the app wrote a new config and for an unknown reason both tried to write at the same time.