DatabaseError(Unknown, "Can't create table vaultwarden.sso_users errno: 150 Foreign key constraint is incorrectly formed #141

Closed
opened 2026-04-05 20:32:13 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @skyajal on 1/23/2026

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:505
0: 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

Docker logs show the following as the app is not able to start.

[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:505
   0: 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: <unknown>
  13: __libc_start_main
  14: _start

Screenshots or Videos

Image

Additional Context

No response

*Originally created by @skyajal on 1/23/2026* ### Prerequisites - [x] I have searched the existing **Closed _AND_ Open** [Issues](https://github.com/dani-garcia/vaultwarden/issues?q=is%3Aissue%20) **_AND_** [Discussions](https://github.com/dani-garcia/vaultwarden/discussions?discussions_q=) - [x] I have searched and read the [documentation](https://github.com/dani-garcia/vaultwarden/wiki/) ### 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:505 0: 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: <unknown> 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 ```text Docker logs show the following as the app is not able to start. [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:505 0: 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: <unknown> 13: __libc_start_main 14: _start ``` ### Screenshots or Videos <img width="1607" height="863" alt="Image" src="https://github.com/user-attachments/assets/9e88443c-9a98-4d69-8010-265c6db0a50e" /> ### Additional Context _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#141