Plesk upgrade fails: Specified key was too long

Created:

2016-12-12 03:48:38 UTC

Modified:

2017-08-16 17:26:27 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Plesk upgrade fails: Specified key was too long

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

Plesk upgrade fails with the error message:

===> Preparing Plesk database upgrade (revertable stage).
ERROR 1071 (42000) at line 1: Specified key was too long; max key length is 1000 bytes
....
ERROR while trying to execute SQL query, the query was: ALTER TABLE `APSLicenseTypes` CHANGE `application_name` `application_name` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
Check the error reason(see log file: /var/log/plesk/install/plesk_12.5.30_installation.log), fix and try again
Error: An error occurred during performing of installation PREP actions (see log for details). Installation was rolled back.

Cause

The table APSLicenseTypes is corrupted.

Resolution

  1. Create a backup of the psa database:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin psa > /root/psa_backup.sql
  2. Enter the psa database:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa
  3. Remove the table APSLicenseTypes :

    mysql> DROP TABLE APSLicenseTypes;
  4. Recreate the table with the following query:

    musql> CREATE TABLE `APSLicenseTypes` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT,`application_name` varchar(255) NOT NULL, `application_versions` varchar(255) NOT NULL, `application_features` varchar(255) NOT NULL, `description` varchar(255) DEFAULT NULL,  `license_type_hash` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `application_name` (`application_name`,`application_versions`,`application_features`), UNIQUE KEY `license_type_hash` (`license_type_hash`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  5. Perform the upgrade again

Have more questions? Submit a request
Please sign in to leave a comment.