Android-SingleSignOn icon indicating copy to clipboard operation
Android-SingleSignOn copied to clipboard

NextcloudApiNotRespondingException

Open David-Development opened this issue 5 years ago • 16 comments

By now two apps are having issues with the NextcloudApiNotRespondingException Bug.

  • https://github.com/stefan-niedermann/nextcloud-notes/issues/653
  • https://github.com/nextcloud/news-android/issues/769

A few days ago I was experiencing the same issue on my device (I think right after I updated the news app via the play store). Several restarts of the app did not help. Only setting up the account again solved the problem for me. Still not sure if the Nextcloud Files App has something to do with it or if the problem is on the "client" side. @stefan-niedermann Do you have new insights into why this error happens? Or any ideas if the files app is involved in this?

Maybe some old Service Connections are reused which are broken? But that wouldn't make sense in terms of the app restarts I performed. Maybe restarting the phone helps..? That would be interesting to find out.

Confirmed devices

Android Version Device Original issue Disable 🔋-Opt solved
Android 5.1 Nubia N1 https://github.com/stefan-niedermann/nextcloud-notes/issues/710#issuecomment-651054925
Android 6 / 8 Meizu M5s
Android 7 Huawei MediaPad T3 https://github.com/stefan-niedermann/nextcloud-notes/issues/907 ✅ (clear storage after)
Android 10 Pixel 4 XL
Android 10 Xiaomi Mi 8
MiUI 12.5.1 Xiaomi Mi 10 Pro 5G https://github.com/stefan-niedermann/nextcloud-notes/issues/1312 :x:

David-Development avatar Jan 20 '20 07:01 David-Development

@tobiasKaminsky just said, this is reproducable when the files app is updated and SSO should recreate the API instance after a 5s timeout 🤷‍♂

stefan-niedermann avatar Jan 21 '20 10:01 stefan-niedermann

Okay, I tried reproducing the issue. I installed the news app and put it into debugging mode. I updated the nextcloud files app using the following command:

./adb install ~/Downloads/gplay-release-30100090.apk

As I would expect I was able to see the following in the LogCat:

2020-01-21 17:41:06.987 5245-5245/de.luhmer.owncloudnewsreader E/com.nextcloud.android.sso.api.AidlNetworkRequest: Nextcloud Single sign-on: ServiceDisconnected
2020-01-21 17:41:06.987 5245-5245/de.luhmer.owncloudnewsreader D/com.nextcloud.android.sso.api.AidlNetworkRequest: reconnecting lost SingleSignOn service connection
2020-01-21 17:41:06.987 5245-5245/de.luhmer.owncloudnewsreader V/com.nextcloud.android.sso.api.NetworkRequest: Nextcloud Single sign-on connect() called [main] Account-Type: [nextcloud]
2020-01-21 17:41:07.334 5245-5245/de.luhmer.owncloudnewsreader V/com.nextcloud.android.sso.api.AidlNetworkRequest: Nextcloud Single sign-on: onServiceConnected [main]

So the lost connection (due to the reinstall process) is re-established successfully. So at this point I'm not able to reproduce the issue. I'll need to investigate a little further..

David-Development avatar Jan 21 '20 16:01 David-Development

I've tried connecting with both, the "stable" version of NextCloud Files and the dev version, from the F-Droid repository, as well as the Google Play version. None worked properly. Is there any solution for this yet?

teras avatar Feb 13 '20 15:02 teras

@teras Unfortunately not. I'm on my way back from my vacation and hopefully I'll have some time in the next few days to investigate further. I didn't update my nextcloud files app on the phone yet so I am hoping to be able to reproduce the error and grab some logcat output from it. Like I said before manually reinstalling the files app using adb does not help much as everything works as expected during my tests (the api reconnects immediately).

Call for action: If anyone wants to help to investigate this issue, it would be very helpful to grab the logcat output (of both the nextcloud files app as well as the client app; e.g. nextcloud news / nextcloud notes) while updating the nextcloud files app trough the app store.

David-Development avatar Feb 18 '20 00:02 David-Development

Looks like I was able to fix this issue today. Planning on releasing a new version in the next couple days.

Reference: https://github.com/nextcloud/Android-SingleSignOn/pull/163

David-Development avatar Feb 18 '20 18:02 David-Development

Here we go again :(

SSO-Version 0.5.0-rc3

https://github.com/stefan-niedermann/nextcloud-notes/issues/752?notification_referrer_id=MDE4Ok5vdGlmaWNhdGlvblRocmVhZDczMjIzOTg2Mzo0NzQxMTk5

stefan-niedermann avatar Feb 28 '20 05:02 stefan-niedermann

Another one: https://github.com/stefan-niedermann/nextcloud-notes/issues/753#issuecomment-592944692

Though i find the different stack traces interesting. The first one looks like 5 retrys, the second one has only one entry.

stefan-niedermann avatar Feb 29 '20 13:02 stefan-niedermann

Another one with 2 stack traces:

https://github.com/stefan-niedermann/nextcloud-notes/issues/710#issuecomment-593069374

(If i receive another stacktrace i will merge all references to one comment to not flood this thread)

stefan-niedermann avatar Mar 01 '20 08:03 stefan-niedermann

uI am using these two apps : News 0.9.9.36 (https://f-droid.org/fr/packages/de.luhmer.owncloudnewsreader/) and Notes 2.10.3 (https://f-droid.org/fr/packages/it.niedermann.owncloud.notes/) with Nextcloud 18.0.1.3 News is ok Notes is ok one or two synchronisations and after I have issue with "NextcloudApiNotRespondingException"

> App Version: 2.10.3
> App Version Code: 81
> Files App Version Code: 30100190OS Version: 4.9.148(9.1.0.155C432)
> OS API Level: 28
> Device: HWLLD-H
> Model (and Product): LLD-L31 (LLD-L31)com.nextcloud.android.sso.exceptions.NextcloudApiNotRespondingException: L'application Nexcloud Files ne répond pas. Veuillez signaler ce problème.
> at com.nextcloud.android.sso.api.AidlNetworkRequest.waitForApi(AidlNetworkRequest.java:147)
> at com.nextcloud.android.sso.api.AidlNetworkRequest.performAidlNetworkRequestV2(AidlNetworkRequest.java:278)
> at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:165)
> at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:148)
> at it.niedermann.owncloud.notes.persistence.NotesClient.requestServer(NotesClient.java:163)
> at it.niedermann.owncloud.notes.persistence.NotesClient.putNote(NotesClient.java:107)
> at it.niedermann.owncloud.notes.persistence.NotesClient.editNote(NotesClient.java:122)
> at it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.pushLocalChanges(NoteServerSyncHelper.java:347)
> at it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.doInBackground(NoteServerSyncHelper.java:318)
> at it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.doInBackground(NoteServerSyncHelper.java:284)
> at android.os.AsyncTask$2.call(AsyncTask.java:334)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:246)
> at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
> at java.lang.Thread.run(Thread.java:784)
> com.nextcloud.android.sso.exceptions.NextcloudApiNotRespondingException: L'application Nexcloud Files ne répond pas. Veuillez signaler ce problème.
> at com.nextcloud.android.sso.api.AidlNetworkRequest.waitForApi(AidlNetworkRequest.java:147)
> at com.nextcloud.android.sso.api.AidlNetworkRequest.performAidlNetworkRequestV2(AidlNetworkRequest.java:278)
> at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:165)
> at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:148)
> at it.niedermann.owncloud.notes.persistence.NotesClient.requestServer(NotesClient.java:163)
> at it.niedermann.owncloud.notes.persistence.NotesClient.getNotes(NotesClient.java:98)
> at it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.pullRemoteChanges(NoteServerSyncHelper.java:413)
> at it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.doInBackground(NoteServerSyncHelper.java:320)
> at it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.doInBackground(NoteServerSyncHelper.java:284)
> at android.os.AsyncTask$2.call(AsyncTask.java:334)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:246)
> at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
> at java.lang.Thread.run(Thread.java:784)

FredMa01 avatar Mar 11 '20 22:03 FredMa01

I'm seeing this issue as well:

App Version: 2.11.3
App Version Code: 2011003
Files App Version Code: 30100190

---

OS Version: 4.14.150-g05fe60fb845b-ab6126650(6156912)
OS API Level: 29
Device: coral
Model (and Product): Pixel 4 XL (coral)

---

com.nextcloud.android.sso.exceptions.NextcloudApiNotRespondingException: Nextcloud files app api is not responding. Please report this issue.
	at com.nextcloud.android.sso.api.AidlNetworkRequest.waitForApi(AidlNetworkRequest.java:147)
	at com.nextcloud.android.sso.api.AidlNetworkRequest.performAidlNetworkRequestV2(AidlNetworkRequest.java:278)
	at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:165)
	at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:148)
	at it.niedermann.owncloud.notes.persistence.NotesClient.requestServer(NotesClient.java:162)
	at it.niedermann.owncloud.notes.persistence.NotesClient.getNotes(NotesClient.java:98)
	at it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.pullRemoteChanges(NoteServerSyncHelper.java:451)
	at it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.doInBackground(NoteServerSyncHelper.java:358)
	at it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper$SyncTask.doInBackground(NoteServerSyncHelper.java:320)
	at android.os.AsyncTask$3.call(AsyncTask.java:378)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:919)

PinkFreud avatar Mar 28 '20 15:03 PinkFreud

And did you follow the steps we mentioned earlier in this thread @PinkFreud ?

Edit Sorry @PinkFreud i was in the wrong issue - Please read starting here: https://github.com/stefan-niedermann/nextcloud-notes/issues/752#issuecomment-605430344

TL;DR: Clear Storage of both apps, Notes and the main Nextcloud android app.

stefan-niedermann avatar Mar 28 '20 16:03 stefan-niedermann

And did you follow the steps we mentioned earlier in this thread @PinkFreud ?

Edit Sorry @PinkFreud i was in the wrong issue - Please read starting here: stefan-niedermann/nextcloud-notes#752 (comment)

TL;DR: Clear Storage of both apps, Notes and the main Nextcloud android app.

This was almost a month ago (sorry, I seem to have missed your reply, argh!), but I did manage to get it working. I don't recall what I did now, but I may very well have done that.

PinkFreud avatar Apr 25 '20 01:04 PinkFreud

Relevant closed Meizu issue: https://github.com/stefan-niedermann/nextcloud-notes/issues/753

I installed Notes and Deck apps for Android on Meizu M5s, and they both didn't work because of the NextcloudApiNotRespondingException error.

I fixed the issue by disabling Smart Background feature and allowing all Nextcloud related apps to run in the background.

Previously I tried clearing cache, storage and reinstalling apps multiple times without any positive results.

Logs are the same as above, so I won't provide them.

eyenalxai avatar May 01 '20 00:05 eyenalxai

@David-Development Good Day! Count 3 apps now!! Nextcloud-bookmark I wished to integrate SSO with Nextcloud bookmark. the latest code is here. However, this is stopping me from releasing the fix for SSO. This feature is already live however this issue blocking SSO feature.

dasbiswajit avatar Jun 21 '20 10:06 dasbiswajit

For documentation @David-Development another one where disabling battery optimization worked as solution: https://github.com/stefan-niedermann/nextcloud-notes/issues/710#issuecomment-651054925

stefan-niedermann avatar Jun 29 '20 13:06 stefan-niedermann

Just reiterating what I said in stefan-niedermann/nextcloud-notes#1312

For me battery optim or autostart (or basically anything) haven't fixed it.

But scratching app storage did: Notes re-requested the NC account then re-pulled the data and now it works. However I have the suspicion that if I do not use the app for a while (weeks?) it will be stopped by the chinese communist party MIUI 12.5.1 and after that it will not be able to reconnect until another full data clear.

grinapo avatar Aug 04 '21 09:08 grinapo