Getting `Index column size too large.` on initial migrations

I’ve just installed metabase and pointed it to my Aurora Serverless cluster.

On startup, I see these errors in the logs:

06-03 17:52:19 e[1mERROR changelog.ChangeSete[0m :: Change Set migrations/000_migrations.yaml::1::agilliland failed.  Error: (conn=11) Index column size too large. The maximum column size is 767 bytes. [Failed SQL: CREATE TABLE `metabase`.`core_organization` (`id` INT AUTO_INCREMENT NOT NULL, `slug` VARCHAR(254) NOT NULL, `name` VARCHAR(254) NOT NULL, `description` TEXT NULL, `logo_url` VARCHAR(254) NULL, `inherits` BIT(1) NOT NULL, CONSTRAINT `PK_CORE_ORGANIZATION` PRIMARY KEY (`id`), UNIQUE (`slug`)) ENGINE InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci]

My db cluster param group has the following parameters set which I thought would solve this issue.

parameter {
    name   = "innodb_file_format"
    value = "Barracuda"
    apply_method = "pending-reboot"
  }
  parameter {
    name   = "innodb_file_per_table"
    value = "1"
    apply_method = "pending-reboot"
  }
  
  parameter {
    name  = "innodb_large_prefix"
    value = "1"
  }
  parameter {
    name  = "character_set_client"
    value = "utf8mb4"
  }

  parameter {
    name  = "character_set_connection"
    value = "utf8mb4"
  }

  parameter {
    name  = "character_set_database"
    value = "utf8mb4"
  }

  parameter {
    name  = "character_set_server"
    value = "utf8mb4"
  }

  parameter {
    name  = "collation_connection"
    value = "utf8mb4_unicode_ci"
  }

  parameter {
    name  = "collation_server"
    value = "utf8mb4_unicode_ci"
  }

Any help?

Hi @mustafashabib
Try starting Metabase with this command (where you’ve already defined the MB_DB_* environment variables):

java -jar metabase.jar migrate print

Which will show all the SQL instead of automatically doing the setup for you. Then change all lines with CREATE TABLE ... ; so they end with ROW_FORMAT=DYNAMIC; and insert that modified SQL manually in Aurora.

Then try starting Metabase regularly. Looks like Aurora is using some highly modified version of MySQL 5.6, which is probably also going to cause problems with utf8mb4, but you’ll have to see about that.

Thanks - I ended up just using a db_instance and running mySql 5.7 and things are working fine now.

1 Like