Building Binary First Start MariaDB Error #843

Closed
opened 2026-02-04 22:59:15 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @r4tze on GitHub (Oct 26, 2020).

Subject of the issue

Fresh compiled executable of Bitwarden_rs does not start, does not initialize the database

Your environment

Bitwarden_rs version: Version 1.17.0
Install method: build from source
Clients used: web
Reverse proxy and version: no
Version of mysql/postgresql: MariaDB 10.4.14
Other relevant information:

Steps to reproduce

Created a database, compiled the bitwarde_rs mySQL Binary, configured the mysql connection string in the .env file, start the bitwarden_rs executable

Expected behaviour

A running bitwarden_rs

Actual behaviour

Got error

Executing migration script 20180114171611/up.sql [2020-10-26 17:54:46.480][bitwarden_rs][ERROR] Error creating database pool: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Specified key was too long; max key length is 767 bytes",

Relevant logs


More Information

I created the database as described in the wiki. I also tried to change the sql table rows to dynamic length, but as I can see there is only one table:
__diesel_schema_migrations

Originally created by @r4tze on GitHub (Oct 26, 2020). # Subject of the issue Fresh compiled executable of Bitwarden_rs does not start, does not initialize the database # Your environment Bitwarden_rs version: Version 1.17.0 Install method: build from source Clients used: web Reverse proxy and version: no Version of mysql/postgresql: MariaDB 10.4.14 Other relevant information: # Steps to reproduce Created a database, compiled the bitwarde_rs mySQL Binary, configured the mysql connection string in the .env file, start the bitwarden_rs executable # Expected behaviour A running bitwarden_rs # Actual behaviour # Got error `Executing migration script 20180114171611/up.sql [2020-10-26 17:54:46.480][bitwarden_rs][ERROR] Error creating database pool: DieselMigError. [CAUSE] QueryError( DatabaseError( __Unknown, "Specified key was too long; max key length is 767 bytes",` # Relevant logs --- # More Information I created the database as described in the wiki. I also tried to change the sql table rows to dynamic length, but as I can see there is only one table: `__diesel_schema_migrations `
OVERLORD added the better for forum label 2026-02-04 22:59:15 +03:00
Author
Owner

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

This could be a collation issue. Please check which charset is used by default for the database.

@BlackDex commented on GitHub (Oct 26, 2020): This could be a collation issue. Please check which charset is used by default for the database.
Author
Owner

@r4tze commented on GitHub (Oct 27, 2020):

I created the Database with these charset:
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci

Should I use UTF-8? I did not find any charset information in the wiki.

@r4tze commented on GitHub (Oct 27, 2020): I created the Database with these charset: `DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci` Should I use UTF-8? I did not find any charset information in the wiki.
Author
Owner

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

Yes you need utf8 which is an alias for utf8mb3.
Using utf8mb4 limits the size to 767. This is an innodb limitation.

@BlackDex commented on GitHub (Oct 27, 2020): Yes you need utf8 which is an alias for utf8mb3. Using utf8mb4 limits the size to 767. This is an innodb limitation.
Author
Owner

@r4tze commented on GitHub (Oct 27, 2020):

Okay, this solved the issue!
ALTER DATABASE BitwardenDB CHARACTER SET='utf8' COLLATE='utf8_bin'
Thanks for the help!

@r4tze commented on GitHub (Oct 27, 2020): Okay, this solved the issue! `ALTER DATABASE BitwardenDB CHARACTER SET='utf8' COLLATE='utf8_bin'` Thanks for the help!
Author
Owner

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

It would probably be better to just replace VARCHAR(255) for storing email addresses with VARCHAR(191) or smaller to avoid this issue. The RFCs specify that an email address can be up to 320 bytes, so the choice of 255 isn't even for RFC conformance.

@jjlin commented on GitHub (Oct 27, 2020): It would probably be better to just replace `VARCHAR(255)` for storing email addresses with `VARCHAR(191)` or smaller to avoid this issue. The RFCs specify that an email address can be up to 320 bytes, so the choice of 255 isn't even for RFC conformance.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#843