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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Bug report) UNIQUE constraint failure on upgrade to DB version 212 #3526
Comments
Hi, I think I know what could cause this. I'm going to release a new patch version soon, hang on. Sorry for the trouble. |
Hey, thanks for looking into this so quickly! Absolutely no rush though -- this is an amazing piece of FOSS software, and goodness knows it must take up enough of your time without adding in instant support! :) Still getting the same error with 0.58.5 unfortunately -- tried migrating from a known-working version of the database but getting the exact same output I'm afraid. |
The release timing was just a coincidence. I will try to investigate some more what could be causing this ... |
Ah, gotcha! Apologies, misunderstanding on my part :) Slight update -- I found a bunch nodes related to the new launcher that slipped through into the bottom of the tree in my v197 DB. Deleting those allowed for an update to v198 using
At a guess a similar issue but for a different table? Your |
One way to fix this would be to The other option is to create an anonymized database and send it to me to zadam.apps@gmail.com - I should be able then to fix the migration. |
Aha, thanks! Tried that. It gets past 198 and fails on 199. Same UNIQUE constraint issue, this time on
I can drop an anonymised database over to you if you would like? |
Yes please, that would be the best. Please send it to zadam.apps@gmail.com |
Sent :) |
Hello, I have the very same issue here, trying to upgrade from 0.53.2 to 0.60.4 fails at migration step 198 with Checking table For instance, checking why
Hence the UNIQUE constraint violation... I tried to delete the rows "after migration" so migration step 198 completed but then it failed at step 199 again for another UNIQUE constraint violation. As for what could have been caused this, my setup has 2 desktop installs (one on PC and one on Mac) and one Docker sync server. I started by upgrading the desktop versions which went well and the issue seemingly appeared when upgrading the Docker server. Could it be that "old rows" had been synced by the old server to the new desktop installs, hence the mix of "old" and "new" rows ? Supporting this hypothesis is that I have seen some rows in table attributes with deleteId How could I solve this issue ? I was thinking of starting with a fresh 0.60.4 and exporting all notes from 0.53.2 and then importing into 0.60.4, could this work or is there a better solution ? |
I wouldn't say so. When there are incompatible DB changes made, the sync protocol version get also incremented which will then mean that the sync will be refused (sync protocol has to be the same on both sides).
I think that would be the best & easiest solution. Export all notes with ZIP + HTML which should preserve everything except for all revisions. |
Trilium Version
0.57.5 -> 0.58.4
What operating system are you using?
Ubuntu
What is your setup?
Local + server sync
Operating System Version
Ubuntu 20.04.4 LTS (Docker Server)
Description
Getting an SQLite UNIQUE constraint failure when updating from 0.57.5 (Docker image tag
0.57-latest
db version 197), to 0.58.4 (0.58-latest
, db version 212). Trilium server is deployed containerised (Docker Compose alongside a backup container) and produces the error trace below when switching to the new container.I haven't seen anyone else with issues here, so I suspect this might be an edge case with my specific DB, but any help with tracking down where the
branchId
conflict is, and what has caused this, would be appreciated :)Error logs
Posting the Docker Compose log as it is a lot more verbose than the output in the latest log file which just shows the server restarting with no error messages. Can provide that if requested :)
The text was updated successfully, but these errors were encountered: