Long time reader, first time bug reporter!

Just took a suggestion to update some existing sites from 6 to 7 to test the update path. Did so, but ran into a snag with this error in the Comment Module, Update #7006:

Failed: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'comment_body_value' in 'field list': INSERT INTO {field_data_comment_body} (entity_id, comment_body_value, comment_body_format, bundle, etid, deleted, language, delta) SELECT c.cid AS entity_id, c.comment AS comment_body_value, c.format AS comment_body_format, 'comment_node_page' AS bundle, 1 AS etid, 0 AS deleted, 'und' AS language, 0 AS delta FROM {comment} c INNER JOIN {node} n ON c.nid = n.nid AND n.type = :type; Array ( [:type] => page ) in comment_update_7006() (line 311 of /home/XXXXX/public_html/EXAMPLE.com/public/modules/comment/comment.install).

Thoughts?

Comments

webchick’s picture

Component: update system » comment.module
Issue tags: -comment module +D7 upgrade path

LOL. :) Welcome to the issue queue!

I'm just correcting the tagging here for now to get more eyes on this. I'm not immediately sure what the problem might be, since we didn't hit this when upgrading Drupal.org's database. Off-hand, it sounds like a problem with hook_update_dependencies() not quite getting the ordering right, but I'm not sure what would cause it.

Are you able to give a core developer a (sanitized) copy of your database to monkey with to see if they can get to the bottom of it?

AntinOz’s picture

Similar fault here, same error string, update #7027 though. I kind of broke my setup afterwards playing with it. I will check back later and if needed can probably recreate the error and post up the database.

HiredGuns’s picture

For sure! Define "sanitized" though. Some tables? Some content? Some tables and some content?

amygdala’s picture

just upgraded (well, tried to) a d6 site in a testing environment, and ran across the same error. happy to provide data/access (it's my blog, and i have duplicated the database to play around with d7).

-----------
Failed: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'comment_body_value' in 'field list': INSERT INTO {field_data_comment_body} (entity_id, comment_body_value, comment_body_format, bundle, etid, deleted, language, delta) SELECT c.cid AS entity_id, c.comment AS comment_body_value, c.format AS comment_body_format, 'comment_node_page' AS bundle, 1 AS etid, 0 AS deleted, 'und' AS language, 0 AS delta FROM {comment} c INNER JOIN {node} n ON c.nid = n.nid AND n.type = :type; Array ( [:type] => page ) in comment_update_7006() (line 311 of /home/.redline/sensemaya/next.sensemaya.org/d7/modules/comment/comment.install).
------------

in other news, i have a MAJOR suggestion to the UPGRADE.txt: it doesn't ask me to remove CCK from the modules directory, and the upgrade fails unless i remove (and not just disable) cck. this is a pretty basic thing that i'm sure less experienced users will run into.. but damned if i can figure out how to make suggestions about the upgrade instructions...

amygdala’s picture

i tried it again (after restoring my database), and this time i realised i had forgotten to switch themes back to garland. upgrade went without a hitch, and i didn't encounter this error.

i think by the time i had finished disabling all my modules, i lost track of the upgrade process, and forgot to switch themes. since the module disabling process is essentially algorithmic, is there any reason the user has to do it?

aspilicious’s picture

Status: Active » Fixed
Issue tags: -D7 upgrade path

*** never mind what I said here ***

aspilicious’s picture

Status: Fixed » Active
HiredGuns’s picture

Still not sure what sort of version of my database you would like access to? I did have Garland enabled. Now the site is stuck between 6 and 7 and is non-functional (had to check the DB to see what modules/themes were active).

sun.core’s picture

Issue tags: +D7 upgrade path
NaheemSays’s picture

This seems slightly different from the above error, but it is in the same function - I seem to have hit this every time I have tried to upgrade a copy of my site to Drupal 7 - is there anyway to make this function more robust?

In the end, I have commented out and manually carried out the following bits in order to proceed:

    db_update('field_data_comment_body')
      ->fields(array('comment_body_format' => NULL))
      ->condition('comment_body_value', '')
      ->condition('comment_body_format', 0)
      ->execute();
    $existing_formats = db_query("SELECT format FROM {filter_format}")->fetchCol();
    $default_format = variable_get('filter_default_format', 1);
    db_update('field_data_comment_body')
      ->fields(array('comment_body_format' => $default_format))
      ->isNotNull('comment_body_format')
      ->condition('comment_body_format', $existing_formats, 'NOT IN')
      ->execute();

(I just set the comment_body_format to 1 where it was 0.)

NaheemSays’s picture

I just ran the upgrade again, with 256 MB php memory, mysql timeout set to 60,000, MariaDB 5.2, php5.3.0 in a local wampserver install and this is once again the only update that errors out with the database going away. It is not a timeout fault.

(I think many of the errors in this topic are from running the update a second or third time - I recognise them from when I have tried to continue the update by visiting update.php again.)

catch’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Haven't seen any reports of this for months, please bump it back to active if you can reproduce.

NaheemSays’s picture

Just tried an update to latest head and this was one of the places of crash. (first time it crashed at comment_upgrade_7003, but I was able to get beyond that, fix that update manually). First crash of this function never gave an actual error message and nothing was entered into the watchdog table.

Second time i got this error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'comment-147884-0-0-und' for key 'PRIMARY': INSERT INTO {field_data_comment_body} (entity_id, comment_body_value, comment_body_format, bundle, entity_type, deleted, language, delta) SELECT c.cid AS entity_id, c.comment AS comment_body_value, c.format AS comment_body_format, 'comment_node_simplenews' AS bundle, 'comment' AS entity_type, 0 AS deleted, 'und' AS language, 0 AS delta FROM {comment} c INNER JOIN {node} n ON c.nid = n.nid AND n.type = :type; Array ( [:type] => simplenews ) in comment_update_7006() (line 311 of C:\wamp\www\drupal-dc75725\modules\comment\comment.install).

NaheemSays’s picture

Status: Postponed (maintainer needs more info) » Needs work
catch’s picture

Could you check your error reporting settings and/or apache logs for the first error?

OFF’s picture

I have same issue!

Spek Regg’s picture

Issue summary: View changes

Regards friends, I need to know if someone already solved the problems of upgrade module comments update Drupal 6-7, I have about 3000 comments and I do not like to lose, and I did what I said the upgrade guide if he had any fix or patch for a way to do mysql manual. Here is the error that I get when you upgrade:

The following updates returned messages
comment module
Update #7006

    Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'comment-2307-0-0-und' for key 1: INSERT INTO {field_data_comment_body} (entity_id, comment_body_value, comment_body_format, bundle, entity_type, deleted, language, delta) SELECT c.cid AS entity_id, c.comment AS comment_body_value, c.format AS comment_body_format, 'comment_node_article' AS bundle, 'comment' AS entity_type, 0 AS deleted, 'und' AS language, 0 AS delta FROM {comment} c INNER JOIN {node} n ON c.nid = n.nid AND n.type = :type; Array ( [:type] => article ) en comment_update_7006() (línea 317 de /home/content/x/r/e/xreggnet/html/modules/comment/comment.install).

Thanks