I've been having a hell of a time deploying one of my sites running panelizer-7.x-3.0-rc1. The module is working great on @dev (in fact, it's awesome), I just can't deploy the site to my production server — specifically I can't deploy the DB.
I get the following error when I try to run drush sql-sync @dev @prod
ERROR 1071 (42000) at line 7185: Specified key was too long; max key length is 1000 bytes
When I try to manually import the DB from @dev, I get the following slightly more informative error:
SQL query:
CREATE TABLE `panelizer_entity` ( `entity_type` varchar(255) NOT NULL COMMENT 'The type of the entity this panel is attached to.', `entity_id` int(11) NOT NULL DEFAULT '0' COMMENT 'The entity ID this panel is attached to.', `revision_id` int(10) unsigned NOT NULL COMMENT 'The revision id of the entity.', `name` varchar(255) DEFAULT NULL COMMENT 'The name of the default being used if there is one.', `no_blocks` tinyint(4) DEFAULT '0' COMMENT 'Whether or not the node disable sidebar blocks.', `css_id` varchar(255) DEFAULT '' COMMENT 'The CSS ID this panel should use.', `css` longtext COMMENT 'Any CSS the author provided for the panel.', `pipeline` varchar(255) DEFAULT 'standard' COMMENT 'The render pipeline this panel uses.', `contexts` longtext COMMENT 'The contexts configured by the node author.', `relationships` longtext COMMENT 'The relationship contexts configured by the node author.', `did` int(11) NOT NULL COMMENT 'The display ID of the panel.', `view_mode[...]
MySQL said:
#1071 - Specified key was too long; max key length is 1000 bytes
If I drush pm-disable panelizer
, then drush pm-uninstall panelizer
, then remove the entire panelizer directory and clear the caches, then drush sql-sync
works. It also works if I re-install panelizer-7.x-2.x. But when I go back and try panelizer-7.x-3.0-rc1 it breaks again.
Comment | File | Size | Author |
---|---|---|---|
#9 | key_too_long-1789000-9.patch | 1.09 KB | Ciraxis |
#7 | key_too_long-1789000-7.patch | 970 bytes | Ciraxis |
#4 | key_too_long-1789000-4.patch | 439 bytes | patrickd |
Comments
Comment #1
patrickd CreditAttribution: patrickd commentedHave the same issue on http://simplytest.me/
This bug also makes it impossible to install Dupal Commons on MyISAM as panelizer is a dependency
#1818788: Installer errors without InnoDB enabled
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedThis is weird. Does anyone have any insight into which key is failing? In just looking at this, I don't see any keys that are as big as innodb is saying.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedMy best guess is that something isn't quite right during an upgrade process. Can you give me the entire create table query that it's trying to run when you import your table? Maybe that will help identify what is broken here.
Comment #4
patrickd CreditAttribution: patrickd commentedThis is the full error:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: CREATE TABLE {panelizer_entity} ( `entity_type` VARCHAR(255) NOT NULL COMMENT 'The type of the entity this panel is attached to.', `entity_id` INT NOT NULL DEFAULT 0 COMMENT 'The entity ID this panel is attached to.', `revision_id` INT unsigned NOT NULL COMMENT 'The revision id of the entity.', `name` VARCHAR(255) DEFAULT NULL COMMENT 'The name of the default being used if there is one.', `no_blocks` TINYINT DEFAULT 0 COMMENT 'Whether or not the node disable sidebar blocks.', `css_id` VARCHAR(255) DEFAULT '' COMMENT 'The CSS ID this panel should use.', `css` LONGTEXT DEFAULT NULL COMMENT 'Any CSS the author provided for the panel.', `pipeline` VARCHAR(255) DEFAULT 'standard' COMMENT 'The render pipeline this panel uses.', `contexts` LONGTEXT DEFAULT NULL COMMENT 'The contexts configured by the node author.', `relationships` LONGTEXT DEFAULT NULL COMMENT 'The relationship contexts configured by the node author.', `did` INT NOT NULL COMMENT 'The display ID of the panel.', `view_mode` VARCHAR(128) DEFAULT NULL COMMENT 'Contains the view mode this panelizer is for.', `css_class` VARCHAR(255) DEFAULT '' COMMENT 'The CSS class this panel should use.', `title_element` VARCHAR(255) DEFAULT 'H2' COMMENT 'The HTML element the title should use.', `link_to_entity` TINYINT DEFAULT 1 COMMENT 'Whether or not the title should link to the entity.', PRIMARY KEY (`entity_type`, `entity_id`, `revision_id`, `view_mode`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Node panelizer references.'; Array ( ) in db_create_table() (line 2688 of /home/sb0d09bae91c9f4b/www/includes/database/database.inc).
If I comment all the keys of panelizer_entity out
//'primary key' => array('entity_type', 'entity_id', 'revision_id', 'view_mode'),
Then it works!
If I comment the 'entity_type' key out
It works!
Commenting out any of the other keys still produces the error.
So it's 'entity_type' which makes trouble...
If I change the 'size' of 'entity_type' from 255 to 50 - it works!
100 - still works
128 - works
150 - still works
200 - still works
250 - fails with key too long error
Solution is simple:
Change 'entity_type' size to varchar(128) (the same size as for tables in core)
Patch attached - earl, you will get free beer in prague if this gets committed quickly ;-)
Comment #5
patrickd CreditAttribution: patrickd commentedComment #6
DamienMcKennaThis needs a hook_update_N() implementation to modify the existing column.
Comment #7
Ciraxis CreditAttribution: Ciraxis commentedpatch attached -- add hook_update_7110() to update the entity_type field length.
Comment #8
patrickd CreditAttribution: patrickd commentedPatch unfortunately fails
Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT NULL, ADD PRIMARY KEY (`entity_type`, `entity_id`, `revision_id`, `view_' at line 1: ALTER TABLE {panelizer_entity} CHANGE `entity_type` `entity_type` DEFAULT NULL, ADD PRIMARY KEY (`entity_type`, `entity_id`, `revision_id`, `view_mode`); Array ( ) in db_change_field() (line 2988 of /home/patrickd/www/drupal7/includes/database/database.inc).
Comment #9
Ciraxis CreditAttribution: Ciraxis commentedwhoops
Comment #10
patrickd CreditAttribution: patrickd commentedAwesome, thanks that one works! :)
Comment #11
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted and pushed.
Comment #12
patrickd CreditAttribution: patrickd commentedThanks!
This is a pretty critical bug for people using MyISAM, could we make a new release with this?
Comment #13
merlinofchaos CreditAttribution: merlinofchaos commentedYes, I plan on making a new release pretty soon.
Comment #14
patrickd CreditAttribution: patrickd commenteduhm how soon? panelizer, panopoly and many others are submitted quite often on simplytest.me, it's a pitty they still don't work as there's no release yet :/
Comment #16
P2790 CreditAttribution: P2790 commentedJust reopening as I had the same issue but luckily for me I could just uninstall the module then reinstall.
Comment #17
merlinofchaos CreditAttribution: merlinofchaos commentedThere is no point in re-opening an issue that had a patch committed and pushed already, on 11/29.