notes-android icon indicating copy to clipboard operation
notes-android copied to clipboard

BadParcelableException NoCurrentAccountSelectedException during adding a new account without Notes installed on server

Open merito opened this issue 2 years ago • 4 comments

Please use GitHub reactions 👍 to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug

App crashes when I try to add the second Nextcloud account among existing one. The new one is located on server without Notes app installed. As a result I can't go back to my first account. There is an error loop.

To Reproduce Steps to reproduce the behavior:

  1. Tap on user avatar
  2. Select Add new account
  3. Select the account added before in Nextcloud app, different than the current one
  4. App shows an empty avatar in the background, there is an error attached below. After hitting Close button I can see an "empty" app.

Expected behavior

See and error and do not dead loop.

Screenshots

Smartphone (please complete the following information):

  • Nextcloud Notes-Version (android app): 4.1.0
  • F-Droid or Play Store: F-Droid
  • Android-Version: 13, GrapheneOS up to date
  • Device: Google Pixel 6 (oriole)

Server

  • Nextcloud version: 27.1.4
  • Nextcloud Notes version (server app): not installed

Stacktrace

App Version: 4.1.0
App Version Code: 40010090
App Flavor: fdroid

Files App Version Code: 30260090 (PROD)

---

OS Version: 5.10.200-android13-4-gb559d5ab185a(2023120800)
OS API Level: 34
Device: oriole
Manufacturer: Google
Model (and Product): Pixel 6 (oriole)

---

android.os.BadParcelableException: Parcelable encountered IOException writing serializable object (name = com.nextcloud.android.sso.exceptions.NoCurrentAccountSelectedException)
	at android.os.Parcel.writeSerializable(Parcel.java:2799)
	at android.os.Parcel.writeValue(Parcel.java:2565)
	at android.os.Parcel.writeValue(Parcel.java:2364)
	at android.os.Parcel.writeList(Parcel.java:1417)
	at android.os.Parcel.writeValue(Parcel.java:2508)
	at android.os.Parcel.writeValue(Parcel.java:2364)
	at android.os.Parcel.writeArrayMapInternal(Parcel.java:1300)
	at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1845)
	at android.os.Bundle.writeToParcel(Bundle.java:1389)
	at android.os.Parcel.writeBundle(Parcel.java:1369)
	at android.os.Parcel.writeValue(Parcel.java:2481)
	at android.os.Parcel.writeValue(Parcel.java:2371)
	at android.os.Parcel.writeArrayMapInternal(Parcel.java:1300)
	at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1845)
	at android.os.Bundle.writeToParcel(Bundle.java:1389)
	at android.os.Parcel.writeBundle(Parcel.java:1369)
	at android.os.Parcel.writeValue(Parcel.java:2481)
	at android.os.Parcel.writeValue(Parcel.java:2371)
	at android.os.Parcel.writeArrayMapInternal(Parcel.java:1300)
	at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1845)
	at android.os.Bundle.writeToParcel(Bundle.java:1389)
	at android.os.Parcel.writeBundle(Parcel.java:1369)
	at android.os.Parcel.writeValue(Parcel.java:2481)
	at android.os.Parcel.writeValue(Parcel.java:2371)
	at android.os.Parcel.writeArrayMapInternal(Parcel.java:1300)
	at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1845)
	at android.os.Bundle.writeToParcel(Bundle.java:1389)
	at android.os.Parcel.writeBundle(Parcel.java:1369)
	at android.os.Parcel.writeValue(Parcel.java:2481)
	at android.os.Parcel.writeValue(Parcel.java:2371)
	at android.os.BaseBundle.dumpStats(BaseBundle.java:1919)
	at android.os.BaseBundle.dumpStats(BaseBundle.java:1956)
	at android.app.servertransaction.PendingTransactionActions$StopInfo.collectBundleStates(PendingTransactionActions.java:123)
	at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:139)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8216)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:49)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: java.io.NotSerializableException: android.content.Intent
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1240)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1620)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1581)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1490)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1234)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
	at android.os.Parcel.writeSerializable(Parcel.java:2794)
	... 43 more

merito avatar Dec 10 '23 21:12 merito

This happened to me as well and left the app in an unusable state. I since have activated the Notes plugin on the server, but I'm still getting the error in a loop and can neither access the old or the new account. How can I get out of this state?

rnestler avatar Jan 14 '24 16:01 rnestler

Clear the storage of the Notes Android app as described in our FAQ and then log in again. The link to the FAQ was in the issue template, you commited to read it before opening a new issue :).

stefan-niedermann avatar Jan 14 '24 17:01 stefan-niedermann

Clear the storage of the Notes Android app as described in our FAQ and then log in again.

Well yes that worked, but that should be a last resort, especially when having connected multiple accounts already, shouldn't it? Since this can easily lead to data loss.

The link to the FAQ was in the issue template, you commited to read it before opening a new issue :).

Lucky for me that I didn't open a new issue but commented on an existing one :wink:

rnestler avatar Jan 16 '24 13:01 rnestler

Well yes that worked, but that should be a last resort, especially when having connected multiple accounts already, shouldn't it?

It's a task of 5 minutes, even with many accounts. But we don't have to debate hat it is a bug that should be fixed. I also didn't want to sound rude, my comment was meant as a workaround so you can continue working and it was written on-the-go from my mobile.

Since this can easily lead to data loss.

Seriously, the warnings in the FAQ about losing unsynchronized changes is pretty big. :roll_eyes:

Lucky for me that I didn't open a new issue but commented on an existing one 😉

Lucky you :smile: Maintaining open source apps in my free time made me assume always the worst about users, sorry for that. Mostly I am right about ignoring FAQs and issue templates though :monocle_face: ☝️

However, I am no longer maintainer of the app for more than a year now, so you maybe want to give it a try yourself? Honestly, I have no clue where to start with this issue, I guess it's not reproducible reliably which will make it nearly impossible to track down the root cause.

stefan-niedermann avatar Jan 16 '24 15:01 stefan-niedermann