Stops running after a while (connection refused)

Screen recording of the issue:

Description of the problem:

App is running in the background, and phone is connected to wifi. I look at its persistent notification and it appears to be running, as expected. However, from other devices the phone shows offline. Upon opening the Android app, the UI is missing the expected information - it’s mostly blank, like it’s halfway loaded. Web interface returns “Connection refused”.

Workaround: restart Syncthing. This always works.

It happens quite often, but it’s not simple to reproduce. I figured out that I can keep it from happening by frequently opening the app. It’s more likely to crash if I leave the app running in the background (idle) for a full day or more. Funny, it feels like it slips into a deep sleep state. Maybe it’s a power saving issue?

Technical info:

  • Syncthing version: v1.27.1
  • Android app version: v1.27.1.1 (Play Store)
  • Android version: 12
  • Device: Nokia 5.4 (arm64)

Errata:

The video was recorded on version v1.27.1-rc.1. It updated recently and I have yet to confirm it can be reproduced in the newer version.

Could you try the troubleshooting steps provided by https://dontkillmyapp.com/ for your device?

I do not see Evenwell or DuraSpeed in the system app list. I suppose that means it doesn’t use any of them.

This phone is Android One, by the way; and it cannot be rooted/unlocked.


Trying to find the mentioned tools through adb shell:

DRD_sprout:/ $ pm disable-user com.evenwell.powersaving.g3
java.lang.IllegalArgumentException: Unknown package: com.evenwell.powersaving.g3
DRD_sprout:/ $ pm disable-user com.evenwell.emm
java.lang.IllegalArgumentException: Unknown package: com.evenwell.emm
DRD_sprout:/ $ pm disable-user com.mediatek.duraspeed
java.lang.IllegalArgumentException: Unknown package: com.mediatek.duraspeed

I’m assuming that you’ve done the basics like excluding the app from battery optimisation, etc., which applies to all Android devices and isn’t manufacturer-specific. Also, there’s an option in the app settings to “run in foreground”. You may want to try enabling that and see whether it helps.

In the Syncthing app:

  • “Run as a service”/“Run automatically on startup” is ON.
  • “Honor battery saving” Syncthing option is OFF.

In Android Settings:

  • Apps/Syncthing/Battery has “No Restrictions” selected.

Devices running Android One tend to have more budget-friendly hardware, so perhaps it’s not battery but rather system resource optimization. (I have a Motorola phone running Android One that was released just about a year after the Nokia 5.4.)

Try shutting down some of the other background apps to see if it improves things for Syncthing.

Please try enabling “Experimental → Keep the CPU awake while Syncthing is running”.

I can no longer reproduce. Currently running v1.27.2

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.