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
"Duplicate Key 38" Keeps happening #1281
Comments
sigh.... i believe we have a race condition in the latest releases, which causes multiple sync processes to run parallel and eventually inserting the same fetched note multiple times into the database of the Notes Android app. Your upgrade to NC 21 is coincidence and does not cause this error. @korelstar maybe, if you have some time, could you try to help me looking for the cause here? I already tried to ensure that no syncs happen in parallel by making the |
@stefan-niedermann Are you able to reproduce that multiple synchronizations are executed in parallel? Or is it just an assumption? I had a quick look on the code and found that |
It is an assumption, i haven't been able to reproduce the issue myself, but it was reported multiple times in the past weeks. Though the |
@Prog1563 since you have experienced this issue already multiple times: Can you tell us more about the circumstances maybe? Did this happen after editing / adding a note or also when you only viewed the list? |
That's not true. You are using it in the inner anonymous class of type |
Unfortunately I don't have reliable steps to reproduce. I don't access my notes often but this seems to happen only after a while of leaving the app untouched. As for when it happens: Right after opening the app before trying to edit or view. |
While this is correct, the I changed the implementation from |
That's not true.
According to the docs, you can't rely on this:
But nevertheless, I also think that it's unlikely, that this problem was the source. But maybe there are other places with wrong assumptions about |
Oh man... how could i miss that? Maybe using another |
Use SingleThreadExecutor for performing remote synchronization tasks Signed-off-by: Stefan Niedermann <info@niedermann.it>
@Prog1563 can you please update to |
@stefan-niedermann Updating now from F-Droid. I'll let you know what happens :) |
I ended up having the same sort of issue. The problems comes, at least for me, I think, when I share content to a note. Then I switch back to another app I was in, to copy/paste more material. As you mentioned, the Note app creates multiple notes every time I switched back and forth. So, I went into my database and saw that I had thousands of File_lock entries. Put the instance into maintenance and deleted them all from the database. Then, on the admin account, checked the logs, it gave me the exact files that were the culprits. Back on the user account, on the PC File app, I found the files in question, in my case there were about 5 or 6. Deleted those. Clean cache on app, resynchronized and no more errors. |
@daffydock and can you please tell us if this happened on |
I was on the previous Ver. But updated because I was hoping the update would clear it. So I did. It did not fix the issue, per s茅. Then I applied my fix and it worked. Have not tried going back and forth between two apps since. So, still no errors. Thus, I do not know if the update did anything -- alas, for perhaps stopping it from happening again? But I am not sure. Since the error was already there before I did the update. Also, for the time being, I have left my file.lock option on the Nextcloud config file as disabled. For now. Until I hear what others add to this topic. |
Exactly this. The update tp Version |
Sorry for the late reply. I think using |
Closing this issue as two weeks have passed since the update and no further error has been reported so far. Please feel free to reopen this issue or create a new one if the problem occurs again. |
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
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Notes sync and load like normal
Smartphone (please complete the following information):
Server
Stacktrace
I have cleared the app's data a few times and have logged out and back in, that usually gets it working again, but this issue persists. Only started happening after we upgraded to NC 21 accidentally because the updater said we were upgrading to 20.0.9
The text was updated successfully, but these errors were encountered: