Update #7309 Failed: PDOException: SQLSTATE[42000]

Created on 1 January 2023, almost 2 years ago
Updated 18 July 2023, over 1 year ago

Problem/Motivation

Upgraded to 3.11: "The following updates returned messages panels module
Update #7309
Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: ALTER TABLE {panels_allowed_types} ADD PRIMARY KEY (`module`, `type`); Array ( ) in db_add_primary_key() (linea 3027 di /web/htdocs/www.istitutosantelia.edu.it/home/includes/database/database.inc)."

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

3.11

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy nessunluogo Tremestieri Etneo (CT)

    I have the same issue running db updates after upgrading to 7.x-3.11.

    I tried changing MySQL DB version 5.7 in my containered development environment, but didn't solve.

    Following some answers of this StackOverflow question, I tried changing the table engine from MyISAM to InnoDB and this worked for me.

    The query you can run it on phpMyAdmin or any other SQL client:

    ALTER TABLE `panels_allowed_types` ENGINE=InnoDB;

    If you use a prefix, add it to the table name or just get it from the error message.

    Of course, you need to run the Drupal DB Update again.

  • 🇵🇭Philippines jaesperanza

    This fixed the problem for me for the same error on an old D7 website. Thanks, @nessunluogo

Production build 0.71.5 2024