I get the following error upon comment deletion:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list': SELECT entity_id, revision_id, language, data FROM {metatag} WHERE (entity_type = :type) AND (entity_id IN (:ids_0)) ORDER BY entity_id, revision_id; Array ( [:type] => comment [:ids_0] => 484 ) in metatag_metatags_load_multiple() (Zeile 373 von XXXXXX/www/drupal/sites/all/modules/metatag/metatag.module).

I've updated from some dev after beta7. After performing the update (i.e. running update.php) I was greeted with mutliple messages like these:
Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 6 for the taxonomy_term entity type. The error message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list'
Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 763 for the file entity type. The error message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list' and similar errors.

Rerunning update.php, reuploading the module didn't help. Need any additional info?

CommentFileSizeAuthor
#28 metatag-n2177455-28.patch1.63 KBDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Title: Updates need to run but won't (it seems) » Updates not running correctly when updating to beta9
Priority: Normal » Major

Bummer. First off, lets make this a Major issue.

What is the first Metatag update it says needs to be ran?

DamienMcKenna’s picture

BTW are you sure you installed beta9 and not beta8? beta9 came out over the weekend, beta8 came out last Wednesday night.

dddave’s picture

Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 67 for the node entity type. The error message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list' This is the first error I got.

dddave’s picture

Freshly downloaded version of beta9. ;)

DamienMcKenna’s picture

Yes, but what update number does "drush upatedb" or update.php say needs to be ran first?

dddave’s picture

I am sadly not running drush here. Running update.php brought "no pending updates" which is why the error message baffled me.

DamienMcKenna’s picture

Do you remember what the first update was when you ran them? Alternatively, can you find out the exact version number you were using prior to updating - you are using a source revisioning system like git or svn, right?

dddave’s picture

Not as strictly as I should. Shame on me. This might be the last slap on the head I needed.
It was 7.x-1.0-beta7+25-dev though.

DamienMcKenna’s picture

Ah! That's a huge help - thanks!

akalata’s picture

I've got the same issue, here's what drush status is giving me:

WD metatag: Error loading meta tag data, do the database updates need to be run? The error occurred when loading 
record(s) 332 for the node entity type. The error message was: SQLSTATE[42S22]: Column not found: 1054 Unknown
column 'revision_id' in 'field list'
Run your updates, like drush updb.
WD metatag: Error loading meta tag data, do the database updates need to be run? The error occurred when loading 
record(s) 0 for the user entity type. The error message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column'revision_id' in 'field list'
Run your updates, like drush updb. 

Updated from 7.x-1.0-beta7 to -beta9.

I tried reverting back to -beta7 and going just to beta8, got the same message.

hass’s picture

Same error here when upgrading beta7 to beta9 via drush. The db updates are running after the error.

WD metatag: Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 0 for the user entity type. The error message was:     [error]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list'
Run your updates, like drush updb.                                                                                                                                                [status]
'all' cache was cleared in /web#default                                                                                                                                           [success]
You have pending database updates. Run `drush updatedb` or visit update.php in your browser.                                                                                      [warning]
The following updates are pending:

metatag module :
  7015 -   Add the revision_id from the entity into metatag schema, adjust the primary  keys accordingly.
  7016 -   Update the revision ID to fix the NULL values, help avoid problems with  update 7017.
  7017 -   The {metatag}.revision_id field is required.
  7018 -   Update the revision ID for each record. This may take some time. Should any  nodes be discovered with a meta tag record for both revision_id 0 and the  correct revision_id, the "0" value will be deleted; if this is not the  desired result the {metatag} table must be manually pruned to have the  correct records prior to letting this update run.
  7019 -   Clear the entity_cache bins.
  7020 -   Clear the Metatag cache.
  7021 -   Clear the existing Metatag cache so all unwanted 403404 paths can be  purged.
  7022 -   A minor bit of tidy-up after update 7015.

Do you wish to run all pending updates? (y/n): y
Performed update: metatag_update_7015                                                                                                                                             [ok]
Added the {metatag}.revision_id field.                                                                                                                                            [status]
Performed update: metatag_update_7016                                                                                                                                             [ok]
The {metatag}.revision_id field has already been added, nothing to do.                                                                                                            [status]
Performed update: metatag_update_7017                                                                                                                                             [ok]
Didn't need to fix the {metatag}.revision_id field; please disperse, nothing to see here.                                                                                         [status]
Performed update: metatag_update_7018                                                                                                                                             [ok]
Update 7018: 204 records to update.                                                                                                                                               [status]
Update 7018: 1 records were updated.                                                                                                                                              [status]
Performed update: metatag_update_7018                                                                                                                                             [ok]
Update 7018: 101 records were updated.                                                                                                                                            [status]
Performed update: metatag_update_7018                                                                                                                                             [ok]
Update 7018: 201 records were updated.                                                                                                                                            [status]
Performed update: metatag_update_7018                                                                                                                                             [ok]
Update 7018: 204 records were updated.                                                                                                                                            [status]
Performed update: metatag_update_7019                                                                                                                                             [ok]
The EntityCache module is not installed, nothing to do.                                                                                                                           [status]
Performed update: metatag_update_7020                                                                                                                                             [ok]
Performed update: metatag_update_7021                                                                                                                                             [ok]
Performed update: metatag_update_7022                                                                                                                                             [ok]
Finished performing updates.                                                                                                                                                      [ok]
edenb’s picture

subscribe

On my site, I get the message:

Error loading meta tag data, do the database updates need to be run?
Error loading meta tag data, do the database updates need to be run?
Error loading meta tag data, do the database updates need to be run?
Error loading meta tag data, do the database updates need to be run?

And here are errors form the dblog:

TYPE metatag
DATE Sunday, February 23, 2014 - 23:13
USER admin
LOCATION http://www.MYSite.com/
REFERRER
MESSAGE Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 24 for the node entity type. The error message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list'
SEVERITY critical

TYPE metatag
DATE Sunday, February 23, 2014 - 23:13
USER admin
LOCATION http://www.MYSite.com/
REFERRER
MESSAGE Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 31, 46, 52 for the node entity type. The error message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list'
SEVERITY critical

greatdane’s picture

Upgraded the metatag module to version metatag-7.x-1.0-beta9 by doing it from the admin/modules/upgrade page. The initial try which resulted in the same error message shown above, i.e,

"WD metatag: Error loading meta tag data, do the database updates need[error]
to be run? The error occurred when loading record(s) 0 for the user
entity type. The error message was: SQLSTATE[42S22]: Column not
found: 1054 Unknown column 'revision_id' in 'field list'
Run your updates, like drush updb. [status]
WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: [error]
1146 Table 'dogs_dogs.cache_panels' doesn't exist: TRUNCATE
{cache_panels} ; Array() in cache_clear_all() (line 165 of
/home/dogs/public_html/includes/cache.inc).
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dogs_dogs.cache_panels' doesn't exist: TRUNCATE {cache_panels} ; Array
() in cache_clear_all() (line 165 of /home/dogs/public_html/includes/cache.inc).
Drush command terminated abnormally due to an unrecoverable error. [error]
"
was received during a 'drush up' upgrade of our site. It automatically restored back to the the metatag-7.x-1.0-beta7. We then tried to upgrade just the metatag module in the admin/modules/upgrade page and it loaded. After the module loaded it gives the option to update the database. It updated without any errors. Then, the rest of the out of date drupal 7 modules were updated and the the drupal 7 core was updated using drush up. All is working now.

Hanpersand’s picture

Hey Damien, I'm sorry to report that I installed Metatags beta9 fresh on Drupal 7.26 and I'm getting the following stuff, too:

WD metatag: Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 3254 for the node entity type. The    [error]
error message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list'
Run your updates, like drush updb.                                                                                                                               [status]
WD metatag: Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 0 for the user entity type. The error [error]
message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list'
Run your updates, like drush updb.                                                                                                                               [status]
WD metatag: Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 3254 for the node entity type. The    [error]
error message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list'
Run your updates, like drush updb.                                                                                                                               [status]
WD metatag: Error loading meta tag data, do the database updates need to be run? The error occurred when loading record(s) 0 for the user entity type. The error [error]
message was: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_id' in 'field list'
Run your updates, like drush updb.  

I'd really like to replace ye olden Open Graph module with Metatag. It looks so much better. Let me know if I can provide any more info that might help troubleshoot this.

Thanks!
@hanabel

EDITED TO ADD: When I try to run the db updates, Drupal's all, "There are no pending updates."

DamienMcKenna’s picture

Clearly I need to tweak the logic so it stops freaking people out, as the important issue is just that you need to run the database updates after updating the codebase.

Hanpersand’s picture

Sorry... that was a big chunk of missing info from me. Apologies! Drupal claims there are no pending updates when I try to run updates.

Hanpersand’s picture

I just disabled it, cleared all caches, and tried to re-enable it with drush en metatag. I don't know
This might need to be its own issue. I got this:

The following extensions will be enabled: metatag
Do you really want to continue? (y/n): y
WD php: DatabaseSchemaObjectExistsException: Table metatag_config already exists. in DatabaseSchema->createTable() (line 657 of                                  [error]
/var/www/acf-dev/includes/database/schema.inc).
Cannot modify header information - headers already sent by (output started at /usr/local/src/drush/includes/output.inc:37) bootstrap.inc:1217                    [warning]
DatabaseSchemaObjectExistsException: Table <em class="placeholder">metatag_config</em> already exists. in DatabaseSchema->createTable() (line 657 of /var/www/acf-dev/includes/database/schema.inc).
Drush command terminated abnormally due to an unrecoverable error.  

I'm not sure if this is related.

Hanpersand’s picture

@jesseves on Twitter said this:

I ran into that bug. Update 7015 creates the field but is skipped. You need to force it to run. In the System table, find the metatag row and set the schema_version to 7014. Then run updb. Errors should go away.

We tried that. Here's what happened:

drush updatedb
The following updates are pending:

metatag module : 
7015 - Add the revision_id from the entity into metatag schema, adjust the primary keys accordingly. 
7016 - Update the revision ID to fix the NULL values, help avoid problems with update 7017. 
7017 - The {metatag}.revision_id field is required. 
7018 - Update the revision ID for each record. This may take some time. Should any nodes be discovered with a meta tag record for both revision_id 0 and the correct revision_id, the "0" value will be deleted; if this is not the desired result the {metatag} table must be manually pruned to have the correct records prior to letting this update run. 
7019 - Clear the entity_cache bins. 
7020 - Clear the Metatag cache. 
7021 - Clear the existing Metatag cache so all unwanted 403404 paths can be purged. 
7022 - A minor bit of tidy-up after update 7015.

Do you wish to run all pending updates? (y/n): y
SQLSTATE42000: Syntax error or access violation: 1072 Key column 'language' doesn't exist in table [error]
Performed update: metatag_update_7015 [ok]
Finished performing updates.

All the updates are still pending, since it choked on the first one.

davidcsonka’s picture

I ran drush updatedb and it said no updates were needed. Still get Error loading meta tag data, do the database updates need to be run? on every page.

DamienMcKenna’s picture

@davidcsonka: Did you see any errors when you ran the updates?

davidcsonka’s picture

I got the errors from #14 after running "drush pm-update metatag".

And then, immediately after that, I got the error from #17 after I tried to just disable the module, delete the files, drush pm-download metatag, and then drush pm-enable meta-tag.

DamienMcKenna’s picture

Hanpersand’s picture

Based on Jess Snyder's experiences with this problem (via @jesseves on twitter), I did the following steps:
1. Disabled metatag.
2. Deleted the module folder.
3. Went into phpMyAdmin (local) and changed the db schema in the metatag row of the system table to 2008.
4. Drush dl a fresh copy.
5. Drush en metatag.
6. This time I was prompted to run db updates. Ran them.
7. Got this:

Update #7009
Failed: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'm.language' in 'field list': SELECT m.entity_id, count(m.language) AS the_count FROM {metatag} m WHERE m.entity_type = :type GROUP BY m.entity_id HAVING count(m.language) > 1; Array ( [:type] => taxonomy_term ) in _metatag_remove_dupes() (line 788 of /Users/johannabates/Sites/acf/sites/all/modules/metatag/metatag.install).
DamienMcKenna’s picture

Ok, the fact that you didn't have the 'language' field tells me that your site was running a very old version of the original Metatags module as that field was added way back in update 7003, in 2011.

Out of interest, do you have any records in the {metatag} table?

DamienMcKenna’s picture

Lets move all issues related to upgrading from the now defunct "Metatags" module to #2221181: Correctly handle upgrades from Metatags module, including @hanpersand's problems.

Hanpersand’s picture

Ah, that means that we installed it when we initially built the site, but then disabled it and never used it. I remember it wasn't doing what we needed at the time, but I didn't remember that we'd ever installed it at all. I'll move my issues over to the other thread and I'll try to get table records for you when I can. Thanks, Damien.

akalata’s picture

For me, the updating issue (from -beta7 to -beta9) was happening because my schema_version was set to -1. Not sure how that happened, but manually setting schema_version to 7014 (which is what it was at -beta7) and running updates from there worked great!

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
1.63 KB

This should help in some cases - it'll stop the warning messages about the revision_id value not being present, giving time to run the updates.

Status: Needs review » Needs work

The last submitted patch, 28: metatag-n2177455-28.patch, failed testing.

DamienMcKenna’s picture

Version: 7.x-1.0-beta9 » 7.x-1.x-dev

Status: Needs work » Needs review
DamienMcKenna’s picture

Could someone please give the above patch a try? I'm *this* close to releasing 1.0-RC1, but I want to ensure this bug is fixed first. Thanks.

dddave’s picture

Sorry, I messed up my db and I am to lazy to fix it. The patch applied cleanly, updates ran without an issue but because I ran it on the old install where the first fail happened I got DatabaseSchemaObjectExistsException: Die Datenbanktabelle <em class="placeholder">metatag_config</em> ist bereits vorhanden. in DatabaseSchema->createTable() (Zeile 657 XXXXXXXXXXXXX/drupal/includes/database/schema.inc). (table already exists).

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed. Hopefully that'll make the update process for others.

  • DamienMcKenna committed 627369a on 7.x-1.x
    Issue #2177455 by DamienMcKenna: Avoid errors when updating from older...
Nebel54’s picture

I did just try to update from beta7 to the latest commit, updates ran without problems. I did a quick check if existing metatags are still present in existing nodes after the update. Everything looks good so far. Thanks a lot!

DamienMcKenna’s picture

@Nebel54: Excellent! Thanks for testing it out!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.