Fix Syncthing being stuck on Android
This document is divided into the following sections:
- The fix when you have access to terminal
- The fix on unrooted Android
- The reason why Syncthing is stuck
- References
The fix when you have access to terminal
When you have access to terminal then you can stop syncthing then run the following command:
sudo systemctl stop syncthing # or syncthing@user.service syncthing --reset-database sudo systemctl start syncthing # or syncthing@user.service
The fix on unrooted Android
I am using Syncthing-Fork on my Android (available through F-droid) and the reset wasn’t as easy as I wasn’t able to access the terminal. But syncthing also has web server through which you can access the web UI and its API as well.
You will need to pause all the folders or whichever folder is stuck while syncing. Just click on the folder in Syncthing where you will see a toggle to pause.
You should be able to see the API key in ☰ > Settings > Syncthing Options > Syncthing API key. Make sure that syncthing is running or the Syncthing Options will be hidden.
Then download Termux app from Google Play Store to run the following command
(make sure to update packages first using pkg update && pkg upgrade):
curl -kL -X POST \ -H 'X-API-KEY: <your_api_key>' \ http://localhost:8384/rest/system/reset/
The above command will reset all folders. If you want to reset only a specific folder then the URL will look something like:
http://localhost:8384/rest/system/reset/?folder=abcd1-xyz2q
You can find the ID abcd1-xyz2q by clicking on the folder details in
syncthing.
The reason why Syncthing is stuck
The reason that it happened to me is because I deleted some files at the destination device (where the issue happened). Not sure of the exact reason that caused this. You can take a look at references given below to dive deeper if you are interested.