Enabling Dev version through drush shows this error:

The following projects have unmet dependencies:
draggableviews requires entity
Would you like to download them? (y/n): y
Project entity (7.x-1.0) downloaded to /home/e-smith/files/ibays/anim3/html/sites/all/modules/entity.                                                                                                                               [success]
Project entity contains 2 modules: entity_token, entity.
The following extensions will be enabled: draggableviews, entity
Do you really want to continue? (y/n): y
WD php: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: CREATE TABLE {draggableviews_structure} (                                                   [error]
`dvid` INT unsigned NOT NULL auto_increment COMMENT 'The primary identifier.', 
`view_name` VARCHAR(128) NOT NULL DEFAULT '' COMMENT 'Makes the order unique for each view.', 
`view_display` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'Makes the order unique for each view display.', 
`args` VARCHAR(255) NULL DEFAULT '' COMMENT 'Makes the order unique for a given set of arguments', 
`entity_id` INT unsigned NOT NULL COMMENT 'Id of the entity that we are sorting (node, user, etc.).', 
`weight` INT NOT NULL DEFAULT 0 COMMENT 'The order weight.', 
`parent` INT NOT NULL DEFAULT 0 COMMENT 'The order parent.', 
PRIMARY KEY (`dvid`), 
UNIQUE KEY `dvid` (`dvid`), 
INDEX `view` (`view_name`, `view_display`, `args`, `entity_id`), 
INDEX `weight` (`weight`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'The table saves the order settings of an draggableview.'; Array
(
)
 in db_create_table() (line 2688 of /home/e-smith/files/ibays/anim3/html/includes/database/database.inc).
Cannot modify header information - headers already sent by (output started at /usr/share/pear/drush/includes/output.inc:37) bootstrap.inc:1212                                                                                      [warning]
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: CREATE TABLE {draggableviews_structure} (
`dvid` INT unsigned NOT NULL auto_increment COMMENT 'The primary identifier.', 
`view_name` VARCHAR(128) NOT NULL DEFAULT '' COMMENT 'Makes the order unique for each view.', 
`view_display` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'Makes the order unique for each view display.', 
`args` VARCHAR(255) NULL DEFAULT '' COMMENT 'Makes the order unique for a given set of arguments', 
`entity_id` INT unsigned NOT NULL COMMENT 'Id of the entity that we are sorting (node, user, etc.).', 
`weight` INT NOT NULL DEFAULT 0 COMMENT 'The order weight.', 
`parent` INT NOT NULL DEFAULT 0 COMMENT 'The order parent.', 
PRIMARY KEY (`dvid`), 
UNIQUE KEY `dvid` (`dvid`), 
INDEX `view` (`view_name`, `view_display`, `args`, `entity_id`), 
INDEX `weight` (`weight`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'The table saves the order settings of an draggableview.'; Array
(
)
 in db_create_table() (line 2688 of /home/e-smith/files/ibays/anim3/html/includes/database/database.inc).
Drush command terminated abnormally due to an unrecoverable error.  

Comments

antonyanimator’s picture

Title: Enabling Dev version through drush shows error » Enabling Dev version through shows error

Changing title, its not drush specific

antonyanimator’s picture

Title: Enabling Dev version through shows error » Enabling Dev version shows error
istryker’s picture

Status: Active » Postponed (maintainer needs more info)

I cannot reproduce.

  • I uninstalled draggableviews and entity. Then reinstalled, and it worked for me.
  • I ran the mysql command in error to create the table and received no errors.

Something tells me its your version of MySQL. What version are you running? I am running 5.5.29-0ubuntu0.12.10.1 MySQL server without a problem.

Changing status to Postpone (maintainers needs more information). Will close the issue in 1 week if I do not receive any new information

antonyanimator’s picture

I removed and uninstalled, then downloaded and reinstalled. Still receive same errors.

I am running:

DATABASE:
Server: Localhost via UNIX socket
Software: MySQL
Software version: 5.0.95 - Source distribution
Protocol version: 10
User: root@localhost
Server charset: UTF-8 Unicode (utf8)

WEB SERVER:
Apache
Database client version: libmysql - 5.0.95
PHP extension: mysql

antonyanimator’s picture

Sorted it out,

I needed to enable InnoDB engine in mysql.

Thanks for your time!

antonyanimator’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
istryker’s picture

Status: Closed (works as designed) » Active

Looks like problem was introduce in #1432456: Improve performance when {draggableviews_structure} has a large number of rows by adding database indexes

This effects MySQL servers version 5.5.13 or old. I got this information from the bottom of http://bugs.mysql.com/bug.php?id=4541

The problem is your server's charset being utf8 and the index. in utf8 1 character = 3 bytes. in latin1 1 character = 1 byte.

    // from draggableviews_structure schema in draggableviews.install
    'indexes' => array(
      'view' => array('view_name', 'view_display', 'args', 'entity_id'),
      'weight' => array('weight'),
    ),

view = 128 + 64 + 255 + ? = (447 + ?)
447*3 bytes = 1341 bytes > 1000 bytes limit.

antonyanimator’s picture

Oh right, I don't get any errors anymore after enabling innodb in mysql but I'm not very familiar with php or mysql.

istryker’s picture

Interesting it worked for you after enabling innodb. I thought that was the standard engine now (since like 2005). I do not have time to troubleshoot this.

I would like to get a database administrator feedback on this issue.

I would like to get more feedback on this. If you are/have experienced this problem, please comment.

I might close this issue in a few weeks time if there is no response.

mikehues’s picture

I'm running into the same issue on a site that I'm upgrading to D7. My local dev machine is running msyql 5.1.44 and the client's host is running 5.1.68. I checked and the majority of my client's web hosts are running either mysql 5.0.x or 5.1.x. They are mostly shared hosting, so I'm not sure that I would have the option to upgrade mysql. It would be a bummer if I couldn't use this module on sites that I upgrade to D7.

mikehues’s picture

It seems the issue is fixed in the dev version. I was getting the error from the original post with version 7.x-2.0. I uninstalled that and successfully installed version 7.x-2.x-dev

mikehues’s picture

the same error resurfaced when I tried to push the database to the staging server with drush sql-sync.
dev - mysql 5.1.44
stage - mysql 5.1.68

Is the only solution to upgrade mysql?

istryker’s picture

@mikehues IDK, I do not have time to troubleshoot this for you to see if there is another way. I would recommend upgrading.

pedrosp’s picture

I bumped yesterday with this.
The problem was that either regular or dev version didn't remove the "draggableviews_structure" table on the database on an uninstall process.
I had to remove manually the table with a database editor, prior to re-install.

I probably messed-up with install and re-install different versions before, anyway that solved the problem.

edit: I think that this happens when you try to upgrade from regular to dev, and then trying to downgrade. Because the structure table is different in both versions, the uninstall process get stuck, and you then have to delete manually the table.

criscom’s picture

Deinstalling and reinstalling the module solved it for me.

antonyanimator’s picture

Status: Active » Closed (works as designed)
criznach’s picture

This may still be an issue for some if innodb becomes disabled. In my case, this was the solution:

http://www.turnkeylinux.org/forum/support/20090111/drupal-6-problem-enab...

My innodb log files were corrupt, which caused innodb to be disabled - even though my.cnf appeared to enable it.

Running these commands fixed it.

/etc/init.d/mysql stop
mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bak
mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bak
/etc/init.d/mysql start
stephen ollman’s picture

#15 also removed the error fro me. Disable module, uninstall module, enable module.

kvnm’s picture