mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 09:46:00 +03:00
[GH-ISSUE #1200] Building Binary First Start MariaDB Error #846
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#846
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @r4tze on GitHub (Oct 26, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1200
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@BlackDex commented on GitHub (Oct 26, 2020):
This could be a collation issue. Please check which charset is used by default for the database.
@r4tze commented on GitHub (Oct 27, 2020):
I created the Database with these charset:
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ciShould I use UTF-8? I did not find any charset information in the wiki.
@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.
@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!
@jjlin commented on GitHub (Oct 27, 2020):
It would probably be better to just replace
VARCHAR(255)for storing email addresses withVARCHAR(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.