nextcloud-deck icon indicating copy to clipboard operation
nextcloud-deck copied to clipboard

NC25b6/Deck1.8b1

Open putt1ck opened this issue 2 years ago • 3 comments

Connecting Deck app 1.20.2 (from Play Store) to Deck 1.8 beta 1 on Nextcloud 25 beta 6 works initially and then cannot show any boards returning an error. This happens after you choose the account to connect to. Each time it asks for permissions to access the selected account; pressing allow briefly shows a message about synchronising boards, then fails and returns an error.

Full Crash:
App Version: 1.20.2 App Version Code: 1020002
App Flavor: play
Files App Version Code: 30210290
---
OS Version: 4.14.186(1655398308)
OS API Level: 30
Device: BL8800Pro Manufacturer: Blackview
Model (and Product): BL8800Pro (BL8800Pro_EEA)
---
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String
it.niedermann.nextcloud.deck.model.Account.getUserDisplayName()' on a null object reference at
it.niedermann.nextcloud.deck.ui.accountswitcher.AccountSwitcherDialog.onCreateDialog(AccountSwitcherDialog.java:48)
at androidx.fragment.app.DialogFragment.prepareDialog(Dialogfragment.java:644)
at androidx.fragment.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:558)
at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1654)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:493)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7723)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997) ```

putt1ck avatar Sep 16 '22 16:09 putt1ck

Dear @putt1ck looks like you managed to get an inconsistent state.

Did you already try to clear the storage of the Deck Android app as described in our FAQ and import your account again?

stefan-niedermann avatar Sep 16 '22 16:09 stefan-niedermann

Will give that a go, but this is a new phone and I was adding the account when the error first occurred.

putt1ck avatar Sep 16 '22 16:09 putt1ck

Same outcome after the storage was cleared. Do you want me to try uninstalling it and starting from scratch?

putt1ck avatar Sep 17 '22 04:09 putt1ck

Same here with

  • fdroid flavor
  • App Version Code: 1020002
  • NC-GmbH Instance (So NC25 RC1 meanwhile, Deck version beta2 probably?)

Freshly installed app from fdroid, also tried clearing cache and storage meanwhile. Opening the app allows to select the account, then while Importing board 1 of 1 the app crashes. Error message equals the one above (except some linenumbers on the very last lines).

jotoeri avatar Sep 27 '22 11:09 jotoeri

@jotoeri @putt1ck can one of you please provide a temporary test account on your instances for debugging purposes and send the credentials via mail to [email protected]?

stefan-niedermann avatar Sep 27 '22 11:09 stefan-niedermann

For me - i dont have an own instance to do so. But if i assume right, you could also have a guest-account on the NC-GmbH instance, no? For me it is a Guest-Account there, identified by email-address.

jotoeri avatar Sep 27 '22 11:09 jotoeri

Yup. Have been able to reproduce the issue. Will debug this next week

stefan-niedermann avatar Sep 27 '22 12:09 stefan-niedermann

@desperateCoder this is the actual stacktrace:

App Version: 1.20.2
App Version Code: 1020002
Server App Version: 1.8.0-beta.2
App Flavor: dev

Files App Version Code: 30180190

---

OS Version: 5.10.66-android12-9-00041-gfa9c9074531e-ab7914766(8023802)
OS API Level: 31
Device: emulator64_x86_64_arm64
Manufacturer: Google
Model (and Product): sdk_gphone64_x86_64 (sdk_gphone64_x86_64)

---

it.niedermann.nextcloud.deck.exceptions.TraceableException: Sorry, a wild error appeared!

⚠️ If you want to tell us about the following issue, please make sure to censor sensitive data beforehand! ⚠️

Failed to run traceable code with arguments:
{"id":1620,"title":"Beispielaufgabe 2","description":"","descriptionPrev":null,"stackId":671,"type":"text","lastModified":1624878183,"lastEditor":null,"createdAt":1624878183,"labels":[],"assignedUsers":[],"attachments":[],"attachmentCount":0,"owner":{"primaryKey":"[email protected]","uid":"[email protected]","displayname":"Stefan Niedermann","type":0},"order":0,"archived":false,"duedate":null,"notified":false,"deletedAt":0,"commentsUnread":0,"commentsCount":0,"relatedStack":{"id":671,"title":"In Arbeit","boardId":225,"deletedAt":0,"lastModified":1624878183,"order":1,"ETag":"4f9ab7f4c3121b1e1100577fb1a5eae6"},"relatedBoard":{"id":225,"title":"Persönlich","owner":{"primaryKey":"[email protected]","uid":"[email protected]","displayname":"Stefan Niedermann","type":0},"color":"0087C5","archived":false,"labels":[{"id":987,"title":"Abgeschlossen","color":"31CC7C","boardId":225,"cardId":null,"lastModified":1624878183,"ETag":"4f9ab7f4c3121b1e1100577fb1a5eae6"},{"id":988,"title":"Zu ĂĽberprĂĽfen","color":"317CCC","boardId":225,"cardId":null,"lastModified":1624878183,"ETag":"4f9ab7f4c3121b1e1100577fb1a5eae6"},{"id":989,"title":"Handlung erforderlich","color":"FF7A66","boardId":225,"cardId":null,"lastModified":1624878183,"ETag":"4f9ab7f4c3121b1e1100577fb1a5eae6"},{"id":990,"title":"Später","color":"F1DB50","boardId":225,"cardId":null,"lastModified":1624878183,"ETag":"4f9ab7f4c3121b1e1100577fb1a5eae6"}],"acl":[],"permissions":{"PERMISSION_READ":true,"PERMISSION_EDIT":true,"PERMISSION_MANAGE":true,"PERMISSION_SHARE":true},"users":[{"primaryKey":"[email protected]","uid":"[email protected]","displayname":"Stefan Niedermann","type":0}],"stacks":[],"deletedAt":0,"lastModified":1624878183,"settings":{"notify-due":"assigned","calendar":true},"ETag":"4f9ab7f4c3121b1e1100577fb1a5eae6"},"ETag":"4f9ab7f4c3121b1e1100577fb1a5eae6"}
Cause: Attempt to invoke virtual method 'int com.google.gson.JsonElement.getAsInt()' on a null object reference
	at it.niedermann.nextcloud.deck.api.JsonToEntityParser.parseCard(JsonToEntityParser.java:401)
	at it.niedermann.nextcloud.deck.api.JsonToEntityParser.parseJsonObject(JsonToEntityParser.java:53)
	at it.niedermann.nextcloud.deck.api.NextcloudDeserializer.deserialize(NextcloudDeserializer.java:30)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
	at com.google.gson.Gson.fromJson(Gson.java:1058)
	at com.google.gson.Gson.fromJson(Gson.java:1016)
	at com.nextcloud.android.sso.api.NextcloudAPI.convertStreamToTargetEntity(NextcloudAPI.java:159)
	at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:130)
	at com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda0.subscribe(Unknown Source:6)
	at io.reactivex.internal.operators.observable.ObservableFromPublisher.subscribeActual(ObservableFromPublisher.java:31)
	at io.reactivex.Observable.subscribe(Observable.java:12284)
	at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:32)
	at io.reactivex.Observable.subscribe(Observable.java:12284)
	at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
	at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
	at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	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:920)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.gson.JsonElement.getAsInt()' on a null object reference
	at it.niedermann.nextcloud.deck.api.JsonToEntityParser.lambda$parseCard$10(JsonToEntityParser.java:453)
	at it.niedermann.nextcloud.deck.api.JsonToEntityParser$$ExternalSyntheticLambda7.run(Unknown Source:6)
	at it.niedermann.nextcloud.deck.exceptions.TraceableException.makeTraceableIfFails(TraceableException.java:13)
	... 20 more

stefan-niedermann avatar Oct 02 '22 06:10 stefan-niedermann

There are two issues:

  1. Looks like there is a breaking change once again in the Deck server app (see stacktrace above)
  2. SyncManager#synchronize does call onError two times and onResponse two times. This behavior leads to a race condition resulting in the stacktrace posted by @putt1ck in the original post: The account has been removed due to a error at the first sync but the app thinks everything went fine and tries to display this account (which is null)

stefan-niedermann avatar Oct 02 '22 07:10 stefan-niedermann

Okay, looks like yet another, not announced, breaking API change of the Deck server app. @desperateCoder implemented a workaround, so Deck Android 1.20.3 should be able to handle this situation. Thanks for the report.

stefan-niedermann avatar Oct 02 '22 08:10 stefan-niedermann

Deck version 1.8.0-beta.2

Full Crash:

App Version: 1.20.3
App Version Code: 1020003
App Flavor: fdroid

Files App Version Code: 30210290

---

OS Version: 5.10.107-android13-4-00004-g6522bf85d262-ab8935228(9071314)
OS API Level: 33
Device: cheetah
Manufacturer: Google
Model (and Product): Pixel 7 Pro (cheetah)

---

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String it.niedermann.nextcloud.deck.model.Account.getUserDisplayName()' on a null object reference
	at it.niedermann.nextcloud.deck.ui.accountswitcher.AccountSwitcherDialog.onCreateDialog(AccountSwitcherDialog.java:48)
	at androidx.fragment.app.DialogFragment.prepareDialog(DialogFragment.java:644)
	at androidx.fragment.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:558)
	at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1654)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:493)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
	at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7898)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Seams to be the same error in 1.20.3?

tacruc avatar Oct 15 '22 13:10 tacruc

🤔 for me it works on 1.20.3/fdroid. Even with cleaning AppData and reauthentication it works. Screenshot_20221015-162905_Nextcloud_Deck

jotoeri avatar Oct 15 '22 14:10 jotoeri

@tacruc there has been another bug in the beta of the Deck server app which should be fixed in the beta 3 / and / or the first RC. If your issue is still present with the next Deck Server issue after clearing the storage of the Deck Android app and reimporting your account, please let us know in a separate new issue.

I can't tell for sure though because the stacktrace you posted was just a symptom rather than the actual cause ... (@desperateCoder needs to fix https://github.com/stefan-niedermann/nextcloud-deck/issues/1348 so we can see the actual cause...)

stefan-niedermann avatar Oct 15 '22 15:10 stefan-niedermann

Also for everyone who was so brave to install Deck Server app beta versions: The latest bug might have corrupted the duedates in your database and I am not sure whether this will actually be fixed by the Nextcloud GmbH...

Also I didn't [...] test all kind of migrations with and without duedate, with past and future, in case there is something related that would need handling.

Source: Pull Request

stefan-niedermann avatar Oct 15 '22 15:10 stefan-niedermann

So, looks like I misinterpreted the PR for the fix and there is a solution for people who installed the beta:

[...] basically the fields were written into the database without the timezone. But from the one test that I did it basically recovers on read so that the state is acceptable. But the users timezone is gone for good, so for a CEST person all events modified lost the 2h offset and all cards have to be modified again to fix the time.

stefan-niedermann avatar Oct 17 '22 07:10 stefan-niedermann