stefan-niedermann / nextcloud-deck

📋 Android client for nextcloud deck app
https://play.google.com/store/apps/details?id=it.niedermann.nextcloud.deck.play
GNU General Public License v3.0
502 stars 53 forks source link

App crash while login into account #1117

Open alexminder opened 3 years ago

alexminder commented 3 years ago

Describe the bug When I try to login in to Nextcloud account app crashes at import cards step.

Steps to reproduce the behavior:

  1. Go to the Deck app
  2. Click on login and select Nextcoud account
  3. grant access to Nextcloud account
  4. See error

Expected behavior

No errors. Work with deck cards and sync it with cloud.

Versions

Smartphone (please complete the following information):

Stacktrace

App Version: 1.19.4
App Version Code: 1019004
Server App Version: 1.2.7
App Flavor: fdroid

Files App Version Code: 30170090

---

OS Version: 4.14.212-ga2b622b19d70(2021092612)
OS API Level: 30
Device: sunfish
Manufacturer: Google
Model (and Product): Pixel 4a (sunfish)

---

android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787 SQLITE_CONSTRAINT_FOREIGNKEY)
    at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
    at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938)
    at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
    at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
    at androidx.sqlite.db.framework.FrameworkSQLiteStatement.executeInsert(FrameworkSQLiteStatement.java:51)
    at androidx.room.EntityInsertionAdapter.insertAndReturnId(EntityInsertionAdapter.java:114)
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.StackDao_Impl.insert(StackDao_Impl.java:183)
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.StackDao_Impl.insert(StackDao_Impl.java:33)
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter.createStack(DataBaseAdapter.java:632)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:44)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:20)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:62)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:47)
    at it.niedermann.nextcloud.deck.api.RequestHelper$ResponseConsumer.accept(RequestHelper.java:66)
    at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58)
    at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(ObservableFromPublisher.java:56)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$NextcloudAPI(NextcloudAPI.java:111)
    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:923)
stefan-niedermann commented 3 years ago

Just as a quick-shot until @desperateCoder has time to look into the actual issue: Have you already tried to clear the storage of the app as explained in our FAQ?

alexminder commented 3 years ago

Just as a quick-shot until @desperateCoder has time to look into the actual issue: Have you already tried to clear the storage of the app as explained in our FAQ?

Yes. Clearing storage does not help.

desperateCoder commented 3 years ago

Hi @alexminder, thanks for your report!

Honestly, I have no idea how this could happen, this part isn't critical at all and should run just fine, never had something like that before.

But anyways, i have built a special debug version of our app, you can install it along with your current app from fdroid. But this time, as it crashes, it will provide a bunch of details helping me to understand what is going on with your sync.

Please take this APK, try to sync and send us the new crash report as you did above.

alexminder commented 3 years ago
App Version: 1.19.4
App Version Code: 1019004
Server App Version: 1.4.5
App Flavor: dev

Files App Version Code: 30170090

---

OS Version: 4.14.212-ga2b622b19d70(2021100103)
OS API Level: 30
Device: sunfish
Manufacturer: Google
Model (and Product): Pixel 4a (sunfish)

---

java.lang.RuntimeException: Unable to create Stack FullStack{stack=Stack{title='Надо сделать', boardId=3, deletedAt=1970-01-01T00:00:00Z, order=1, localId=null, accountId=1, id=3, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Stack@bac40646, cards=[Card{title='Д.з. Ново..........', description='', stackId=3, type='text', createdAt=2018-12-23T07:19:55Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=0, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=4, status=1, lastModified=2019-05-28T08:14:33Z, lastModifiedLocal=null}, Card{title='Compex Performance EMS', description='', stackId=3, type='plain', createdAt=2020-09-14T03:10:07Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=999, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=49, status=1, lastModified=2020-09-14T03:10:07Z, lastModifiedLocal=null}, Card{title='Functional Movements workout', description='', stackId=3, type='plain', createdAt=2020-09-14T03:10:29Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=999, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=50, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null}]} on Board FullBoard{board=Board{title='Личное', ownerId=1, color=-16777216, archived=false, shared=0, deletedAt=1970-01-01T00:00:00Z, permissionRead=true, permissionEdit=true, permissionManage=true, permissionShare=true, localId=3, accountId=1, id=2, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Board@2caae7cf, labels=[], owner=User{primaryKey='alex', uid='alex', displayname='Alexander Miroshnichenko', localId=1, accountId=1, id=null, status=1, lastModified=null, lastModifiedLocal=null} it.niedermann.nextcloud.deck.model.User@1f6fec95, participants=[], stacks=[]}
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:47)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:20)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:62)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:47)
    at it.niedermann.nextcloud.deck.api.RequestHelper$ResponseConsumer.accept(RequestHelper.java:66)
    at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58)
    at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(ObservableFromPublisher.java:56)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$NextcloudAPI(NextcloudAPI.java:111)
    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:923)
Caused by: android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787 SQLITE_CONSTRAINT_FOREIGNKEY)
    at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
    at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938)
    at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
    at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
    at androidx.sqlite.db.framework.FrameworkSQLiteStatement.executeInsert(FrameworkSQLiteStatement.java:51)
    at androidx.room.EntityInsertionAdapter.insertAndReturnId(EntityInsertionAdapter.java:114)
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.StackDao_Impl.insert(StackDao_Impl.java:183)
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.StackDao_Impl.insert(StackDao_Impl.java:33)
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter.createStack(DataBaseAdapter.java:632)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:45)
    ... 21 more
desperateCoder commented 3 years ago

@alexminder thanks so far, I'll have a look! The data seems ok though... Can't tell what's wrong for now., But I'll investigate that. I'll keep you updated, thanks!

desperateCoder commented 3 years ago

Ok, here's another one to test, this time I explicitly check, if the account and the board (the two constraints on stacks) are present: Download (≧︿≦)

Please make sure to uninstall the current DEV app before installing this one. Most probably this one will crash as well, but you know the procedure: copy the crash report and post it here please.

To be honest, this one triggers me. This shouldn't be possible to happen. I have two bets on this:

It will:

In both cases further investigation will be required (sorry for that in advance!), but I refuse to give up on this. Thanks for your help!

stefan-niedermann commented 3 years ago

ping @alexminder did you already have some time to check the latest debug build provided by @desperateCoder?

alexminder commented 3 years ago
App Version: 1.19.4
App Version Code: 1019004
Server App Version: 1.4.5
App Flavor: dev

Files App Version Code: 30170090

---

OS Version: 4.14.234-ga05a5d05bc29(2021100606)
OS API Level: 30
Device: sunfish
Manufacturer: Google
Model (and Product): Pixel 4a (sunfish)

---

java.lang.RuntimeException: (WTF?!) Unable to create Stack FullStack{stack=Stack{title='Надо сделать', boardId=3, deletedAt=1970-01-01T00:00:00Z, order=1, localId=null, accountId=1, id=3, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Stack@bac40646, cards=[Card{title='Д.з. Новоселова с72/629', description='', stackId=3, type='text', createdAt=2018-12-23T07:19:55Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=0, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=4, status=1, lastModified=2019-05-28T08:14:33Z, lastModifiedLocal=null}, Card{title='Compex Performance EMS', description='', stackId=3, type='plain', createdAt=2020-09-14T03:10:07Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=999, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=49, status=1, lastModified=2020-09-14T03:10:07Z, lastModifiedLocal=null}, Card{title='Functional Movements workout', description='', stackId=3, type='plain', createdAt=2020-09-14T03:10:29Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=999, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=50, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null}]} on Board FullBoard{board=Board{title='Личное', ownerId=1, color=-16777216, archived=false, shared=0, deletedAt=1970-01-01T00:00:00Z, permissionRead=true, permissionEdit=true, permissionManage=true, permissionShare=true, localId=3, accountId=1, id=2, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Board@2caae7cf, labels=[], owner=User{primaryKey='alex', uid='alex', displayname='Alexander Miroshnichenko', localId=1, accountId=1, id=null, status=1, lastModified=null, lastModifiedLocal=null} it.niedermann.nextcloud.deck.model.User@1f6fec95, participants=[], stacks=[]}
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:60)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:23)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:62)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:47)
    at it.niedermann.nextcloud.deck.api.RequestHelper$ResponseConsumer.accept(RequestHelper.java:66)
    at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58)
    at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(ObservableFromPublisher.java:56)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$NextcloudAPI(NextcloudAPI.java:111)
    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:923)
Caused by: java.lang.RuntimeException: Board wasn't created properly! ID: 3
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:50)
    ... 21 more
desperateCoder commented 3 years ago

@alexminder thanks for your response! Sorry for bothering you again, but we get closer. I need to make these baby-steps, so I won't miss anything here.

So "fortunately" it was my expectation, the board wasn't created properly, and that's weird. But ok, I guess we'll need to dive deeper in.

Here is another one: APK (ノ ゜Д゜)ノ ︵ ┻━┻

Sorry again for taking your time, I hope I get a hint soon and can fix this for you.

alexminder commented 3 years ago
App Version: 1.19.4
App Version Code: 1019004
Server App Version: 1.4.5
App Flavor: dev

Files App Version Code: 30170090

---

OS Version: 4.14.234-ga05a5d05bc29(2021100606)
OS API Level: 30
Device: sunfish
Manufacturer: Google
Model (and Product): Pixel 4a (sunfish)

---

java.lang.RuntimeException: (WTF?!) Unable to create Stack FullStack{stack=Stack{title='Надо сделать', boardId=6, deletedAt=1970-01-01T00:00:00Z, order=1, localId=null, accountId=2, id=3, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Stack@bac41189, cards=[Card{title='Д.з. Новоселова с72/629', description='', stackId=3, type='text', createdAt=2018-12-23T07:19:55Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=0, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=4, status=1, lastModified=2019-05-28T08:14:33Z, lastModifiedLocal=null}, Card{title='Compex Performance EMS', description='', stackId=3, type='plain', createdAt=2020-09-14T03:10:07Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=999, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=49, status=1, lastModified=2020-09-14T03:10:07Z, lastModifiedLocal=null}, Card{title='Functional Movements workout', description='', stackId=3, type='plain', createdAt=2020-09-14T03:10:29Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=999, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=50, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null}]} on Board FullBoard{board=Board{title='Личное', ownerId=2, color=-16777216, archived=false, shared=0, deletedAt=1970-01-01T00:00:00Z, permissionRead=true, permissionEdit=true, permissionManage=true, permissionShare=true, localId=6, accountId=2, id=2, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Board@bf805aae, labels=[], owner=User{primaryKey='alex', uid='alex', displayname='Alexander Miroshnichenko', localId=2, accountId=2, id=null, status=1, lastModified=null, lastModifiedLocal=null} it.niedermann.nextcloud.deck.model.User@1f6fec95, participants=[], stacks=[]}
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:62)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:23)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:62)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:47)
    at it.niedermann.nextcloud.deck.api.RequestHelper$ResponseConsumer.accept(RequestHelper.java:66)
    at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58)
    at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(ObservableFromPublisher.java:56)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$NextcloudAPI(NextcloudAPI.java:111)
    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:923)
Caused by: java.lang.RuntimeException: something wasn't created properly!
Account ID: 2: null
boardInDataProvider: FullBoard{board=Board{title='Личное', ownerId=2, color=-16777216, archived=false, shared=0, deletedAt=1970-01-01T00:00:00Z, permissionRead=true, permissionEdit=true, permissionManage=true, permissionShare=true, localId=6, accountId=2, id=2, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Board@bf805aae, labels=[], owner=User{primaryKey='alex', uid='alex', displayname='Alexander Miroshnichenko', localId=2, accountId=2, id=null, status=1, lastModified=null, lastModifiedLocal=null} it.niedermann.nextcloud.deck.model.User@1f6fec95, participants=[], stacks=[]}
boardByLocalID: null
boardByREMOTE_ID: null
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:53)
    ... 21 more
desperateCoder commented 3 years ago

Thanks! We're getting (a little bit) closer.

Here is another one: ʕノ•ᴥ•ʔノ ︵ ┻━┻ APK

Chances are few, that it works now, but at least I can tell it isn't a transaction failiure. Sorry again for abusing you as tester, but I really can't reproduce this behaviour on any of my machines.

desperateCoder commented 3 years ago

Ping @alexminder :sweat_smile:

KH-codes commented 3 years ago

I appear to have the same issue. When i log with the stored account, in i get three error messages in quick succession (the copy button does not work either). The first two appear to concern sso, the last one sqllite.

After that, the app opens but without any dashboards / cards. Tapping the 'profile'-icon results in a new error:

Device Phone: Samsung Galaxy Note 9 OS: Android 10

Versions Nextcloud: 22.2.0 Nextcloud Deck: 1.5.3 Nextcloud app: 3.17.0 Deck app: 1.19.4 according to stacktrace.

Stacktrace

Full Crash:

App Version: 1.19.4
App Version Code: 1019004
App Flavor: play

Files App Version Code: 30170090

---

OS Version: 4.9.118-21635307(N960FXXS9FUH1)
OS API Level: 29
Device: crownlte
Manufacturer: samsung
Model (and Product): SM-N960F (crownltexx)

---

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:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8167)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
stefan-niedermann commented 3 years ago

@KSH-codes your error message seems to be unrelated to this issue. Could you please open a new issue filling the issue template? The more information you can provide, the better can we help. For exaple: Did this only appear after the last update? Did you just install the app and it directly failed? Did you already try to clear the storage of both apps as described in our FAQ and did or did it not work after doing that?

alexminder commented 3 years ago
App Version: 1.19.4
App Version Code: 1019004
Server App Version: 1.4.5
App Flavor: dev

Files App Version Code: 30170090

---

OS Version: 4.14.234-ga05a5d05bc29(2021100606)
OS API Level: 30
Device: sunfish
Manufacturer: Google
Model (and Product): Pixel 4a (sunfish)

---

java.lang.RuntimeException: (WTF?!) Unable to create Stack FullStack{stack=Stack{title='Надо сделать', boardId=3, deletedAt=1970-01-01T00:00:00Z, order=1, localId=null, accountId=1, id=3, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Stack@bac40646, cards=[Card{title='Д.з. Новоселова с72/629', description='', stackId=3, type='text', createdAt=2018-12-23T07:19:55Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=0, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=4, status=1, lastModified=2019-05-28T08:14:33Z, lastModifiedLocal=null}, Card{title='Compex Performance EMS', description='', stackId=3, type='plain', createdAt=2020-09-14T03:10:07Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=999, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=49, status=1, lastModified=2020-09-14T03:10:07Z, lastModifiedLocal=null}, Card{title='Functional Movements workout', description='', stackId=3, type='plain', createdAt=2020-09-14T03:10:29Z, deletedAt=1970-01-01T00:00:00Z, attachmentCount=0, userId=null, order=999, archived=false, dueDate=null, notified=false, overdue=0, commentsUnread=0, localId=null, accountId=0, id=50, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null}]} on Board FullBoard{board=Board{title='Личное', ownerId=1, color=-16777216, archived=false, shared=0, deletedAt=1970-01-01T00:00:00Z, permissionRead=true, permissionEdit=true, permissionManage=true, permissionShare=true, localId=3, accountId=1, id=2, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Board@2caae7cf, labels=[], owner=User{primaryKey='alex', uid='alex', displayname='Alexander Miroshnichenko', localId=1, accountId=1, id=null, status=1, lastModified=null, lastModifiedLocal=null} it.niedermann.nextcloud.deck.model.User@1f6fec95, participants=[], stacks=[]}
Transaction was active: false
### Accounts:
### boards:

    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:79)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:23)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:62)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:47)
    at it.niedermann.nextcloud.deck.api.RequestHelper$ResponseConsumer.accept(RequestHelper.java:66)
    at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58)
    at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(ObservableFromPublisher.java:56)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$NextcloudAPI(NextcloudAPI.java:111)
    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:923)
Caused by: java.lang.RuntimeException: something wasn't created properly!
Account ID: 1: null
boardInDataProvider: FullBoard{board=Board{title='Личное', ownerId=1, color=-16777216, archived=false, shared=0, deletedAt=1970-01-01T00:00:00Z, permissionRead=true, permissionEdit=true, permissionManage=true, permissionShare=true, localId=3, accountId=1, id=2, status=1, lastModified=2020-09-14T03:10:29Z, lastModifiedLocal=null, etag='a86368c718b6ba11bf5fb70d50f730fc'} it.niedermann.nextcloud.deck.model.Board@2caae7cf, labels=[], owner=User{primaryKey='alex', uid='alex', displayname='Alexander Miroshnichenko', localId=1, accountId=1, id=null, status=1, lastModified=null, lastModifiedLocal=null} it.niedermann.nextcloud.deck.model.User@1f6fec95, participants=[], stacks=[]}
boardByLocalID: null
boardByREMOTE_ID: null
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.createInDB(StackDataProvider.java:57)
    ... 21 more
alexminder commented 3 years ago

@desperateCoder Can I help more?

desperateCoder commented 3 years ago

@alexminder thanks for the offer! We're at a point now, that I know what's going on (thanks to you), but I really can't tell how this can happen.

To find out, we need to change a few things, not only for debug purposes I this case, but for similar cases in the future. @stefan-niedermann will implement the possibility to enable debug logs before the fist sync attempt, as soon as we have this we can proceed here as well. Please be patient and sorry for all the inconveniences!

The only thing I can think of for now is, if you have any other android device, could you try the app on it? I wonder if this error is device specific.

josemh commented 3 years ago

I am also getting this error. I'm running a self-hosted NextCloud server version 22.2.0. I have a Note 9 and have the NextCloud app installed and running.

App Version: 1.19.4
App Version Code: 1019004
Server App Version: 0.6.4
App Flavor: play

Files App Version Code: 30170190

---

OS Version: 4.9.186-21635681(N960USQS9FUG2)
OS API Level: 29
Device: crownqltesq
Manufacturer: samsung
Model (and Product): SM-N960U (crownqltesq)

---

it.niedermann.nextcloud.deck.exceptions.DeckException: deck node is missing in capabilities endpoint!
    at it.niedermann.nextcloud.deck.api.JsonToEntityParser.parseCapabilities(JsonToEntityParser.java:559)
    at it.niedermann.nextcloud.deck.api.JsonToEntityParser.parseJsonObject(JsonToEntityParser.java:61)
    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:932)
    at com.google.gson.Gson.fromJson(Gson.java:897)
    at com.nextcloud.android.sso.api.NextcloudAPI.convertStreamToTargetEntity(NextcloudAPI.java:135)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$NextcloudAPI(NextcloudAPI.java:111)
    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.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:919)
stefan-niedermann commented 3 years ago

@josemh your error is not related to this one, please open a separate issue filling the issue template and especially tell us which versions of Nextcloud and the Deck server app you are using (it looks like you don't have installed the Deck app on your server at all).

josemh commented 3 years ago

@josemh your error is not related to this one, please open a separate issue filling the issue template and especially tell us which versions of Nextcloud and the Deck server app you are using (it looks like you don't have installed the Deck app on your server at all).

I was able to get past the issue. My server did have Deck server app installed (it is an new install after a server crash). I believe the Nextcloud Android app had some invalid connection to the previous server. I had to uninstall and reinstall the Android Nextcloud and Nextcloud-Deck apps. Then everything worked. Thanks for the reply.

Goldmaster commented 3 years ago

I'm having the same issue with the fdroid version. I had it working fine and despite following the settings of force stop, clear data and force stopping nextcloud. I have disabled battery optimisation and get the following error.

Full Crash:

App Version: 1.19.6
App Version Code: 1019006
App Flavor: fdroid

Files App Version Code: 30180051

---

OS Version: 4.14.85-17063867(G973FXXS3ASJG)
OS API Level: 28
Device: beyond1
Manufacturer: samsung
Model (and Product): SM-G973F (beyond1lteeea)

---

java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
    at androidx.fragment.app.FragmentManager.checkStateLoss(FragmentManager.java:1844)
    at androidx.fragment.app.FragmentManager.enqueueAction(FragmentManager.java:1884)
    at androidx.fragment.app.BackStackRecord.commitInternal(BackStackRecord.java:329)
    at androidx.fragment.app.BackStackRecord.commit(BackStackRecord.java:294)
    at androidx.fragment.app.DialogFragment.show(DialogFragment.java:260)
    at it.niedermann.nextcloud.deck.ui.ImportAccountActivity$1$1$1.lambda$onError$4$it-niedermann-nextcloud-deck-ui-ImportAccountActivity$1$1$1(ImportAccountActivity.java:184)
    at it.niedermann.nextcloud.deck.ui.ImportAccountActivity$1$1$1$$ExternalSyntheticLambda4.run(Unknown Source:6)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7037)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
TtuxX commented 3 years ago

Hi there @stefan-niedermann and @desperateCoder :)

I am also experiencing a crash at login time, with error messages that are not consistent at each crash and new login attempt.

I thus cannot use your great app anymore at the moment on my device. :( I tried other older versions but it also does not seems to work.

Login is crashing during import, at board 4/24 for me, with usually a window allocation error or an EMFILE error.

I am wondering if this could be related to the size of the imported board, the number of cards it contains or the amount of text overall? Like taking too much time or exceeding the expected memory in the app?

You will find hereunder all the kind of different logs I get at each login attempt (inconsistent errors):

Login Test 1: ``` Full Crash: App Version: 1.19.6 App Version Code: 1019006 App Flavor: fdroid Files App Version Code: 30020499 --- OS Version: 4.4.23+(157(C432)) OS API Level: 26 Device: HWBLA Manufacturer: HUAWEI Model (and Product): BLA-L29 (BLA-L29) --- android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. at android.database.CursorWindow.(CursorWindow.java:110) at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198) at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:138) at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132) at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:219) at android.database.AbstractCursor.moveToNext(AbstractCursor.java:268) at androidx.room.InvalidationTracker$1.checkUpdatedTable(InvalidationTracker.java:464) at androidx.room.InvalidationTracker$1.run(InvalidationTracker.java:431) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:784) ```
Login Test 2: ``` Full Crash: App Version: 1.19.6 App Version Code: 1019006 App Flavor: fdroid Files App Version Code: 30020499 --- OS Version: 4.4.23+(157(C432)) OS API Level: 26 Device: HWBLA Manufacturer: HUAWEI Model (and Product): BLA-L29 (BLA-L29) --- java.lang.RuntimeException: Could not read input channel file descriptors from parcel. at android.view.InputChannel.nativeReadFromParcel(Native Method) at android.view.InputChannel.readFromParcel(InputChannel.java:148) at android.view.IWindowSession$Stub$Proxy.addToDisplay(IWindowSession.java:804) at android.view.ViewRootImpl.setView(ViewRootImpl.java:845) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:372) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:128) at android.app.Dialog.show(Dialog.java:454) at androidx.fragment.app.DialogFragment.onStart(DialogFragment.java:687) at androidx.fragment.app.Fragment.performStart(Fragment.java:3021) at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:589) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:300) 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:808) at android.os.Handler.dispatchMessage(Handler.java:101) at android.os.Looper.loop(Looper.java:166) at android.app.ActivityThread.main(ActivityThread.java:7425) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921) ```
Login Test 3: Sometimes I also get (in the very same conditions) a crazy amount of errors in a fraction of a second:
SCREENSHOT - Stack of errors (1/2): ![image](https://user-images.githubusercontent.com/6570830/139472703-a95afc42-6ebf-4c3f-9278-25cc0cd28735.png)
ERROR LOG - Of the "Stack of errors" screenshot: ``` App Version: 1.19.6 App Version Code: 1019006 Server App Version: 1.5.3 App Flavor: fdroid Files App Version Code: 30020499 --- OS Version: 4.4.23+(157(C432)) OS API Level: 26 Device: HWBLA Manufacturer: HUAWEI Model (and Product): BLA-L29 (BLA-L29) --- android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (Sqlite code 787), (OS error - 11:Try again) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:818) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:803) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86) at androidx.sqlite.db.framework.FrameworkSQLiteStatement.executeInsert(FrameworkSQLiteStatement.java:51) at androidx.room.EntityInsertionAdapter.insertAndReturnId(EntityInsertionAdapter.java:114) at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.UserDao_Impl.insert(UserDao_Impl.java:181) at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.UserDao_Impl.insert(UserDao_Impl.java:29) at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter.createUser(DataBaseAdapter.java:352) at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider.fixRelations(CardDataProvider.java:96) at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:79) at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:32) at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:62) at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:47) at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:59) at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:54) at it.niedermann.nextcloud.deck.api.RequestHelper$ResponseConsumer.accept(RequestHelper.java:66) at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63) at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58) at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62) at io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(ObservableFromPublisher.java:56) at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:111) 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:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:784) ```
Then it sometimes ends up after the following state after few seconds (with a null pointer exception if I click on the account profile at the top right of the app):
SCREENSHOT - Blank "logged-in" app result (2/2): ![image](https://user-images.githubusercontent.com/6570830/139472725-551cce17-2baa-4348-8f8a-77bfd8ae9e63.png)

Thank you very much in advance for your kind help, I do really miss your great app!

Best regards

stefan-niedermann commented 3 years ago

@Goldmaster your issue is not related to this one. Please open a separate issue if the behavior persists after clearing the storage as described in our FAQ.

@TtuxX your issue is not related to this one. Please update you extremely old Nextcloud app version (currently 3.2.x) to the currently released stable version 3.17.x (not 3.18-RC1). If the issue persists (also clear the storage as described above), create a new issue.

Guys, it's nice that you are looking for duplicates before creating new issues, but please compare the error messages before throwing everything into one pot :)

desperateCoder commented 3 years ago

Hi @alexminder, sorry for the delay!

I managed to get each and every database query into the error message now.

WARNING: The error message will contain ALL the data in your boards the app was able to sync before it died (but no credentials)! So if you have very private data in there, maybe remove them from the logs before providing them. I promise I'm not interested in your actual data, but their constellation, so no need to remove each and every bit of data here, if you're fine with it.

I'd also suggest mailing the error message to @stefan-niedermann (info@niedermann.it) rather than posting it here. We'll keep the data private and use it to solve this damn problem here.

You can download the more verbose version of the app here: APK: ( ╥﹏╥) ノシ

desperateCoder commented 3 years ago

Thanks for your mail @alexminder,

unfortunately the log you sent wasn't even related to this issue, the server didn't provide a proper order of the card, which is weird. But anyways, I fixed that and made it more fault tolerant. It should now get to the point it failed before. Sorry for that, but good catch though, another problem fixed! Sorry for bothering you again :disappointed:

Here is a fixed version: APK: (҂◡_◡) ᕤ

I'm really, really sorry! Thanks for being that patient with us!

alexminder commented 3 years ago

@desperateCoder Last debug version success imported decks without errors. No changes on servers side was.

desperateCoder commented 3 years ago

Какого черта?!

@alexminder thanks for testing, unfortunately I can't see any reason why this works now....

Could you confirm, that this version works as well? ヽ(`Д´)⊃━☆゚. * ・ 。゚, APK

This is the latest master the last test-build based on. If this works as well, I consider it as fixed i guess - until you or anyone else encounters this issue again.

desperateCoder commented 3 years ago

@alexminder maybe I should also mention this:

yes, we always recommend to clear thw storage of the Deck app in favor of uninstalling it, because Google (middle_finger) decided to keep some data when uninstalling an app. You can achieve this (depending on your manufacturer) by going to your Android settings -> Apps -> Deck -> Storage -> Clear storage.

As stated here: https://github.com/stefan-niedermann/nextcloud-deck/issues/1135#issuecomment-974676964

I wasn't aware of this to be honest, so I'll just leave it here in case this could cause other problems... You can also check the linked issue, there are a couple of versions linked, you could also try if you want.

By the way: If you could use a couple of voucher codes for the play-store version of this app as a "thank you", just hit us up, you already well deserved it!

Looking forward to your feedback!

alexminder commented 3 years ago

This is the latest master the last test-build based on.

Imported without errors

alexminder commented 3 years ago

Android settings -> Apps -> Deck -> Storage -> Clear storage.

I have deleted the app with all data before install every debug version. Nothing to clear.

desperateCoder commented 3 years ago

Imported without errors

Great! :partying_face:

Nothing to clear.

As long as it works I'm fine with it!

As mentioned, if you could need some PlayStore vouchers for this app, just tell us any time, HUGE THANKS man, you helped us a lot here!

Can we close this issue then? I'll talk to @stefan-niedermann, I think we should release a new version soon

desperateCoder commented 2 years ago

@alexminder @TtuxX sorry for the (huge) delay. I almost lost my mind on this, until I even found the lines that might be causing this. Concurrency is great as long as it works, but when it doesn't, it is a hell of a debug session.

Could you please test the following version and confirm it either still working (@alexminder) or still faulty (@TtuxX )?

(≧︿≦) APK

You can safely install it along your productive version, it will show up as a second app with a "dev" label.

TtuxX commented 2 years ago

Dear @desperateCoder, thank you so much for your update on this thread, for all the time you spend and for your kind help on this problem ! :) I was missing the latest updates from your great app and refrained a lot from pinging you since last november haha

I tried the latest debug version you just sent us (stopping the app and deleting all the data and so on). However the app does not load all the boards like the previous debug version you sent me in this issue (which was crashing while opening some cards, but at least import was working).

It now stalls trying to import the large board that always fails (board 3/29), but the app does not crash or fail anymore. It now just stalls forever.

desperateCoder commented 2 years ago

@TtuxX thanks for your feedback! As said, it was pure hell and to be honest it still is. I did further tests and had different outcomes. The good thing: cloning boards seems to work fine now, even with bigger boards.

The bad thing: the devices still seem to be overwhelmed with big board trees and I still had quite some difficulties in my tests. The final word isn't spoken here yet, I'll keep working on this and update you as soon as I have something better. Just wanted to know if it's just my shitty server or you guys still have issues as well.

As said, sorry for the delay! If You feel like it takes too long, sometimes a friendly reminder is helpful as well, so feel free to ping. Having such an asshole problem invites to procraste pretty badly 😅

But as I was fixing the clone-boards feature, i discovered a whole new spectrum of possibilities, and I am willing to take them to the fullest to get this working. It's getting kind of personal now, human vs. machines.

In the next two weeks it could get a little busy, but be assured: I'm on it and motivated more than the last months. I'll let you know as soon as I have something better.

Btw: did you update your instance to a newer release of nextcloud and/or deck in the meantime? If yes: which versions are you running currently? Could help for testing purposes...

TtuxX commented 2 years ago

Haha thank you very much for not letting this issue down !

I would like to start coding android apps but I am a bit worried about how complex debuging this issue seems to be, I didn't think that the code and the way of operating of an android app could be so obscure and difficult to trace :0 I remember reading you or Stefan say that "android is a bitch" haha

I sent to info@niedermann.it further logs from the latest apk debug version :)

One message that keeps appearing in this new debug version is the following one:

05-24 10:33:13.801 17741 17871 I zygote64: Rejecting re-init on previously-failed class java.lang.Class<it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider>: java.lang.NoSuchMethodError: No static method newKeySet()Lj$/util/concurrent/ConcurrentHashMap$KeySetView; in class Lj$/util/concurrent/ConcurrentHashMap; or its super classes (declaration of 'j$.util.concurrent.ConcurrentHashMap' appears in /data/app/it.niedermann.nextcloud.deck.dev-i0aoz1v_ELXdJvGAEfKqwg==/base.apk:classes19.dex)
05-24 10:33:13.801 17741 17871 I zygote64:   at void it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider.<clinit>() (CardDataProvider.java:38)
05-24 10:33:13.801 17741 17871 I zygote64:   at void it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.goDeeper(it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper, it.niedermann.nextcloud.deck.model.full.FullStack, it.niedermann.nextcloud.deck.model.full.FullStack, it.niedermann.nextcloud.deck.api.ResponseCallback) (StackDataProvider.java:70)
05-24 10:33:13.801 17741 17871 I zygote64:   at void it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider.goDeeper(it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper, it.niedermann.nextcloud.deck.model.interfaces.IRemoteEntity, it.niedermann.nextcloud.deck.model.interfaces.IRemoteEntity, it.niedermann.nextcloud.deck.api.ResponseCallback) (StackDataProvider.java:20)
05-24 10:33:13.801 17741 17871 I zygote64:   at void it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(java.util.List) (SyncHelper.java:77)
05-24 10:33:13.801 17741 17871 I zygote64:   at void it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(java.lang.Object) (SyncHelper.java:47)
05-24 10:33:13.801 17741 17871 I zygote64:   at void it.niedermann.nextcloud.deck.api.RequestHelper$ResponseConsumer.accept(java.lang.Object) (RequestHelper.java:56)
05-24 10:33:13.801 17741 17871 I zygote64:   at void io.reactivex.internal.observers.LambdaObserver.onNext(java.lang.Object) (LambdaObserver.java:63)
05-24 10:33:13.801 17741 17871 I zygote64:   at void io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(java.lang.Object) (ObservableSubscribeOn.java:58)
05-24 10:33:13.801 17741 17871 I zygote64:   at void io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(java.lang.Object) (ObservableMap.java:62)
05-24 10:33:13.801 17741 17871 I zygote64:   at void io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(java.lang.Object) (ObservableFromPublisher.java:56)
05-24 10:33:13.801 17741 17871 I zygote64:   at void com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$com-nextcloud-android-sso-api-NextcloudAPI(com.nextcloud.android.sso.aidl.NextcloudRequest, java.lang.reflect.Type, org.reactivestreams.Subscriber) (NextcloudAPI.java:130)
05-24 10:33:13.801 17741 17871 I zygote64:   at void com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda2.subscribe(org.reactivestreams.Subscriber) (D8$$SyntheticClass:-1)
05-24 10:33:13.801 17741 17871 I zygote64:   at void io.reactivex.internal.operators.observable.ObservableFromPublisher.subscribeActual(io.reactivex.Observer) (ObservableFromPublisher.java:31)
05-24 10:33:13.801 17741 17871 I zygote64:   at void io.reactivex.Observable.subscribe(io.reactivex.Observer) (Observable.java:12284)
05-24 10:33:13.801 17741 17871 I zygote64:   at void io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(io.reactivex.Observer) (ObservableMap.java:32)
05-24 10:33:13.801 17741 17871 I zygote64:   at void io.reactivex.Observable.subscribe(io.reactivex.Observer) (Observable.java:12284)
05-24 10:33:13.801 17741 17871 I zygote64:   at void io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run() (ObservableSubscribeOn.java:96)
05-24 10:33:13.801 17741 17871 I zygote64:   at java.lang.Void io.reactivex.internal.schedulers.ScheduledDirectTask.call() (ScheduledDirectTask.java:38)
05-24 10:33:13.801 17741 17871 I zygote64:   at java.lang.Object io.reactivex.internal.schedulers.ScheduledDirectTask.call() (ScheduledDirectTask.java:26)
05-24 10:33:13.801 17741 17871 I zygote64:   at void java.util.concurrent.FutureTask.run() (FutureTask.java:266)
05-24 10:33:13.801 17741 17871 I zygote64:   at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1162)
05-24 10:33:13.801 17741 17871 I zygote64:   at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:636)
05-24 10:33:13.801 17741 17871 I zygote64:   at void java.lang.Thread.run() (Thread.java:784)
05-24 10:33:13.801 17741 17871 I zygote64: 
05-24 10:33:13.812  3850 17881 D InputStreamBinder: Done sending result
05-24 10:33:13.812  3850 17881 I com.nextcloud.android.sso.aidl.ParcelFileDescriptorUtil.TransferThread: releaseConnection

I updated my server and apps and their current versions are the following ones:

desperateCoder commented 2 years ago

Yep android can be a diva, but it also has its advantages.

It's not android making it so hard to debug, it's my own implementation. Sure, i could work synchronously call after call, but it would make everything super slow, so I contact the server in multiple simultaneous calls to speed the sync up.

Having all that offline capabilities, so you don't always rely on the server, makes everything even more complex.

So don't be afraid of coding for Android, be afraid of yourself. Or of my code 🤣

wargreen commented 1 year ago

Hi, We have the same issue here. Server : NC 27.1.1, Deck 1.11.0

Android : NC 3.25.0, Deck 1.23.3 (F-droid)

Smartphone : samsung SM-A032F with stock OS

We have two bug report, one first :

App Version: 1.23.3
App Version Code: 1023003
Server App Version: 1.11.0
App Flavor: fdroid

Files App Version Code: 30250090 (PROD)

---

OS Version: 4.14.199-26139528-abA032FXXU3BWF2(A032FXXU3BWF2)
OS API Level: 31
Device: a3core
Manufacturer: samsung
Model (and Product): SM-A032F (a3corexx)

---

android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: Card.accountId, Card.id (code 2067 SQLITE_CONSTRAINT_UNIQUE)
    at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
    at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:940)
    at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
    at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:89)
    at androidx.sqlite.db.framework.FrameworkSQLiteStatement.executeInsert(FrameworkSQLiteStatement.kt:42)
    at androidx.room.EntityInsertionAdapter.insertAndReturnId(EntityInsertionAdapter.kt:102)
    at it.niedermann.nextcloud.deck.database.dao.CardDao_Impl.insert(CardDao_Impl.java:263)
    at it.niedermann.nextcloud.deck.database.dao.CardDao_Impl.insert(CardDao_Impl.java:43)
    at it.niedermann.nextcloud.deck.database.DataBaseAdapter.createCardDirectly(DataBaseAdapter.java:744)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:84)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:34)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:62)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:47)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:63)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:58)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.accept(RequestHelper.java:52)
    at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58)
    at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(ObservableFromPublisher.java:56)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$0$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:123)
    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)`

And some seconds after, plenty of :
`App Version: 1.23.3
App Version Code: 1023003
Server App Version: 1.11.0
App Flavor: fdroid

Files App Version Code: 30250090 (PROD)

---

OS Version: 4.14.199-26139528-abA032FXXU3BWF2(A032FXXU3BWF2)
OS API Level: 31
Device: a3core
Manufacturer: samsung
Model (and Product): SM-A032F (a3corexx)

---

android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787 SQLITE_CONSTRAINT_FOREIGNKEY)
    at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
    at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:940)
    at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
    at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:89)
    at androidx.sqlite.db.framework.FrameworkSQLiteStatement.executeInsert(FrameworkSQLiteStatement.kt:42)
    at androidx.room.EntityInsertionAdapter.insertAndReturnId(EntityInsertionAdapter.kt:102)
    at it.niedermann.nextcloud.deck.database.dao.UserDao_Impl.insert(UserDao_Impl.java:177)
    at it.niedermann.nextcloud.deck.database.dao.UserDao_Impl.insert(UserDao_Impl.java:29)
    at it.niedermann.nextcloud.deck.database.DataBaseAdapter.createUser(DataBaseAdapter.java:393)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.fixRelations(CardDataProvider.java:100)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:83)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:34)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:62)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:47)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:63)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:58)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.accept(RequestHelper.java:52)
    at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58)
    at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(ObservableFromPublisher.java:56)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$0$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:123)
    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)