Timshel/vaultwarden

MySQL DataBase error - Unknown, "BLOB/TEXT column 'identifier' used in key specification without a key length"

rgruenewald opened this issue · 3 comments

Subject of the issue

Deployment environment

  • vaultwarden version: 1.30.5-6

  • Install method: docker compose

  • MySQL/MariaDB or PostgreSQL version: MySQL 8.3.0

  • Other relevant details: clean install without any data

Steps to reproduce

  1. setup docker compose with "image: mysql:latest" and "image: timshel/vaultwarden:latest"

environment variables:
- DOMAIN=https://xyz
- LOGIN_RATELIMIT_MAX_BURST=10
- LOGIN_RATELIMIT_SECONDS=60
- ADMIN_RATELIMIT_MAX_BURST=10
- ADMIN_RATELIMIT_SECONDS=60
- ADMIN_TOKEN=xyz
- SENDS_ALLOWED=true
- EMERGENCY_ACCESS_ALLOWED=true
- WEB_VAULT_ENABLED=true
- SMTP_HOST=xyz
- SMTP_FROM=xyz
- SMTP_FROM_NAME=xyz
- SMTP_PORT=465
- SMTP_USERNAME=xyz
- SMTP_PASSWORD=xyz
- SMTP_AUTH_MECHANISM=Plain
- SMTP_SECURITY=force_tls
- ORG_GROUPS_ENABLED=true
- SSO_ORGANIZATIONS_INVITE=true
- SSO_ENABLED=true
- SSO_ONLY=true
- SSO_CLIENT_ID=xyz
- SSO_CLIENT_SECRET=xyz
- SSO_AUTHORITY=xyz
- SSO_FRONTEND="override"
- SSO_ROLES_ENEABLED=true
- SSO_ROLES_DEFAULT_TO_USER=true
- SSO_ROLES_TOKEN_PATH=/roles
- DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@db/${MYSQL_DATABASE}
- RUST_BACKTRACE=1

Expected behaviour

Server should start but it doesn't.

Actual behaviour

container start fails with: [2024-03-31 22:17:22.958][panic][ERROR] thread 'main' panicked at 'Error running migrations: QueryError(DieselMigrationName { name: "2024-03-06-170000_add_sso_users", version: MigrationVersion("20240306170000") }, DatabaseError(Unknown, "BLOB/TEXT column 'identifier' used in key specification without a key length"))': src/db/mod.rs:473

Server starts fine when using SQLite instead of MySQL. For MySQL at least some tables in the database are created.

Hey,
Forgot that TEXT index was specific to MariaDB (> 10.4).
Will fix it, but you can switch to MariaDB in the meantime.

1.30.5-7 should be available and fix the issue.

Thanks a lot for the quick fix. It works perfectly. 👍