mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-09 09:13:02 +03:00
Thread 'main' panicked at 'Error running migrations' #866
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kenlasko on GitHub.
Subject of the issue
Upgrading from 1.27 to 1.28, the container keeps crashing and restarting.
Deployment environment
K3S version v1.25.7+k3s1
vaultwarden version: 1.28.0
Install method:
Kubernetes install
MySQL/MariaDB or PostgreSQL version: MariaDB 10.6.12-debian-11-r6
Other relevant details:
The error points to a duplicate column name 'reset_password_key'. I can see there is a reset_password_key column in users_organizations table. It is currently NULL for all rows.
Steps to reproduce
Expected behaviour
Expect it to start up without getting into a crashloop :)
Actual behaviour
Endless crashloop
Troubleshooting data
@kenlasko commented on GitHub:
Thanks for getting back to me!
Adding the first record still results in the same failure. I then ran:
and it still fails with the same error.
I'm just running a single pod of Vaultwarden.
@BlackDex commented on GitHub:
Strange. Looks like the migration was aborted somewhere mid-way, and caused it to not update the table which stores the migrations already executed.
Please try to update that table manually by running:
That should tell the migration to skip that part, since it already exists as you mentioned.
You might also need to add
20230131222222btw. Just use the same date/time (second value), that should do the trick. But only if it fails!!@BlackDex commented on GitHub:
It does with the exact same error? Or a different one?
That is important, because else your database might not be compatible in the end.
@BlackDex commented on GitHub:
btw, you mentioned k8s/pods. Are you running multiple pods of Vaultwarden?
In that case, that is not supported, but could have caused this strange issue.
@kenlasko commented on GitHub:
Looks like the same error:
@kenlasko commented on GitHub:
Did as instructed and the pod came up without issue!
Thank you very much for the fast response. Very glad I switched from LastPass, and even happier to be running it locally!
What's interesting is that the last SQL query you had me enter was the same query that I started with. It didn't work then, but did the second time. Weird.
@BlackDex commented on GitHub:
Sorry, my bad, i pasted the wrong value.
Please remove both records you added your self. After that run the following.
So, make sure all records using
"2023-03-29 01:00:00"as a date are gone, run that query shown above, and try again.