Migration failed: Error 1071 #435

Closed
opened 2020-04-23 19:58:16 +00:00 by Subcala · 4 comments

I am using mysql db on another server. Vikunja deb and docker frontend.

when i manually run $ vikunja , i get the following error.

2020-04-23T15:30:40.279435836Z: CRITICAL	▶ migration/Migrate 001 Migration failed: Error 1071: Specified key was too long; max key length is 767 bytes
Migration failed: Error 1071: Specified key was too long; max key length is 767 bytes

Here is my db config below

database:
  **# Database type to use. Supported types** are mysql, postgres and sqlite.
  type: "mysql"
  **# Database user which is used to connect to the database.**
  user: "vikunja"
  **# Databse password**
  password: "vikpassword"
  **# Databse host**
  host: "192.168.100.220:3306"
  **# Database to use**
  database: "vikunjadb"
 ** # When using sqlite, this is the path where to store the data
**#  Path: "/opt/vikunja/vikunja.db"
  **# Sets the max open connections to the database. Only used when using mysql and postgres.**
  maxopenconnections: 100
**  # Sets the maximum number of idle connections to the db.**
  maxidleconnections: 50
 ** # The maximum lifetime of a single db connection in miliseconds.**
  maxconnectionlifetime: 10000
  **# Secure connection mode. Only used with postgres.
**  # (see https://pkg.go.dev/github.com/lib/pq?tab=doc#hdr-Connection_String_Parameters)**
  sslmode: disable**
I am using mysql db on another server. Vikunja deb and docker frontend. when i manually run $ vikunja , i get the following error. ```Initializing Schema 2020-04-23T15:30:40.279435836Z: CRITICAL ▶ migration/Migrate 001 Migration failed: Error 1071: Specified key was too long; max key length is 767 bytes Migration failed: Error 1071: Specified key was too long; max key length is 767 bytes ``` Here is my db config below ``` database: **# Database type to use. Supported types** are mysql, postgres and sqlite. type: "mysql" **# Database user which is used to connect to the database.** user: "vikunja" **# Databse password** password: "vikpassword" **# Databse host** host: "192.168.100.220:3306" **# Database to use** database: "vikunjadb" ** # When using sqlite, this is the path where to store the data **# Path: "/opt/vikunja/vikunja.db" **# Sets the max open connections to the database. Only used when using mysql and postgres.** maxopenconnections: 100 ** # Sets the maximum number of idle connections to the db.** maxidleconnections: 50 ** # The maximum lifetime of a single db connection in miliseconds.** maxconnectionlifetime: 10000 **# Secure connection mode. Only used with postgres. ** # (see https://pkg.go.dev/github.com/lib/pq?tab=doc#hdr-Connection_String_Parameters)** sslmode: disable** ```
Owner

That looks like a db issue. What database version are you using?

Could you post the content of the migration table? (select * from migration).
That way we can see what migration it is trying to run.

Maybe unrelated, but what is the collation of the database?

And on a side note, why are you running part of Vikunja on a seperate server, part of it in docker and part of it as deb package? Wouldn't it be easier to just run everything in docker or native?

That looks like a db issue. What database version are you using? Could you post the content of the migration table? (`select * from migration`). That way we can see what migration it is trying to run. Maybe unrelated, but what is the collation of the database? And on a side note, why are you running part of Vikunja on a seperate server, part of it in docker and part of it as deb package? Wouldn't it be easier to just run everything in docker or native?
Author

Here is mysql server version. I have a central db server & Vikunja on it's own server
Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

currently the migration is empty
Empty set (0.00 sec)

Here is the tableset

+---------------------+
| Tables_in_vikunjadb |
+---------------------+
| files               |
| label_task          |
| labels              |
| link_sharing        |
| list                |
| migration           |
| migration_status    |
| namespaces          |
| task_assignees      |
| task_attachments    |
| task_comments       |
| task_relations      |
| task_reminders      |
| tasks               |
| team_list           |
| team_members        |
| team_namespaces     |
| teams               |
| users               |
| users_list          |
| users_namespace     |
+---------------------+

I havent had great luck getting vikunja api to run in docker, so i opted for the deb package for now.

If you feel its purely a db issue, then we can probably close this issue as I need teach myself some more mysql lol

Here is mysql server version. I have a central db server & Vikunja on it's own server Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04 currently the migration is empty `Empty set (0.00 sec)` Here is the tableset ``` +---------------------+ | Tables_in_vikunjadb | +---------------------+ | files | | label_task | | labels | | link_sharing | | list | | migration | | migration_status | | namespaces | | task_assignees | | task_attachments | | task_comments | | task_relations | | task_reminders | | tasks | | team_list | | team_members | | team_namespaces | | teams | | users | | users_list | | users_namespace | +---------------------+ ``` I havent had great luck getting vikunja api to run in docker, so i opted for the deb package for now. If you feel its purely a db issue, then we can probably close this issue as I need teach myself some more mysql lol
Owner

This stackoverflow question suggests the issue comes from mysql max varchar length is too small. The task description field in vikunja was a varchar(1000) which has been changed in a migration.

You could try to upgrade that limit (Not sure how that's possible though).

I'm also suspecting a "wrong" encoding, try setting it to utf8mb4.

What issues did you have when trying to run Vikunja in docker?

[This stackoverflow question](https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes) suggests the issue comes from mysql max varchar length is too small. The task description field in vikunja was a `varchar(1000)` which has been changed in a migration. You could try to upgrade that limit (Not sure how that's possible though). I'm also suspecting a "wrong" encoding, try setting it to `utf8mb4`. What issues did you have when trying to run Vikunja in docker?
Owner

Closing due to inactivity, feel free to reopen if the issue persists.

Closing due to inactivity, feel free to reopen if the issue persists.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#435
No description provided.