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
488 stars 52 forks source link

`SQLiteConstraintException: UNIQUE constraint failed` #1447

Open duckimann opened 1 year ago

duckimann commented 1 year ago

Steps to reproduce the behavior:

  1. Click Choose Account
  2. Choose suitable account
  3. Accept Nextcloud Deck access Nextcloud Account
  4. Wait to import boards
  5. Error shows up

Expected behavior Import available boards

Screenshots Screenshot_2023-03-13-06-53-31-907_it niedermann nextcloud deck Screenshot_2023-03-13-06-52-52-344_it niedermann nextcloud deck

Versions

Smartphone (please complete the following information):

Stacktrace

App Version: 1.21.8
App Version Code: 1021008
Server App Version: 1.8.3
App Flavor: fdroid

Files App Version Code: 30240190

---

OS Version: 4.19.157-perf-g85e27949fb09(V13.0.7.0.SGCMIXM)
OS API Level: 31
Device: spes
Manufacturer: Xiaomi
Model (and Product): 2201117TG (spes_global)

---

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.persistence.sync.adapters.db.dao.CardDao_Impl.insert(CardDao_Impl.java:263)
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.CardDao_Impl.insert(CardDao_Impl.java:43)
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter.createCardDirectly(DataBaseAdapter.java:709)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:84)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:34)
    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:63)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:58)
    at it.niedermann.nextcloud.deck.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$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:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
    at java.lang.Thread.run(Thread.java:1012)
Gobytego commented 1 year ago

will keep trying with different combinations, i am also going through all the cards in all the boards to see if there is anything funny there as well. but like i have said each board will sync its just when syncing more then one board even mostly empty boards with only one or two cards in them.

desperateCoder commented 1 year ago

So I double-checked every possibility that came in mind this weekend, and i just can't understand why this all even happens. Concurrency sucks.

Since the ConstraintViolations are the only thing left (at least as far as i can tell), I'd like to get some more details, what exactly is missing. I built a new version with some additional information in the error message. Since everything works on my machines (virtual and physical), I'd like you to give it a try, so we can get closer to the root cause:

( ╥﹏╥) ノシ APK

Plus: as mentioned above, It works on my machines. Any chance you have a second device (maybe a tablet?) laying around you could do a test with? Since Android has quite some fragmentation and Unihertz isn't really a mainstream brand, maybe the issue lies in some deeper software (OS level)? I'd be curious if its device-related...

Gobytego commented 1 year ago

Okay tried a few times and I keep getting different messages but same style error. I will try on different devices today. Only reason I can test all the time on the unihertz brand is its my daily driver.

Full Crash:

App Version: 1.22.1
App Version Code: 1022001
App Flavor: dev

Files App Version Code: 30240290

---

OS Version: 4.14.186-gd5b54dace-dirty(root.20220812.180105)
OS API Level: 30
Device: Titan_Slim
Manufacturer: Unihertz
Model (and Product): Titan Slim (Titan_Slim)

---

java.lang.RuntimeException: ConstraintViolation! Entity: DeckCommentsDataProvider
OcsComment: {"comments":[{"actorDisplayName":"Adam Singer","actorId":"adam","actorType":"users","creationDateTime":{"nanos":0,"seconds":1681475599},"mentions":[],"message":"flat rate envelope","objectId":30,"accountId":3,"id":1883,"status":1}]}
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:73)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:54)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.DeckCommentsDataProvider$1.onResponse(DeckCommentsDataProvider.java:41)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.DeckCommentsDataProvider$1.onResponse(DeckCommentsDataProvider.java:32)
    at it.niedermann.nextcloud.deck.remote.api.IResponseCallback.onResponseWithHeaders(IResponseCallback.java:18)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:49)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:72)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    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.kt:42)
    at androidx.room.EntityInsertionAdapter.insertAndReturnId(EntityInsertionAdapter.kt:102)
    at it.niedermann.nextcloud.deck.database.dao.CommentDao_Impl.insert(CommentDao_Impl.java:221)
    at it.niedermann.nextcloud.deck.database.dao.CommentDao_Impl.insert(CommentDao_Impl.java:31)
    at it.niedermann.nextcloud.deck.database.DataBaseAdapter.createComment(DataBaseAdapter.java:1152)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.DeckCommentsDataProvider.createInDB(DeckCommentsDataProvider.java:81)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.DeckCommentsDataProvider.createInDB(DeckCommentsDataProvider.java:21)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:70)
    ... 8 more
Gobytego commented 1 year ago

Sometimes now I just get full pages worth of error and can't see the log. Screenshot_20230417-075915

Gobytego commented 1 year ago

Screenshot_20230417-075255

desperateCoder commented 1 year ago

Thanks!

That's because I integrated all the information in the exception message, that's not going to stay like this.

I'll check the data as soon as I find time for it and report back, as soon as I know more. At a glance it looks like everything should be fine though... 🤔 Really weird.

desperateCoder commented 1 year ago

So the pain goes on:

(;´༎ຶД༎ຶ`) APK

In your previous errors it was mostly Attachments and Comments, that caused the crash. I Added some more information to the error messages (no private data like last time, but you better double-check). I hope to see what exact entity is missing for our constraints, so i can get closer to the root cause.

Don't forget to reset the app by deleting the app's storage in android-settings.

And please copy the error-text as you did above a couple of times. The screenshots are also helpful, but not as much as the full stacktrace.

And again: Big thanks for your patience and help! :heart:

Gobytego commented 1 year ago

You got it.

Here is the first attempt.

Full Crash:

App Version: 1.22.1
App Version Code: 1022001
App Flavor: dev

Files App Version Code: 30240290

---

OS Version: 4.14.186-gd5b54dace-dirty(root.20220812.180105)
OS API Level: 30
Device: Titan_Slim
Manufacturer: Unihertz
Model (and Product): Titan Slim (Titan_Slim)

---

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Long it.niedermann.nextcloud.deck.model.User.getLocalId()' on a null object reference
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.fixRelations(CardDataProvider.java:117)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:93)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:35)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:70)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:54)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:73)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:68)
    at it.niedermann.nextcloud.deck.remote.api.IResponseCallback.onResponseWithHeaders(IResponseCallback.java:18)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:49)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:72)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    at java.lang.Thread.run(Thread.java:923)

Screenshot_20230419-141200

Gobytego commented 1 year ago

Attempt 2

Full Crash:

App Version: 1.22.1
App Version Code: 1022001
App Flavor: dev

Files App Version Code: 30240290

---

OS Version: 4.14.186-gd5b54dace-dirty(root.20220812.180105)
OS API Level: 30
Device: Titan_Slim
Manufacturer: Unihertz
Model (and Product): Titan Slim (Titan_Slim)

---

java.lang.RuntimeException: Error creating Attachment.
AccountID: 2 (parent-DataProvider gave CardID: 21 in account 2) (existing: false)
cardID: 21 (existing: false)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.AttachmentDataProvider.onInsertFailed(AttachmentDataProvider.java:43)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.AttachmentDataProvider.onInsertFailed(AttachmentDataProvider.java:22)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:72)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:54)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.AttachmentDataProvider.getAllFromServer(AttachmentDataProvider.java:48)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.AbstractSyncDataProvider.getAllFromServer(AbstractSyncDataProvider.java:82)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper.doSyncFor(SyncHelper.java:54)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper.doSyncFor(SyncHelper.java:50)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.goDeeper(CardDataProvider.java:160)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.goDeeper(CardDataProvider.java:35)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:93)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:54)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:73)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:68)
    at it.niedermann.nextcloud.deck.remote.api.IResponseCallback.onResponseWithHeaders(IResponseCallback.java:18)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:49)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:72)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    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.kt:42)
    at androidx.room.EntityInsertionAdapter.insertAndReturnId(EntityInsertionAdapter.kt:102)
    at it.niedermann.nextcloud.deck.database.dao.AttachmentDao_Impl.insert(AttachmentDao_Impl.java:277)
    at it.niedermann.nextcloud.deck.database.dao.AttachmentDao_Impl.insert(AttachmentDao_Impl.java:29)
    at it.niedermann.nextcloud.deck.database.DataBaseAdapter.createAttachment(DataBaseAdapter.java:956)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.AttachmentDataProvider.createInDB(AttachmentDataProvider.java:59)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.AttachmentDataProvider.createInDB(AttachmentDataProvider.java:22)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:70)
    ... 16 more

Screenshot_20230419-141400

Gobytego commented 1 year ago

Attempt 3

Full Crash:

App Version: 1.22.1
App Version Code: 1022001
App Flavor: dev

Files App Version Code: 30240290

---

OS Version: 4.14.186-gd5b54dace-dirty(root.20220812.180105)
OS API Level: 30
Device: Titan_Slim
Manufacturer: Unihertz
Model (and Product): Titan Slim (Titan_Slim)

---

java.lang.RuntimeException: Error creating Attachment.
AccountID: 1 (parent-DataProvider gave StackID: 7 in account 1) (existing: false)
stackID: 7 (existing: false)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.onInsertFailed(CardDataProvider.java:55)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.onInsertFailed(CardDataProvider.java:35)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:72)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:54)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:73)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:68)
    at it.niedermann.nextcloud.deck.remote.api.IResponseCallback.onResponseWithHeaders(IResponseCallback.java:18)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:49)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:72)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    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.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:110)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:93)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:35)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:70)
    ... 8 more
desperateCoder commented 1 year ago

Ok, attempt 1 is really weird, but it's kind of unrelated.

Attempt 2 and 3 is what I was looking for and the output is really odd. It makes absolutely no sense.

This leads me to a couple of questions:

  1. In this particular installation, is this the first and only account you were trying to synchronize with?
  2. Do you have any other device you could do a test on?
  3. Do you have some coworkers who could do a test with their devices? You can just share the APK above with them, no license needed.

I'm speechless right now, this is a total mess. I'll have a look at it tomorrow to see if I made an obvious mistake, but for now I really don't get it. This is wrong in so many ways, I don't even know where to start.

Thanks so far, I'll reach out to you tomorrow

Gobytego commented 1 year ago

I'll see what I can do to get it tested on more devices.

Gobytego commented 1 year ago

Just for shits and giggles I just did something different. I factory reset the phone I am using and did it again. Seemed like it did about 8 of the boards then kicked the error.

Full Crash:

App Version: 1.22.1
App Version Code: 1022001
App Flavor: dev

Files App Version Code: 30240290

---

OS Version: 4.14.186-gd5b54dace-dirty(root.20220812.180105)
OS API Level: 30
Device: Titan_Slim
Manufacturer: Unihertz
Model (and Product): Titan Slim (Titan_Slim)

---

java.lang.RuntimeException: Error creating Attachment.
AccountID: 2 (parent-DataProvider gave StackID: 45 in account 2) (existing: false)
stackID: 45 (existing: false)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.onInsertFailed(CardDataProvider.java:55)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.onInsertFailed(CardDataProvider.java:35)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:72)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:54)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:73)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:68)
    at it.niedermann.nextcloud.deck.remote.api.IResponseCallback.onResponseWithHeaders(IResponseCallback.java:18)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:49)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:72)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    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.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:110)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:93)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:35)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:70)
    ... 8 more
Gobytego commented 1 year ago

But yah tomorrow I will get my hands on a few more devices and different user accounts and start testing again. To show you results of other hardware.

Gobytego commented 1 year ago

tried it on one of my employees phones with his account... here are the results

Full Crash:

App Version: 1.22.1
App Version Code: 1022001
App Flavor: dev

Files App Version Code: 30240290

---

OS Version: 4.19.188+-ab1rck61v164bspP13(LV8E)
OS API Level: 31
Device: Jetta_ATT
Manufacturer: TCL
Model (and Product): 4188R (4188R)

---

java.lang.RuntimeException: Error creating Attachment.
AccountID: 1 (parent-DataProvider gave StackID: 8 in account 1) (existing: false)
stackID: 8 (existing: false)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.onInsertFailed(CardDataProvider.java:55)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.onInsertFailed(CardDataProvider.java:35)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:72)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:54)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:73)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider$1.onResponse(CardDataProvider.java:68)
    at it.niedermann.nextcloud.deck.remote.api.IResponseCallback.onResponseWithHeaders(IResponseCallback.java:18)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:49)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:72)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    at java.lang.Thread.run(Thread.java:1012)
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:996)
    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:110)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:93)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider.createInDB(CardDataProvider.java:35)
    at it.niedermann.nextcloud.deck.remote.helpers.SyncHelper$1.onResponse(SyncHelper.java:70)
    ... 8 more
Gobytego commented 1 year ago

will try to get more... issue is most of these guys are running around so its hard to test all their devices.... i have a few test devices at home... going to try fishing them out and test on them

desperateCoder commented 1 year ago

So they get basically the same error. I just don't get it. I double- and triple-checked the output code, all of this doesn't make sense at all.

I have one final test version to get the maximum of (hopefully) useful information i can get at the point it fails:

(=____=) APK

So we can (kind of) say, it is most likely not a device- or OS-specific issue., since other devices seem to have the same behavior.

What I can still offer is to try it on your server with a test account provided by you. But we both know that I would then see all your data in your Deck app, so I'd totally understand it in case you don't want this. But if you don't mind, that would be the perfect testing playground for me, so I wouldn't need to bother you with this until i have an idea of what's actually happening here. What do you think? Too sensible Data (-> totally fine!)?

Gobytego commented 1 year ago

Screenshot_20230417-075255

We can give you access to one of the servers.

Gobytego commented 1 year ago

Edit: We received the mail adress and removed it for privacy reasons 😉 - @stefan-niedermann

Gobytego commented 1 year ago

emailed you back with a login

Gobytego commented 1 year ago

only thing i ask if you make or move any card please let me know. this is a full live production server.

desperateCoder commented 1 year ago

I'd be happy to get to the point where I could do this via App 😅

Nah, ain't gonna happen, I won't touch anything!

Gobytego commented 11 months ago

wondering if this was ever resolved??

desperateCoder commented 11 months ago

wondering if this was ever resolved??

Unfortunately not, but I got a caveman's fix in mind, just need to convince @stefan-niedermann to implement it next time we get to code together 😅

TtuxX commented 10 months ago

Hi @desperateCoder :) I hope you are doing fine. Just letting you know that I am at you disposal if I can be of any help to debug this issue (I am experiencing it on Pixel 5 with GrapheneOS latest release - Android 14)

TtuxX commented 10 months ago

Workaround for anyone encountering this issue who might want to be able to still use the Deck app:

Ezwen commented 8 months ago

Similar problem today with version 1.23.4.

The problem appeared after simply uninstalling and reinstalling the app. I cannot select my account without getting an exception.

Solved the problem after deleting app data explicitly in Android settings.

Gobytego commented 8 months ago

yep still having issues...

desperateCoder commented 8 months ago

Hey guys,

I finally found some time to dig further into this.

Can you please try the following DEV version of the app and see if it changes anything for you?

༼つಠ益ಠ༽つ ─=≡ΣO)) APK

Please try and report back.

Gobytego commented 8 months ago

Will try now

Gobytego commented 8 months ago
Full Crash:

App Version: 1.23.4
App Version Code: 1023004
App Flavor: dev

Files App Version Code: 30260090 (PROD)

---

OS Version: 4.14.328-g9a1906b02e67(df647df382)
OS API Level: 33
Device: coral
Manufacturer: Google
Model (and Product): Pixel 4 XL (coral)

---

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:961)
    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.AccessControlDataProvider$2.onResponse(AccessControlDataProvider.java:75)
    at it.niedermann.nextcloud.deck.remote.helpers.providers.AccessControlDataProvider$2.onResponse(AccessControlDataProvider.java:67)
    at it.niedermann.nextcloud.deck.remote.api.IResponseCallback.onResponseWithHeaders(IResponseCallback.java:18)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:49)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:86)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    at java.lang.Thread.run(Thread.java:1012)
desperateCoder commented 8 months ago

@Gobytego thanks for testing! This is driving me nuts. I'll keep digging then...

Gobytego commented 8 months ago

@desperateCoder going to try a few things on my end too...

Gobytego commented 8 months ago

damn... just tried on my other server and it gave me a different error... but it timed out and forced close... i will try to grab it again now..

Gobytego commented 8 months ago
App Version: 1.23.4
App Version Code: 1023004
Server App Version: 1.11.2
App Flavor: dev

Files App Version Code: 30260090 (PROD)

---

OS Version: 4.14.328-g9a1906b02e67(df647df382)
OS API Level: 33
Device: coral
Manufacturer: Google
Model (and Product): Pixel 4 XL (coral)

---

it.niedermann.nextcloud.deck.exceptions.OfflineException: Connection rejected
    at it.niedermann.nextcloud.deck.remote.api.ServerCommunicationErrorHandler$Handler.handle(ServerCommunicationErrorHandler.java:52)
    at it.niedermann.nextcloud.deck.remote.api.ServerCommunicationErrorHandler.translateError(ServerCommunicationErrorHandler.java:28)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onFailure(RequestHelper.java:76)
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:51)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:86)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    at java.lang.Thread.run(Thread.java:1012)
Gobytego commented 8 months ago
App Version: 1.23.4
App Version Code: 1023004
Server App Version: 1.11.2
App Flavor: dev

Files App Version Code: 30260090 (PROD)

---

OS Version: 4.14.328-g9a1906b02e67(df647df382)
OS API Level: 33
Device: coral
Manufacturer: Google
Model (and Product): Pixel 4 XL (coral)

---

com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: HTTP request failed with HTTP status-code: 500
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:51)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:86)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.RuntimeException: HTTP StatusCode wasn't 2xx:
Got [HTTP 500] for Call [GET http://localhost/...] with Message:
[<!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="en" data-locale="en_US" translate="no" >
    <head
 data-requesttoken="">
        <meta charset="utf-8">
        <title>
            Generico Cloud      </title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
                <meta name="apple-itunes-app" content="app-id=1125420102">
                <meta name="theme-color" content="#292929">
        <link rel="icon" href="/core/img/favicon.ico">
        <link rel="apple-touch-icon" href="/core/img/favicon-touch.png">
        <link rel="mask-icon" sizes="any" href="/core/img/favicon-mask.svg" color="#292929">
        <link rel="manifest" href="/core/img/manifest.json">
        <link rel="stylesheet" href="/core/css/server.css?v=0c61337a-9">
<link rel="stylesheet" href="/extra-apps/extract/css/style.css?v=7178aad2-9">
<link rel="stylesheet" href="/extra-apps/side_menu/css/sideMenu.css?v=d688dae7-9">
<link rel="stylesheet" href="/core/css/styles.css?v=0c61337a-9">
<link rel="stylesheet" href="/core/css/header.css?v=0c61337a-9">
<link rel="stylesheet" href="/apps/theming/css/default.css?v=34e90de1-9">
<link rel="stylesheet" href="/core/css/guest.css?v=0c61337a-9">
        <script nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" defer src="/dist/core-common.js?v=0c61337a-9"></script>
<script nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" defer src="/dist/core-main.js?v=0c61337a-9"></script>
<script nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" defer src="/dist/core-files_fileinfo.js?v=0c61337a-9"></script>
<script nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" defer src="/dist/core-files_client.js?v=0c61337a-9"></script>
<script nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" defer src="/index.php/js/core/merged-template-prepend.js?v=0c61337a-9"></script>
<script nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" defer src="/apps/encryption/js/encryption.js?v=0c61337a-9"></script>
<script nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" defer src="/dist/files_sharing-main.js?v=0c61337a-9"></script>
<script nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" defer src="/extra-apps/extract/js/extraction.js?v=0c61337a-9"></script>
<script nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" defer src="/extra-apps/side_menu/js/sideMenu.js?v=0c61337a-9"></script>
        <link rel="stylesheet" href="/index.php/apps/side_menu/css/stylesheet?v=1"></link><script defer nonce="aUVHa1lVeFVXTzNXSFhVZjdkLzBReUtZOUVrU09SWmsveGM3VFUzWVkxUT06L2hPU093MGVkNXFzS3k4cXVaaUhLV2ZXb1ExNlRWOG9zU2Q5R1dLVFZEZz0=" src="/index.php/apps/side_menu/js/script?v=1"></script>    </head>
    <body id="body-login">
        <noscript>
    <div id="nojavascript">
        <div>
            This application requires JavaScript for correct operation. Please <a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">enable JavaScript</a> and reload the page.        </div>
    </div>
</noscript>
                    <input type="hidden" id="initial-state-core-versionHash" value="IjBjNjEzMzdhIg==">
                    <input type="hidden" id="initial-state-comments-maxAutoCompleteResults" value="MTA=">
                <div class="wrapper">
            <div class="v-align">
                                    <header role="banner">
                        <div id="header">
                            <div class="logo"></div>
                        </div>
                    </header>
                                <main>
                    <h1 class="hidden-visually">
                        Generico Cloud                  </h1>
                    <div class="guest-box wide">
    <h2>Internal Server Error</h2>
    <p>The server was unable to complete your request.</p>
    <p>If this happens again, please send the technical details below to the server administrator.</p>
    <p>More details can be found in the server log.</p>

    <h3>Technical details</h3>
    <ul>
        <li>Remote Address: 10.1.1.250</li>
        <li>Request ID: ja1IRtCJvrUsOI37RKm4</li>
            </ul>

    </div>
                </main>
            </div>
        </div>
        <footer role="contentinfo" class="guest-box">
            <p class="info">
                <a href="https://genericoep.com" target="_blank" rel="noreferrer noopener" class="entity-name">Generico Cloud</a> – a safe home for all your data           </p>
        </footer>
    </body>
</html>
]
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.buildCause(RequestHelper.java:68)
    ... 4 more
Gobytego commented 8 months ago

holy crap.. cleared the app data one more time... let it try to sync again and this time it seemed to work... some missing cards but no errors... going to play and see what else its missing...

Gobytego commented 8 months ago

ok going to try on my production server...

Gobytego commented 8 months ago

yeah no still getting errors.... but here is the server's log...

OCA\Deck\BadRequestException: userId must be provided and must be not empty

/var/snap/nextcloud/39212/nextcloud/extra-apps/deck/lib/Validators/BaseValidator.php - line 85:

OCA\Deck\Validators\BaseValidator->validate()

/var/snap/nextcloud/39212/nextcloud/extra-apps/deck/lib/Service/AssignmentService.php - line 108:

OCA\Deck\Validators\BaseValidator->check()

<>

OCA\Deck\Service\AssignmentService->__construct()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php - line 116:

ReflectionClass->newInstanceArgs()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php - line 124:

OC\AppFramework\Utility\SimpleContainer->buildClass()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php - line 142:

OC\AppFramework\Utility\SimpleContainer->resolve()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/DependencyInjection/DIContainer.php - line 494:

OC\AppFramework\Utility\SimpleContainer->query()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/DependencyInjection/DIContainer.php - line 466:

OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php - line 97:

OC\AppFramework\DependencyInjection\DIContainer->query()

<>

OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}("** sensiti ... ")

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php - line 116:

array_map()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php - line 124:

OC\AppFramework\Utility\SimpleContainer->buildClass()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php - line 142:

OC\AppFramework\Utility\SimpleContainer->resolve()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/DependencyInjection/DIContainer.php - line 494:

OC\AppFramework\Utility\SimpleContainer->query()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/DependencyInjection/DIContainer.php - line 466:

OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()

/snap/nextcloud/39212/htdocs/lib/private/AppFramework/App.php - line 162:

OC\AppFramework\DependencyInjection\DIContainer->query()

/snap/nextcloud/39212/htdocs/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main()

/snap/nextcloud/39212/htdocs/lib/base.php - line 1068:

OC\Route\Router->match()

/snap/nextcloud/39212/htdocs/index.php - line 36:

OC::handleRequest()

Gobytego commented 8 months ago

Tried with a new user with no boards associated. Worked fine. Added one board and got this...

Screenshot_20240103-112945_Nextcloud Deck

Full Crash:

App Version: 1.23.4
App Version Code: 1023004
App Flavor: dev

Files App Version Code: 30260090 (PROD)

---

OS Version: 4.14.328-g9a1906b02e67(df647df382)
OS API Level: 33
Device: coral
Manufacturer: Google
Model (and Product): Pixel 4 XL (coral)

---

java.lang.NullPointerException: Attempt to read from field 'androidx.swiperefreshlayout.widget.SwipeRefreshLayout it.niedermann.nextcloud.deck.databinding.ActivityMainBinding.swipeRefreshLayout' on a null object reference in method 'void it.niedermann.nextcloud.deck.ui.main.MainActivity$3.lambda$onError$1$it-niedermann-nextcloud-deck-ui-main-MainActivity$3()'
    at it.niedermann.nextcloud.deck.ui.main.MainActivity$3.lambda$onError$1$it-niedermann-nextcloud-deck-ui-main-MainActivity$3(MainActivity.java:371)
    at it.niedermann.nextcloud.deck.ui.main.MainActivity$3$$ExternalSyntheticLambda0.run(Unknown Source:2)
    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:7924)
    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)
Gobytego commented 8 months ago

then same user the board shows up and if i refresh it works but will only show new cards... all old cards are not showing

Gobytego commented 8 months ago

ok with the new user if i set only one board at a time after they're signed in it will sync then the deck is useable but can only set one board at a time... also kind of sucks cause i would have to take that user ou of the group to get then to only be on one board at a time. once all the boards are synced up then i can add then to the group again then go into one board at a time and remove their name... kind of a pain in the ass but its a crude work around for now... really sucks when you have over 50 users and multiple groups especially when some users are in multiple groups and some of those groups only see one or two boards etc... yeah big pain in the ass.

desperateCoder commented 8 months ago

The last one seems to be UI-related (@stefan-niedermann).

Holy cow! Is your setup kind of special or something? I don't have ever seen anything like these errors yet, only the ConstraintViolation thingy...

OCA\Deck\BadRequestException: userId must be provided and must be not empty

Regarding this one: Please tell me this didn't happen while syncing... The sync-process itself doesn't assign anything. At least it shouldn't and I'm quite sure it doesn't. Maybe someone else caused the error? Or was it you playing around with a half-broken dataset?

Regarding connection refused: I don't think this is an error on our side. Maybe bad internet connection? Server-setup?

also kind of sucks

Totally agree! Thats not the goal and I'm doing my best to fix this. But its really hard to code in this highly fragmented environment while dealing with multithreaded hierarchical sync mechanisms. I'll see what i can do.

Please see if the following behaves any different: (ಥ﹏ಥ) APK

Gobytego commented 8 months ago

ok will try now....

Gobytego commented 8 months ago
App Version: 1.23.4
App Version Code: 1023004
Server App Version: 1.11.2
App Flavor: dev

Files App Version Code: 30260090 (PROD)

---

OS Version: 4.14.328-g9a1906b02e67(df647df382)
OS API Level: 33
Device: coral
Manufacturer: Google
Model (and Product): Pixel 4 XL (coral)

---

com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: HTTP request failed with HTTP status-code: 500
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.onResponse(RequestHelper.java:51)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$enqueue$0$com-nextcloud-android-sso-helper-Retrofit2Helper$1(Retrofit2Helper.java:86)
    at com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda0.run(Unknown Source:6)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.RuntimeException: HTTP StatusCode wasn't 2xx:
Got [HTTP 500] for Call [GET http://localhost//index.php/apps/deck/api/v1.1/boards/8/stacks/32/cards/1737] with Message:
[<!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="en" data-locale="en_US" translate="no" >
    <head
 data-requesttoken="">
        <meta charset="utf-8">
        <title>
            Generico Cloud      </title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
                <meta name="apple-itunes-app" content="app-id=1125420102">
                <meta name="theme-color" content="#292929">
        <link rel="icon" href="/core/img/favicon.ico">
        <link rel="apple-touch-icon" href="/core/img/favicon-touch.png">
        <link rel="mask-icon" sizes="any" href="/core/img/favicon-mask.svg" color="#292929">
        <link rel="manifest" href="/core/img/manifest.json">
        <link rel="stylesheet" href="/core/css/server.css?v=0c61337a-9">
<link rel="stylesheet" href="/extra-apps/extract/css/style.css?v=7178aad2-9">
<link rel="stylesheet" href="/extra-apps/side_menu/css/sideMenu.css?v=d688dae7-9">
<link rel="stylesheet" href="/core/css/styles.css?v=0c61337a-9">
<link rel="stylesheet" href="/core/css/header.css?v=0c61337a-9">
<link rel="stylesheet" href="/apps/theming/css/default.css?v=34e90de1-9">
<link rel="stylesheet" href="/core/css/guest.css?v=0c61337a-9">
        <script nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" defer src="/dist/core-common.js?v=0c61337a-9"></script>
<script nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" defer src="/dist/core-main.js?v=0c61337a-9"></script>
<script nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" defer src="/dist/core-files_fileinfo.js?v=0c61337a-9"></script>
<script nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" defer src="/dist/core-files_client.js?v=0c61337a-9"></script>
<script nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" defer src="/index.php/js/core/merged-template-prepend.js?v=0c61337a-9"></script>
<script nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" defer src="/apps/encryption/js/encryption.js?v=0c61337a-9"></script>
<script nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" defer src="/dist/files_sharing-main.js?v=0c61337a-9"></script>
<script nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" defer src="/extra-apps/extract/js/extraction.js?v=0c61337a-9"></script>
<script nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" defer src="/extra-apps/side_menu/js/sideMenu.js?v=0c61337a-9"></script>
        <link rel="stylesheet" href="/index.php/apps/side_menu/css/stylesheet?v=1"></link><script defer nonce="TzBGWHV6UlFEa2sxdGFsTTBkeENEaTAzVVVpQnMzS1NOc0g5QjZvL3lPbz06YVhJUitub0RYQ3hYL3ZrOWlMUnhhbjlSSGh2VHhTRFVVWXlsVU45R3BOaz0=" src="/index.php/apps/side_menu/js/script?v=1"></script>    </head>
    <body id="body-login">
        <noscript>
    <div id="nojavascript">
        <div>
            This application requires JavaScript for correct operation. Please <a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">enable JavaScript</a> and reload the page.        </div>
    </div>
</noscript>
                    <input type="hidden" id="initial-state-core-versionHash" value="IjBjNjEzMzdhIg==">
                    <input type="hidden" id="initial-state-comments-maxAutoCompleteResults" value="MTA=">
                <div class="wrapper">
            <div class="v-align">
                                    <header role="banner">
                        <div id="header">
                            <div class="logo"></div>
                        </div>
                    </header>
                                <main>
                    <h1 class="hidden-visually">
                        Generico Cloud                  </h1>
                    <div class="guest-box wide">
    <h2>Internal Server Error</h2>
    <p>The server was unable to complete your request.</p>
    <p>If this happens again, please send the technical details below to the server administrator.</p>
    <p>More details can be found in the server log.</p>

    <h3>Technical details</h3>
    <ul>
        <li>Remote Address: 64.227.0.5</li>
        <li>Request ID: UEAxYa4WsqJoHaHyAX2b</li>
            </ul>

    </div>
                </main>
            </div>
        </div>
        <footer role="contentinfo" class="guest-box">
            <p class="info">
                <a href="https://genericoep.com" target="_blank" rel="noreferrer noopener" class="entity-name">Generico Cloud</a> – a safe home for all your data           </p>
        </footer>
    </body>
</html>
]
    at it.niedermann.nextcloud.deck.remote.api.RequestHelper$ResponseConsumer.buildCause(RequestHelper.java:68)
    ... 4 more
desperateCoder commented 8 months ago

Well, thats quite interesting. We're requesting /index.php/apps/deck/api/v1.1/boards/8/stacks/32/cards/1737 and get a 500 HTML page as response?! This is most likely a server configuration thing.

Can you see anything in the logs with the following Request-ID (mentioned on the http error page)?

Request ID: UEAxYa4WsqJoHaHyAX2b

Gobytego commented 8 months ago

yeah nothing in the logs with that request id

desperateCoder commented 8 months ago

As you can see here the URL is constructed correctly and there is nothing i can or should change to this request. Something is behaving really weird in your setup.

Gobytego commented 8 months ago

maybe im looking in the wrong place for the logs? i'm just using the built in nextcloud logging in admin settings...

Gobytego commented 8 months ago

maybe it has something to do with the snap version of nextcloud?