I'm doing practice upgrades of a site running drupal 6.20 to drupal 7.0 I followed the directions in UPGRADE.txt to the word. Everything goes fine for a while, and when I get to the point of running update.php I get two failures:

The following updates returned messages
system module
Update #7018

    * Failed: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'type' at row 129: ALTER TABLE {system} CHANGE `type` `type` VARCHAR(12) NOT NULL DEFAULT ''; Array ( ) in db_change_field() (line 2888 of /home2/lufttabl/public_html/joshorndorffupgrade/includes/database/database.inc).

contact module
Update #7002

    * Failed: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'module' in 'where clause': SELECT 1 AS expression FROM {role_permission} role_permission WHERE ( (rid = :db_condition_placeholder_0) AND (permission = :db_condition_placeholder_1) AND (module = :db_condition_placeholder_2) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => 2 [:db_condition_placeholder_1] => access user contact forms [:db_condition_placeholder_2] => contact ) in contact_update_7002() (line 128 of /home2/lufttabl/public_html/joshorndorffupgrade/modules/contact/contact.install).

The second one seems like it probably isn't as important as the first, so I'm mainly wondering about the system update. I tried to proceed to the front page and the administration pages despite the error, but I get the following on both the administration pages and the front page:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lufttabl_joshorndorff.drup_block_node_type' doesn't exist: SELECT module, delta, type FROM {block_node_type}; Array ( ) in node_block_list_alter() (line 2374 of /home2/lufttabl/public_html/joshorndorffupgrade/modules/node/node.module).

Any help or ideas would be greatly appreciated,
-Josh Orndorff

Comments

shane birley’s picture

Title: system update 7018 fail on upgrade » System Update #7018 Fails on Upgrade

Have you been able to correct this problem? I ran into it today and thought I would ask if you had any progress.

akaserer’s picture

i changed the field length in phpmyadmin:

just go to table system - change field 'type'

it created this sql-statement

ALTER TABLE `system` CHANGE `type` `type` VARCHAR( 12 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''

bircher’s picture

hello
did you try to update to the dev version instead of 7.0?

Anonymous’s picture

I've tried reproducing the following error

contact module
Update #7002

    * Failed: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'module' in 'where clause': SELECT 1 AS expression FROM {role_permission} role_permission WHERE ( (rid = :db_condition_placeholder_0) AND (permission = :db_condition_placeholder_1) AND (module = :db_condition_placeholder_2) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => 2 [:db_condition_placeholder_1] => access user contact forms [:db_condition_placeholder_2] => contact ) in contact_update_7002() (line 128 of /home2/lufttabl/public_html/joshorndorffupgrade/modules/contact/contact.install).

with 6.22 to 7.7 and 6.22 to 7.0 and there were no issues.

If this is a 'real' problem, for future reference: a contact_update_dependencies() between contact_update_7002() and user_update_7006() might solve the problem.

spaes’s picture

I had this problem when upgrading from 6.22. I executed the ALTER TABLE sql statement that akaserer posted and the upgrade completed perfectly.

David_Rothstein’s picture

leisurman’s picture

I change your query to 32 instead of 12 and it worked, but the upgrade still fails with the same error?
ALTER TABLE `system` CHANGE `type` `type` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''

Should you also modify system install file to say 32?
inside /modules/system/system.install

function system_update_7018() {
db_drop_index('system', 'modules');
db_drop_index('system', 'type_name');
db_change_field('system', 'type', 'type', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''));
db_add_index('system', 'type_name', array('type', 'name'));
}

leisurman’s picture

I tried to change the system install file then I got a sq_storage error

David_Rothstein’s picture

Let's call this a duplicate of the issue I linked above - so far it seems like it is, and even though this issue is older there is more discussion over there.

leisurman’s picture

I started over and found this post that really helped.
https://support.mayfirst.org/ticket/8112

I needed to delete a bunch of old sql tables that were causing the upgrade errors.