kolide / fleet

A flexible control server for osquery fleets
https://kolide.com/fleet
MIT License
1.1k stars 261 forks source link

Some MySQL configurations are not compatible with the initial database schema. #1662

Open m6a-UdS opened 6 years ago

m6a-UdS commented 6 years ago

What version of fleet are you using (fleet version --full)?

docker run kolide/fleet fleet version --full
fleet - version 1.0.6
  branch:   master
  revision:     45165aa29aae52346ed1c458f19b89947d315c61
  build date:   2017-12-04T22:52:42Z
  build user:   marpaia
  go version:   go1.9.2

What operating system are you using?

The kolide/fleet docker container from DockerHub (Alpine)

What did you do?

Initialize a database using a default/empty MySQL AWS RDS (instance class db.t2.micro).

What did you expect to see?

The database getting initialized.

What did you see instead?

An error message: Error 1071: Specified key was too long; max key length is 767 bytes), quitting migration.

A general solution for users getting this problem is to activate innodb-large-prefix and set innodb_file_format to Barracuda. A work-around if you are not admin on your database server is to dump the initial database from a working initial installation, replace all utf8mb4 tables for utf8 and restore it to the destination server. It did work for me, but I would not recommend since this method has not been tested properly.

This limitation might not need any fix, but could be documented.

monkykap commented 6 years ago

users might need to throw in innodb_default_row_format (supported starting 5.7.9). I am using:

containers:

tpyo commented 6 years ago

This could probably be avoided if the database is created with a default character set: CREATE DATABASE kolide CHARACTER SET utf8 COLLATE utf8_general_ci;

Alternatively migrations could include character set and collation in CREATE TABLE statements.