Update to 1.17.0 fails - Bitwarden RS Mysql-Backend #826

Closed
opened 2026-02-04 22:54:05 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @andrem1987 on GitHub (Oct 12, 2020).

Subject of the issue

I am using multiple instances of Bitwarden with MySQL backend. After pulling the current Image (1.17.0) the migration of the
database does not work. When pulling and running the previous image (1.16.3) back again, there are no issues.

Your environment

  • Bitwarden_rs version: 1.17.0
  • Install method: Docker
  • Reverse proxy and version: Traefik v2.3.1
  • Version of mysql/postgresql: 10.5.6+maria~focal

Steps to reproduce

Pull the Bitwarden RS MySQL-Backend 1.17.0 and run it.

Expected behaviour

The migration of the tables should run flawless.

Actual behaviour

The migration-script does not run properly and stops the migration of the database.

Relevant logs

/--------------------------------------------------------------------\
|                       Starting Bitwarden_RS                        |
|                           Version 1.17.0                           |
|--------------------------------------------------------------------|
| This is an *unofficial* Bitwarden implementation, DO NOT use the   |
| official channels to report bugs/features, regardless of client.   |
| Send usage/configuration questions or feature requests to:         |
|   https://bitwardenrs.discourse.group/                             |
| Report suspected bugs/issues in the software itself at:            |
|   https://github.com/dani-garcia/bitwarden_rs/issues/new           |
\--------------------------------------------------------------------/

[WARNING] The following environment variables are being overriden by the config file,
[WARNING] please use the admin panel to make changes to them:
[WARNING] DOMAIN, SIGNUPS_ALLOWED, ADMIN_TOKEN, SMTP_HOST, SMTP_SSL, SMTP_PORT, SMTP_FROM, SMTP_USERNAME, SMTP_PASSWORD

Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:03.473][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:04.607][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:05.740][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:06.865][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:07.982][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:09.199][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:10.323][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:11.431][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:12.606][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:13.756][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:14.898][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:16.053][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:17.340][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:18.465][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Running migration 20200802025025
Executing migration script 20200802025025/up.sql
[2020-10-11 08:11:19.590][bitwarden_rs][ERROR] Error creating database pool: DieselMigError.
[CAUSE] QueryError(
    DatabaseError(
        __Unknown,
        "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")",
    ),
)
Originally created by @andrem1987 on GitHub (Oct 12, 2020). ### Subject of the issue I am using multiple instances of Bitwarden with MySQL backend. After pulling the current Image (1.17.0) the migration of the database does not work. When pulling and running the previous image (1.16.3) back again, there are no issues. ### Your environment * Bitwarden_rs version: 1.17.0 * Install method: Docker * Reverse proxy and version: Traefik v2.3.1 * Version of mysql/postgresql: 10.5.6+maria~focal ### Steps to reproduce Pull the Bitwarden RS MySQL-Backend 1.17.0 and run it. ### Expected behaviour The migration of the tables should run flawless. ### Actual behaviour The migration-script does not run properly and stops the migration of the database. ### Relevant logs ``` /--------------------------------------------------------------------\ | Starting Bitwarden_RS | | Version 1.17.0 | |--------------------------------------------------------------------| | This is an *unofficial* Bitwarden implementation, DO NOT use the | | official channels to report bugs/features, regardless of client. | | Send usage/configuration questions or feature requests to: | | https://bitwardenrs.discourse.group/ | | Report suspected bugs/issues in the software itself at: | | https://github.com/dani-garcia/bitwarden_rs/issues/new | \--------------------------------------------------------------------/ [WARNING] The following environment variables are being overriden by the config file, [WARNING] please use the admin panel to make changes to them: [WARNING] DOMAIN, SIGNUPS_ALLOWED, ADMIN_TOKEN, SMTP_HOST, SMTP_SSL, SMTP_PORT, SMTP_FROM, SMTP_USERNAME, SMTP_PASSWORD Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:03.473][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:04.607][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:05.740][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:06.865][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:07.982][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:09.199][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:10.323][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:11.431][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:12.606][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:13.756][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:14.898][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:16.053][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:17.340][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:18.465][bitwarden_rs::util][WARN] Can't connect to database, retrying: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) Running migration 20200802025025 Executing migration script 20200802025025/up.sql [2020-10-11 08:11:19.590][bitwarden_rs][ERROR] Error creating database pool: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Can\'t create table `bitwarden`.`favorites` (errno: 150 \"Foreign key constraint is incorrectly formed\")", ), ) ```
Author
Owner

@jjlin commented on GitHub (Oct 12, 2020):

If you do a web search for that error message, most likely your bitwarden_rs tables don't have a consistent character set and/or collation. Your MySQL config may have been changed to use different defaults at some point.

@jjlin commented on GitHub (Oct 12, 2020): If you do a web search for that error message, most likely your bitwarden_rs tables don't have a consistent character set and/or collation. Your MySQL config may have been changed to use different defaults at some point.
Author
Owner

@andrem1987 commented on GitHub (Oct 12, 2020):

Well, i should have searched for this failure before i post an issue.... Thanks for your answer, that was exactly the problem.
The Database, tables and columns had a different collation in some cases. After reapplying utf8_general_ci to the database, tables and columns the update worked like a charm.

@andrem1987 commented on GitHub (Oct 12, 2020): Well, i should have searched for this failure before i post an issue.... Thanks for your answer, that was exactly the problem. The Database, tables and columns had a different collation in some cases. After reapplying `utf8_general_ci` to the database, tables and columns the update worked like a charm.
Author
Owner

@BlackDex commented on GitHub (Oct 12, 2020):

Great, i think we will add some verification/warning regarding this collation.
Already put it on the list

@BlackDex commented on GitHub (Oct 12, 2020): Great, i think we will add some verification/warning regarding this collation. Already put it on the list
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#826