mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-24 09:03:15 -05:00
[GH-ISSUE #6751] DatabaseError(Unknown, "Can't create table vaultwarden.sso_users errno: 150 Foreign key constraint is incorrectly formed
#15318
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 @skyajal on GitHub (Jan 23, 2026).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/6751
Prerequisites
Vaultwarden Support String
I have been using vaultwarden for a long time now without any issues. I recently was doing a healthcheck on my containers and noticed vaultwarden was continuously restarting. I cannot provide the diagnostics as the web interface can't load due to an error seen in the container logs:
[2026-01-23 15:19:03.518][panic][ERROR] thread 'main' panicked at 'Error running migrations: QueryError(DieselMigrationName { name: "2024-03-06-170000_add_sso_users", version: MigrationVersion("20240306170000") }, DatabaseError(Unknown, "Can't create table
vaultwarden.sso_users(errno: 150 "Foreign key constraint is incorrectly formed")"))': src/db/mod.rs:5050: vaultwarden::init_logging::{{closure}}
1: std::panicking::panic_with_hook
2: std::panicking::panic_handler::{{closure}}
3: std::sys::backtrace::__rust_end_short_backtrace
4: __rustc::rust_begin_unwind
5: core::panicking::panic_fmt
6: core::result::unwrap_failed
7: vaultwarden::db::DbPool::from_config
8: vaultwarden::main::{{closure}}
9: vaultwarden::main
10: std::sys::backtrace::__rust_begin_short_backtrace
11: main
12:
13: __libc_start_main
14: _start
How do I fix this?
Vaultwarden Build Version
1.35.2
Deployment method
Official Container Image
Custom deployment method
No response
Reverse Proxy
swag 5.2.2
Host/Server Operating System
Linux
Operating System Version
Ubuntu 24.04
Clients
Web Vault
Client Version
No response
Steps To Reproduce
This appears to be an error with the mysql command to create the sso_users table but it is malformed. No changes were made when the app was last updated from 1.35.1 to 1.35.2 other than pulling the latest image.
Expected Result
Normal operation
Actual Result
Unable to access vaultwarden completely as it's trying to perform a mysql command that is failing in the logs.
Logs
Screenshots or Videos
Additional Context
No response