Page MenuHomePhabricator

Creating centralauth tables in Stretch MariaDB fails
Closed, ResolvedPublic

Description

This may be a problem in the master branch right now as well:

ERROR 1071 (42000) at line 257 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Specified key was too long; max key length is 767 bytes

Event Timeline

bd808 triaged this task as Normal priority.Dec 25 2017, 2:17 AM
bd808 created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 25 2017, 2:17 AM
$ sudo /usr/bin/mysql -qfsAe "USE centralauth; SOURCE /vagrant/mediawiki/extensions/CentralAuth/central-auth.sql;"
ERROR 1709 (HY000) at line 16 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 32 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1146 (42S02) at line 39 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Table 'centralauth.localnames' doesn't exist
ERROR 1709 (HY000) at line 94 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 95 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 96 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 97 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 105 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1146 (42S02) at line 126 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Table 'centralauth.localuser' doesn't exist
ERROR 1709 (HY000) at line 129 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1146 (42S02) at line 136 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Table 'centralauth.global_user_groups' doesn't exist
ERROR 1146 (42S02) at line 137 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Table 'centralauth.global_user_groups' doesn't exist
ERROR 1709 (HY000) at line 140 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1146 (42S02) at line 147 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Table 'centralauth.global_group_permissions' doesn't exist
ERROR 1146 (42S02) at line 148 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Table 'centralauth.global_group_permissions' doesn't exist
ERROR 1709 (HY000) at line 166 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 169 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1146 (42S02) at line 178 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Table 'centralauth.global_group_restrictions' doesn't exist
ERROR 1709 (HY000) at line 192 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 235 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 236 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 257 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.
ERROR 1709 (HY000) at line 259 in file: '/vagrant/mediawiki/extensions/CentralAuth/central-auth.sql': Index column size too large. The maximum column size is 767 bytes.

This cause of this seems to be that the default CHARSET is now utf8mb4:

(02:31) vagrant@localhost:[centralauth]> show create table globaluser\G
*************************** 1. row ***************************
       Table: globaluser
Create Table: CREATE TABLE `globaluser` (
  `gu_id` int(11) NOT NULL AUTO_INCREMENT,
  `gu_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `gu_enabled` varchar(14) NOT NULL DEFAULT '',
  `gu_enabled_method` enum('opt-in','batch','auto','admin') DEFAULT NULL,
  `gu_home_db` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NU
  `gu_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
  `gu_email_authenticated` char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DE
  `gu_salt` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `gu_password` tinyblob,
  `gu_locked` tinyint(1) NOT NULL DEFAULT '0',
  `gu_hidden` varbinary(255) NOT NULL DEFAULT '',
  `gu_registration` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAUL
  `gu_password_reset_key` tinyblob,
  `gu_password_reset_expiration` varchar(14) CHARACTER SET utf8mb4 COLLATE utf8m
  `gu_auth_token` varbinary(32) DEFAULT NULL,
  `gu_cas_token` int(10) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`gu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

On a VM running the Debian Jessie base image:

(02:32) root@localhost:[centralauth]> show create table globaluser\G
*************************** 1. row ***************************
       Table: globaluser
Create Table: CREATE TABLE `globaluser` (
  `gu_id` int(11) NOT NULL AUTO_INCREMENT,
  `gu_name` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
  `gu_enabled` varchar(14) NOT NULL DEFAULT '',
  `gu_enabled_method` enum('opt-in','batch','auto','admin') DEFAULT NULL,
  `gu_home_db` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
  `gu_email` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
  `gu_email_authenticated` char(14) CHARACTER SET latin1 COLLATE latin1_bin DEFA
  `gu_salt` varchar(16) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
  `gu_password` tinyblob,
  `gu_locked` tinyint(1) NOT NULL DEFAULT '0',
  `gu_hidden` varbinary(255) NOT NULL DEFAULT '',
  `gu_registration` varchar(14) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT
  `gu_password_reset_key` tinyblob,
  `gu_password_reset_expiration` varchar(14) CHARACTER SET latin1 COLLATE latin1
  `gu_auth_token` varbinary(32) DEFAULT NULL,
  `gu_cas_token` int(10) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`gu_id`),
  UNIQUE KEY `gu_name` (`gu_name`),
  KEY `gu_email` (`gu_email`),
  KEY `gu_locked` (`gu_name`,`gu_locked`),
  KEY `gu_hidden` (`gu_name`,`gu_hidden`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1

One way to fix this would be to set innodb_default_row_format=DYNAMIC globally. Unfortunately that setting is not available until MariaDB 10.2.2 and we have MariaDB 10.1.26. It looks like we are going to need to make some changes to the default MariaDB server config to keep things working as expected with the current scripts.

Change 400145 had a related patch set uploaded (by BryanDavis; owner: Bryan Davis):
[mediawiki/vagrant@stretch-migration] mysql: Provide default charset for MediaWiki tables

https://gerrit.wikimedia.org/r/400145

Change 400145 merged by jenkins-bot:
[mediawiki/vagrant@stretch-migration] mysql: Provide default charset for MediaWiki tables

https://gerrit.wikimedia.org/r/400145

bd808 closed this task as Resolved.Dec 25 2017, 3:47 AM