[GH-ISSUE #4115] Database migration fail from 1.28 to 1.29 : Can't create table organization_api_key #10599

Closed
opened 2026-04-20 14:02:31 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @jean-io on GitHub (Nov 28, 2023).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/4115

Hello team, I have a bug when I upgrade my docker container from 1.28 to 1.29:

[2023-11-28 14:18:32.424][panic][ERROR] thread 'main' panicked at 'Error running migrations: QueryError(DieselMigrationName { name: "2023-06-02-200424_create_organization_api_key", version: MigrationVersion("20230602200424") }, DatabaseError(Unknown, "Can't create table `xxxx`.`organization_api_key` (errno: 150 \"Foreign key constraint is incorrectly formed\")"))': src/db/mod.rs:471
   0: vaultwarden::init_logging::{{closure}}
   1: std::panicking::rust_panic_with_hook
   2: std::panicking::begin_panic_handler::{{closure}}
   3: std::sys_common::backtrace::__rust_end_short_backtrace
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::result::unwrap_failed
   7: vaultwarden::db::mysql_migrations::run_migrations
   8: vaultwarden::db::DbPool::from_config
   9: vaultwarden::main::{{closure}}
  10: tokio::runtime::park::CachedParkThread::block_on
  11: tokio::runtime::context::runtime::enter_runtime
  12: tokio::runtime::runtime::Runtime::block_on
  13: rocket::async_main
  14: vaultwarden::main
  15: std::sys_common::backtrace::__rust_begin_short_backtrace
  16: std::rt::lang_start::{{closure}}
  17: std::rt::lang_start_internal
  18: main
  19: __libc_start_main
  20: _start

I am stuck with this bug which prevents me from upgrading 🙄

I have also tested with 1.30 release (current release at the time of writing this issue) and the bug is still present. MariaDB is up and running, and is working fine with 1.28 release.

Originally created by @jean-io on GitHub (Nov 28, 2023). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/4115 Hello team, I have a bug when I upgrade my docker container from 1.28 to 1.29: ``` [2023-11-28 14:18:32.424][panic][ERROR] thread 'main' panicked at 'Error running migrations: QueryError(DieselMigrationName { name: "2023-06-02-200424_create_organization_api_key", version: MigrationVersion("20230602200424") }, DatabaseError(Unknown, "Can't create table `xxxx`.`organization_api_key` (errno: 150 \"Foreign key constraint is incorrectly formed\")"))': src/db/mod.rs:471 0: vaultwarden::init_logging::{{closure}} 1: std::panicking::rust_panic_with_hook 2: std::panicking::begin_panic_handler::{{closure}} 3: std::sys_common::backtrace::__rust_end_short_backtrace 4: rust_begin_unwind 5: core::panicking::panic_fmt 6: core::result::unwrap_failed 7: vaultwarden::db::mysql_migrations::run_migrations 8: vaultwarden::db::DbPool::from_config 9: vaultwarden::main::{{closure}} 10: tokio::runtime::park::CachedParkThread::block_on 11: tokio::runtime::context::runtime::enter_runtime 12: tokio::runtime::runtime::Runtime::block_on 13: rocket::async_main 14: vaultwarden::main 15: std::sys_common::backtrace::__rust_begin_short_backtrace 16: std::rt::lang_start::{{closure}} 17: std::rt::lang_start_internal 18: main 19: __libc_start_main 20: _start ``` I am stuck with this bug which prevents me from upgrading 🙄 I have also tested with 1.30 release (current release at the time of writing this issue) and the bug is still present. MariaDB is up and running, and is working fine with 1.28 release.
Author
Owner

@jean-io commented on GitHub (Nov 28, 2023):

This doc has solved my issue : https://github.com/dani-garcia/vaultwarden/wiki/Using-the-MariaDB-%28MySQL%29-Backend#foreign-key-errors-collation-and-charset

Thank @BlackDex for helping me on this 👍🏻

<!-- gh-comment-id:1829985087 --> @jean-io commented on GitHub (Nov 28, 2023): This doc has solved my issue : https://github.com/dani-garcia/vaultwarden/wiki/Using-the-MariaDB-%28MySQL%29-Backend#foreign-key-errors-collation-and-charset Thank @BlackDex for helping me on this 👍🏻
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#10599