Database migration fail from 1.28 to 1.29 : Can't create table organization_api_key #1337

Closed
opened 2026-04-06 01:45:56 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jean-io on 11/28/2023

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 11/28/2023* 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.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#1337