Failed database-update

Frank.dev - April 2, 2008 - 09:11
Project:Panels
Version:5.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:matshuk
Status:by design
Description

I have updated from beta2 to beta3. Run update.php, and:

- user warning: Can't DROP 'name_2'. Check that column/key exists query: ALTER TABLE oblivionpower_panels_page DROP INDEX name_2 in /htdocs/drupal/includes/database.mysql.inc on line 172.

- user warning: Can't DROP 'oblivionpower_panels_object_cache_idx'. Check that column/key exists query: ALTER TABLE oblivionpower_panels_object_cache DROP INDEX oblivionpower_panels_object_cache_idx in /htdocs/drupal/includes/database.mysql.inc on line 172.

and:

The following queries were executed
panels module
Update #5215

  • ALTER TABLE {panels_object_cache} CHANGE COLUMN data data longtext
  • ALTER TABLE {panels_mini} DROP INDEX name_2
  • Failed: ALTER TABLE {panels_page} DROP INDEX name_2
  • Failed: ALTER TABLE {panels_object_cache} DROP INDEX {panels_object_cache}_idx
  • ALTER TABLE {panels_pane} ADD PRIMARY KEY (pid)

Can you help me?

Thanks.
Frank

#1

nath - April 2, 2008 - 10:05

Similar here:

    * user warning: Can't DROP 'name_2'; check that column/key exists query: ALTER TABLE panels_mini DROP INDEX name_2 in /var/www/drupal.akademie.de/htdocs/includes/database.mysql.inc on line 172.
    * user warning: Can't DROP 'name_2'; check that column/key exists query: ALTER TABLE panels_page DROP INDEX name_2 in /var/www/drupal.akademie.de/htdocs/includes/database.mysql.inc on line 172.
    * user warning: Can't DROP 'panels_object_cache_idx'; check that column/key exists query: ALTER TABLE panels_object_cache DROP INDEX panels_object_cache_idx in /var/www/drupal.akademie.de/htdocs/includes/database.mysql.inc on line 172.
    * user warning: Duplicate entry '0' for key 1 query: ALTER TABLE panels_pane ADD PRIMARY KEY (pid) in /var/www/drupal.akademie.de/htdocs/includes/database.mysql.inc on line 172.

and:

The following queries were executed
panels module
Update #5215

    * ALTER TABLE {panels_object_cache} CHANGE COLUMN data data longtext
    * Failed: ALTER TABLE {panels_mini} DROP INDEX name_2
    * Failed: ALTER TABLE {panels_page} DROP INDEX name_2
    * Failed: ALTER TABLE {panels_object_cache} DROP INDEX {panels_object_cache}_idx
    * Failed: ALTER TABLE {panels_pane} ADD PRIMARY KEY (pid)

#2

nath - April 2, 2008 - 10:12

It seems, in my DB, the superfluous index that should be dropped isn't called name_2 but panels_mini_name_idx / panels_page_name_idx and in panels_object_cache, there was no duplicated index.
Also, there are multiple lines with pid 0 and the rest more or less empty in panels_pane, which is why the change failed as well.

I guess, removing the two indexes and the lines with pid 0 (and adding the primary key afterwards) should be enough to fix this?

#3

buzzdecafe - April 2, 2008 - 15:24

Similar here, too:

    * user warning: Can't DROP 'name_2'; check that column/key exists query: ALTER TABLE sol_panels_page DROP INDEX name_2 in /var/www/html/drupal-5.7/includes/database.mysql.inc on line 172.
    * user warning: Can't DROP 'sol_panels_object_cache_idx'; check that column/key exists query: ALTER TABLE sol_panels_object_cache DROP INDEX sol_panels_object_cache_idx in /var/www/html/drupal-5.7/includes/database.mysql.inc on line 172.

and

    * ALTER TABLE {panels_object_cache} CHANGE COLUMN data data longtext
    * ALTER TABLE {panels_mini} DROP INDEX name_2
    * Failed: ALTER TABLE {panels_page} DROP INDEX name_2
    * Failed: ALTER TABLE {panels_object_cache} DROP INDEX {panels_object_cache}_idx
    * ALTER TABLE {panels_pane} ADD PRIMARY KEY (pid)

#4

sdboyer - April 2, 2008 - 16:01
Status:active» by design

I really should have included an informative message to assuage peoples' concerns over this in the update, or figured out a way to determine if there were any duplicate indexes before attempting to drop them. Sorry.

In a previous version of Panels2, duplicate indexes were accidentally created - but, evidently, only for some people, and some other people had different duplicate indexes created (as in nath's case in #2). However, here's the bottom line:

If one of the 'DROP INDEX' queries fails while you're running update.php, NOTHING is wrong. Panels should NOT be broken.

However, if the ADD PRIMARY KEY query fails, you do have a problem, but nath, the steps you outline in #2 should fix your problem, at least.

Unfortunately, Panels2 is complex enough that odd cases like this do seem to arise periodically, so there's only so much I can do in the update scripts.

#5

matshuk - April 22, 2008 - 04:09
Version:5.x-2.0-beta3» 5.x-2.x-dev
Assigned to:Anonymous» matshuk

#6

tyler-durden - May 2, 2008 - 16:54

That was the problem. Doh!

 
 

Drupal is a registered trademark of Dries Buytaert.