Migration panics when upgrading to 1.30.0 #649

Closed
opened 2025-10-09 16:43:46 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @PaoloAngiolillo on GitHub.

Subject of the issue

Deployment environment

  • vaultwarden version: 1.30.0
  • Install method: Kubernetes

  • MySQL/MariaDB or PostgreSQL version: MariaDB

Steps to reproduce

upgrade the version to 1.30.0 and start the new container.

Expected behaviour

i expect the container to start up properly with the migrations working.

Actual behaviour

the Pod is not starting because of a migration error.

Troubleshooting data

[2023-11-13 15:00:22.599][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 `acc_bitwarden_01`.`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: rocket::async_main
  11: vaultwarden::main
  12: std::sys_common::backtrace::__rust_begin_short_backtrace
  13: std::rt::lang_start::{{closure}}
  14: std::rt::lang_start_internal
  15: main
  16: <unknown>
  17: __libc_start_main
  18: _start
Originally created by @PaoloAngiolillo on GitHub. <!-- # ### NOTE: Please update to the latest version of vaultwarden before reporting an issue! This saves you and us a lot of time and troubleshooting. See: * https://github.com/dani-garcia/vaultwarden/issues/1180 * https://github.com/dani-garcia/vaultwarden/wiki/Updating-the-vaultwarden-image # ### --> <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unnecessary for your issue, feel free to remove them. Remember to hide/redact personal or confidential information, such as passwords, IP addresses, and DNS names as appropriate. --> ### Subject of the issue <!-- Describe your issue here. --> ### Deployment environment <!-- ========================================================================================= Preferably, use the `Generate Support String` button on the admin page's Diagnostics tab. That will auto-generate most of the info requested in this section. ========================================================================================= --> <!-- The version number, obtained from the logs (at startup) or the admin diagnostics page --> <!-- This is NOT the version number shown on the web vault, which is versioned separately from vaultwarden --> <!-- Remember to check if your issue exists on the latest version first! --> * vaultwarden version: 1.30.0 <!-- How the server was installed: Docker image, OS package, built from source, etc. --> * Install method: Kubernetes * MySQL/MariaDB or PostgreSQL version: <!-- if applicable --> MariaDB ### Steps to reproduce <!-- Tell us how to reproduce this issue. What parameters did you set (differently from the defaults) and how did you start vaultwarden? --> upgrade the version to 1.30.0 and start the new container. ### Expected behaviour <!-- Tell us what you expected to happen --> i expect the container to start up properly with the migrations working. ### Actual behaviour <!-- Tell us what actually happened --> the Pod is not starting because of a migration error. ### Troubleshooting data <!-- Share any log files, screenshots, or other relevant troubleshooting data --> ``` [2023-11-13 15:00:22.599][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 `acc_bitwarden_01`.`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: rocket::async_main 11: vaultwarden::main 12: std::sys_common::backtrace::__rust_begin_short_backtrace 13: std::rt::lang_start::{{closure}} 14: std::rt::lang_start_internal 15: main 16: <unknown> 17: __libc_start_main 18: _start ```
Author
Owner

@PaoloAngiolillo commented on GitHub:

Found the issue, i had to change some database collations

@PaoloAngiolillo commented on GitHub: Found the issue, i had to change some database collations
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#649