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

[Bug report] App is still randomly closing itself without any notification. Any solution please ? #1266

Open
Elaws opened this issue Feb 3, 2025 · 12 comments

Comments

@Elaws
Copy link

Elaws commented Feb 3, 2025

Description of the issue

Ever since I switched from Syncthing to this Syncthing-fork, I was not able to run it reliably on my device : the app keeps closing itself every so often, and I must insist that it makes the app currently unusable, unless more detailed help, fix or steps are kindly provided.

Every few hours, I just notice that the app has somehow closed itself. I'm still connected to Wi-Fi, and "Energy Saving" mode is not activated. Phone is not low on battery.

I must insist that this is still a problem, and I already tried solutions provided in the following related issues but to no effect :

#1175
#1222
#1243

Thank you very much for seriously taking this issue into consideration.

Version Information :

  • App Version: 1.29.2.0
  • App installed from: F-Droid
  • Android Version: Android 13
  • Device manufacturer: Samsung
  • Device model: S20 FE 5G Snapdragon
@Catfriend1
Copy link
Owner

I am currently not into topics regarding the run condition engine as I am not using it myself and troubleshooting a permanent service in an Android ecosystem where Google's policies don't want that behaviour is cat and mouse fight. My focus lies on the main wrapper function, atm.

Is it crashing, maybe? With sth else than the known problem with the gplay build flavor (service time exceeded)?

Until now, no one found the clue and I'm not taking time to reproduce it. Sorry for that. If someone finds a fix or sth to test, I'd take it into consideration to merge to get a better experience for android 15 users.

@Elaws
Copy link
Author

Elaws commented Feb 4, 2025

Thank you for your reply @Catfriend1. I'm not sure this issue is related to Android 15, for at least the 2 following reasons :

  • I don't have Android 15 but Android 13.
  • I didn't encounter this issue before I made the switch from Syncthing to Syncthing-Fork.

I can't confirm what the root cause is : how could I provide some logs for further investigation ? Should I enable some verbose debug mode to help identifying the root cause ?

Thank you.

@Catfriend1
Copy link
Owner

adb logcat -v should be good to go, filtering for syncthingandroid package.

@Elaws
Copy link
Author

Elaws commented Feb 4, 2025

adb logcat -v should be good to go, filtering for syncthingandroid package.

Thank you. The problem happens every few hours to every few days so it's unfortunately quite unpractical if my device should stay plugged to my computer with logcat.

Would you know a more practical alternative to investigate this issue ?

@Martchus
Copy link

Martchus commented Feb 4, 2025

There are apps that allow you to access and filter logs. There are also apps that allow you to open crash reports. I found both very useful in the past but I'm not sure whether I should make any concrete recommendations here. Note that such apps will usually require to give them initially some permission via adb.

@lewi3069
Copy link

lewi3069 commented Feb 5, 2025

I'm also having a similar issue on my Pixel 7 Pro running android 15. I have a file that my phone creates and it should sync nightly. It seems the app generally runs all day but crashed sometime in the night. I'm assuming at the start or during the sync, because when I start it back up it starts syncing the file again.

@Elaws
Copy link
Author

Elaws commented Feb 5, 2025

There are apps that allow you to access and filter logs. There are also apps that allow you to open crash reports. I found both very useful in the past but I'm not sure whether I should make any concrete recommendations here. Note that such apps will usually require to give them initially some permission via adb.

I don't think it's problematic if you wish to share any recommendation : the sooner we can get some logs, the sooner we may identify the cause and hopefully get a fix !

@Martchus
Copy link

Martchus commented Feb 6, 2025

I used https://play.google.com/store/apps/details?id=com.conena.logcat.reader in the past to read logs. It allows one to filter logs by app. It generally works. The only problem I noticed are timeouts when there are lots of logs after not rebooting the phone for a long time (but simply rebooting the phone once in a while helps to avoid it).

I used https://play.google.com/store/apps/details?id=com.arumcomm.crashlogviewer to access crash logs. It works and there's not much more to say about it.

Both apps require you to give them a special permission which is only possible via an adb shell command.

Note that there are maybe better apps. I found those apps after a brief search when I needed them but didn't do a comparision with alternatives.

@doy
Copy link

doy commented Feb 9, 2025

#1264 already has logs for this issue

@wiomoc
Copy link

wiomoc commented Feb 10, 2025

The reason for this behavior is obligatory - see https://developer.android.com/about/versions/15/behavior-changes-15#datasync-timeout

It isn't feasable anymore to just keep the SyncthingService running 24/7. This includes that the whole run condition monitoring must be abridged and ported to the systems JobScheduler

@wiomoc
Copy link

wiomoc commented Feb 10, 2025

adb logcat -v should be good to go, filtering for syncthingandroid package.

00:35:15E/AndroidRuntime java.lang.RuntimeException: Unable to start service com.nutomic.syncthingandroid.service.SyncthingService@fec2462 with null: android.app.ForegroundServiceStartNotAllowedException: Time limit already exhausted for foreground service type dataSync
00:35:15E/AndroidRuntime 	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5274)
00:35:15E/AndroidRuntime 	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
00:35:15E/AndroidRuntime 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2540)
00:35:15E/AndroidRuntime 	at android.os.Handler.dispatchMessage(Handler.java:107)
00:35:15E/AndroidRuntime 	at android.os.Looper.loopOnce(Looper.java:258)
00:35:15E/AndroidRuntime 	at android.os.Looper.loop(Looper.java:356)
00:35:15E/AndroidRuntime 	at android.app.ActivityThread.main(ActivityThread.java:8825)
00:35:15E/AndroidRuntime 	at java.lang.reflect.Method.invoke(Native Method)
00:35:15E/AndroidRuntime 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
00:35:15E/AndroidRuntime 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:966)
00:35:15E/AndroidRuntime Caused by: android.app.ForegroundServiceStartNotAllowedException: Time limit already exhausted for foreground service type dataSync
00:35:15E/AndroidRuntime 	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
00:35:15E/AndroidRuntime 	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
00:35:15E/AndroidRuntime 	at android.os.Parcel.readParcelableInternal(Parcel.java:5075)
00:35:15E/AndroidRuntime 	at android.os.Parcel.readParcelable(Parcel.java:5057)
00:35:15E/AndroidRuntime 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3237)
00:35:15E/AndroidRuntime 	at android.os.Parcel.createException(Parcel.java:3226)
00:35:15E/AndroidRuntime 	at android.os.Parcel.readException(Parcel.java:3209)
00:35:15E/AndroidRuntime 	at android.os.Parcel.readException(Parcel.java:3151)
00:35:15E/AndroidRuntime 	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7378)
00:35:15E/AndroidRuntime 	at android.app.Service.startForeground(Service.java:863)
00:35:15E/AndroidRuntime 	at com.nutomic.syncthingandroid.util.Util$$ExternalSyntheticApiModelOutline0.m(D8$$SyntheticClass:0)
00:35:15E/AndroidRuntime 	at com.nutomic.syncthingandroid.service.NotificationHandler.updatePersistentNotification(NotificationHandler.java:228)
00:35:15E/AndroidRuntime 	at com.nutomic.syncthingandroid.service.NotificationHandler.updatePersistentNotification(NotificationHandler.java:109)
00:35:15E/AndroidRuntime 	at com.nutomic.syncthingandroid.service.SyncthingService.onStartCommand(SyncthingService.java:306)
00:35:15E/AndroidRuntime 	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5256)
00:35:15E/AndroidRuntime 	... 9 more

@Elaws
Copy link
Author

Elaws commented Feb 10, 2025

The reason for this behavior is obligatory - see https://developer.android.com/about/versions/15/behavior-changes-15#datasync-timeout

It isn't feasable anymore to just keep the SyncthingService running 24/7. This includes that the whole run condition monitoring must be abridged and ported to the systems JobScheduler

I confirm that I have Android 13 and not Android 15 : does that still apply ?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants