Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to synchronize: cryptic "duplicate key" error #1313

Closed
glenux opened this issue Aug 5, 2021 · 1 comment
Closed

Unable to synchronize: cryptic "duplicate key" error #1313

glenux opened this issue Aug 5, 2021 · 1 comment

Comments

@glenux
Copy link

glenux commented Aug 5, 2021

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!

Bug description

Since a few weeks, NextCloud Notes is unable to synchronize with my Nextcloud instance.

It fails with the "synchronization error message". The explanation is useless to find which note name should be fixed.

To Reproduce

The bug occured after I created a huge amount of notes, both from the smartphone and computer (around ~3000 notes), but i think creating a few notes both on smartphone & nextcloud instance should suffice.

The important thing is use similar titles to deliberately create name conflicts.

The note names were either normal text (for those created from the nextcloud instance, or from vim) and markdown links syntax for the notes created from "Share to... New note" in Android

Expected behavior

Nextcloud Notes should either :

  • display an error message explaining which notes are conflicting on either sides
  • rename the notes before downloading/uploading them

Screenshots

image

image

Smartphone:

OS Version: 4.4.111-15668094(G950FXXU4DSCB)
OS API Level: 28
Device: dreamlte
Manufacturer: samsung
Model (and Product): SM-G950F (dreamltexx)

Nextcloud Notes App

  • App Version: 3.4.11
  • App Version Code: 3004011
  • App Flavor: fdroid

Server

  • Files App Version Code: 30160190

Stacktrace


---

java.lang.IllegalStateException: Duplicate key 2505
	at j$.util.stream.-$$Lambda$Collectors$JCCUtBO-OYI_1WWo2UbajAktswI.apply(lambda:2)
	at j$.util.Map$-CC.$default$merge(Map.java:4)
	at j$.util.Map$-EL.merge(Map.java:9)
	at j$.util.stream.-$$Lambda$Collectors$vfQF-JJDCen_YKtRfgvkyywVMHc.accept(lambda:4)
	at j$.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:1)
	at j$.util.Iterator$-CC.$default$forEachRemaining(Iterator.java:3)
	at j$.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:5)
	at j$.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:6)
	at j$.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:3)
	at j$.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:5)
	at j$.util.stream.ReferencePipeline.collect(ReferencePipeline.java:17)
	at it.niedermann.owncloud.notes.persistence.NotesRepository.getIdMap(NotesRepository.java:428)
	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:459)
	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:764)

@stefan-niedermann
Copy link
Member

Dear @glenux

thanks for the detailed bug report.

display an error message explaining which notes are conflicting on either sides
rename the notes before downloading/uploading them

Renaming of the notes before down/uploading already happens. In your case there are not conflicts between client and server though, but within the Android app due to a bug of previous versions.
I just wrote a description about this error, please follow the instructions there.

Since you have a large amount of notes, please note that the initial sync might fail with a timeout. To prevent this, i recommend you to move the Notes to another folder and put them back step by step and synchronize between doing so.

Sorry for the inconveniences and good luck - just comment here if further trouble occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants