nextcloud / notes-android

✎ Android client for Nextcloud Notes app.
https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes
GNU General Public License v3.0
921 stars 134 forks source link

Synchronization failed #1914

Open zzyzx-dc opened 11 months ago

zzyzx-dc commented 11 months ago

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

Describe the bug

Synchronization works initially, but then repeatedly fails. Rich text formatting seemed to initiate the issue, but I'm not sure.

My Nextcloud instance is up and running normally. I can access it via Android or a web browser.

To Reproduce Steps to reproduce the behavior:

  1. Attempt any sync
  2. Receive 'Synchronization failed' message.

Expected behavior Sync as any other app would.

App Version: 4.1.0
App Version Code: 40010090
App Flavor: play

Files App Version Code: 30260090 (PROD)

---

OS Version: 4.19.269-g7763b0d7bb61(2023100300)
OS API Level: 33
Device: barbet
Manufacturer: Google
Model (and Product): Pixel 5a (barbet)

---

java.lang.IllegalStateException: Duplicate key 590093 (attempted merging values 1 and 2)
    at java.util.stream.Collectors.duplicateKeyException(Collectors.java:133)
    at java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:180)
    at java.util.stream.Collectors$$ExternalSyntheticLambda39.accept(Unknown Source:6)
    at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1390)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:475)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:236)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:517)
    at it.niedermann.owncloud.notes.persistence.NotesRepository.getIdMap(NotesRepository.java:463)
    at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pullRemoteChanges(NotesServerSyncTask.java:208)
    at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:96)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:463)
    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)
randoentity commented 8 months ago

Workaround for people who have a hard time finding the FAQ (I'm not trying to be passive aggressive; just trying to be helpful): https://github.com/nextcloud/notes-android/blob/main/FAQ.md#illegalstateexception-duplicate-key

bhugh commented 7 months ago

Workaround for people who have a hard time finding the FAQ

However, note that the FAQ is discussing an issue that happened and then read fixed under version 3.x.

Whereas this issue is occurring under 4.1.0.

Not wanting to disparage a helpful reply, but I'm having the same error, also under 4.1.0, so evidently the bug that was fixed in 3.x, as described in the FAQ, has recurred in 4.1.0. Or, perhaps, a new but very similar bug has occurred.

Did anyone know a workaround other than revert to a 3.x version?

stefan-niedermann commented 7 months ago

@bhugh you are absolutely completely sure that your had the exact very same issue in version 4.x.x? Your error message contains Duplicate key?

bhugh commented 7 months ago

Yes.

On Sun, Jan 14, 2024 at 11:43 AM Niedermann IT-Dienstleistungen < @.***> wrote:

@bhugh https://github.com/bhugh you are absolutely completely sure that your had the exact very same issue in version 4.x.x? Your error message contains Duplicate key?

— Reply to this email directly, view it on GitHub https://github.com/nextcloud/notes-android/issues/1914#issuecomment-1891015652, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARW2BAGZYMCGG2ISWIT6GDYOQKMFAVCNFSM6AAAAAA5YBLGYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGAYTKNRVGI . You are receiving this because you were mentioned.Message ID: @.***>

--

Brent Hugh Executive Director Missouri Bicycle & Pedestrian Federation http://MoBikeFed.org @.*** Fax: 210-579-2265 Phone: 816-695-6736

randoentity commented 7 months ago

The workaround worked for me in version 4.1.0. I did not have to revert to a previous version. The error occurred for me about three weeks ago, so I might get the error again. It might as such be prudent to revert to 3.4.11 to check if it has really been fixed there. However, it's unclear to me how to reproduce this issue. Looking at the OP this issue occurs in version 4.1.0. I've just tried playing with the rich text editor and it isn't perfect, but hasn't caused the corruption error so far.

bhugh commented 7 months ago

Thanks.

I lost the original error message unfortunately but it's definitely 4.1.0 and had the same error as this one, Duplicate Key.

Here is the version # etc from the app I have installed:

App Version: 4.1.0 App Version Code: 40010090 App Flavor: play

Files App Version Code: 30270090 (PROD)

OS Version: 4.19.191+(ecd44) OS API Level: 31 Device: milan Manufacturer: motorola Model (and Product): moto g stylus (2022) (milan_g)

stefan-niedermann commented 7 months ago

@bhugh And did you update from an older Notes Android version or did you clear the storage of the Notes Android app as described in the FAQ (or installed the app for the very first time with 4.x?)