android icon indicating copy to clipboard operation
android copied to clipboard

`RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()`

Open mrtomatwo opened this issue 2 years ago • 2 comments

⚠️ Before posting ⚠️

  • [X] This is a bug, not a question or an enhancement.
  • [X] I've searched for similar issues and didn't find a duplicate.
  • [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • [X] I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

  1. Create folder parent folder with 1300 nested folders, which in turn can contain up to 60 folders (music collection, ordered by artists/album) totaling 30GB on the server.
  2. Log in to your server on android.
  3. Navigate to this parent folder.
  4. Select sync.
  5. Sync never starts.
  6. Navigate into the folder and select all 1300 folders (select one, then choose select all from menu)
  7. Select sync from menu again.
  8. Nextcloud is unresponsive for more than 2 minutes and eventually crashes.

Tested on a Galaxy S23 running android 14, kernel 5.15.94-android13-8-27763874

Expected behaviour

Nextcloud syncs the whole folder after step 4. Nextcloud does not crash after step 7.

Actual behaviour

No sync starts after step 4. Nextcloud app crashes after step 7.

Android version

14

Device brand and model

Samsung galaxy s23

Stock or custom OS?

Stock

Nextcloud android app version

3.28.0

Nextcloud server version

28.0.1

Using a reverse proxy?

No

Android logs

No response

Server error logs

No warnings or errors

Additional information

Running Nextcloud AIO via docker on a 64 bit Arm system with 8GB ram (Raspberry PI 5)

mrtomatwo avatar Mar 19 '24 22:03 mrtomatwo

Hi @MrTomato - Sorry to hear you're running into difficulties. Any chance you can capture the crash output / logs? It would be really helpful. Here's how (if crash output isn't already appearing):

https://github.com/nextcloud/android?tab=readme-ov-file#logs

Alternatively, installing a Dev build from F-Droid will give you access to logs in the app itself via Settings.

joshtrichards avatar Mar 19 '24 23:03 joshtrichards

Hi @joshtrichards,

it took me a bit, but I finally managed to catch the whole mess in the logs 👍 (btw. nice tooling with the dev-app, very cool 😁)

Here's screenshots:

  1. Nextcloud Dev not responding not responding

  2. The error welcoming me back: error

Cause of error

Exception in thread "main" android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{2a2c2d6 u0 com.nextcloud.android.beta/androidx.work.impl.foreground.SystemForegroundService}
    at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2315)
    at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2286)
    at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2611)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:230)
    at android.os.Looper.loop(Looper.java:319)
    at android.app.ActivityThread.main(ActivityThread.java:8893)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

App information

  • ID: com.nextcloud.android.beta
  • Version: 20240320
  • Build flavor: versionDev

Device information

  • Brand: samsung
  • Device: dm1q
  • Model: SM-S911B
  • Id: UP1A.231005.007
  • Product: dm1qxeea

Firmware

  • SDK: 34
  • Release: 14
  • Incremental: S911BXXS3BXBD

And finally the logs (anonymized) logs_anonymized.txt

Please let me know, if you need anything else :)

Cheerio, Tomato

mrtomatwo avatar Mar 20 '24 09:03 mrtomatwo