Hi Damien,

Don't know if it's my dev instance which is wrong but just wanted to let you know there is a problem when updating to beta3 with drush :

Code updates will be made to the following projects: Meta tags [metatag-7.x-1.0-beta3]

Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Project metatag was updated successfully. Installed version is now 7.x-1.0-beta3.
Backups were saved into the directory /home/sly/drush-backups/projectwhite/20121116153751/modules/metatag.                                                              [ok]
WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'language' in 'field list': SELECT entity_id, data, language FROM {metatag} WHERE           [error]
(entity_type = :type) AND (entity_id IN (:ids_0)); Array
    [:type] => user
    [:ids_0] => 0
in metatag_metatags_load_multiple() (line 351 of /home/web/slybud.com/projectwhite/sites/all/modules/contrib/metatag/metatag.module).
Drush command terminated abnormally due to an unrecoverable error.                                                                                                       [error]
PDOException : SQLSTATE[42S22]: Column not found: 1054 Unknown column 'language' in 'field list': SELECT entity_id, data, language FROM {metatag} WHERE (entity_type = :type) AND (entity_id IN (:ids_0)); Array
    [:type] => user
    [:ids_0] => 0
dans metatag_metatags_load_multiple() (ligne 351 dans /home/web/slybud.com/projectwhite/sites/all/modules/contrib/metatag/metatag.module).Drush was not able to start (bootstrap) Drupal.                                                                                                                          [error]
Hint: This error can only occur once the database connection has already been successfully initiated, therefore this error generally points to a site configuration
issue, and not a problem connecting to the database.

Drush was attempting to connect to:
  Drupal version    : 7.17
  Site URI          : http://default
  Database driver   : mysql
  Database hostname : localhost
   Database          : Connected
  Default theme     : projectwhite
  Administration theme: seven
  PHP configuration : /etc/php5/cli/php.ini
  Drush version     : 5.8
  Drush configuration:
  Drupal root       : /home/web/slybud.com/projectwhite
  Site path         : sites/default
  Modules path      : sites/all/modules
  Themes path       : sites/all/themes
  File directory path: sites/default/files
  Temporary file directory path: /tmp
  %paths            : Array

Backups were restored successfully.   

Everything runs smooth when doing a module upgrade the old-fashioned way :

  • wget
  • tar -xvzf
  • drush updb

The following updates are pending:

metatag module :
  7003 -   Add the {metatag}.language field.

Do you wish to run all pending updates? (y/n): y
Performed update: metatag_update_7003                                                                                                                                    [ok]
Finished performing updates. 

Obviously "chicken or egg problem" with the new column metatag.language

#14 metatag_update_error.png109.47 KBBrian E. Conklin
#7 metatag-n1842764-7.patch1.6 KBDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#6 metatag-n1842764-6.patch1.5 KBDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]


DamienMcKenna’s picture


This is happening because "drush upc" clears all caches after it updates the module files. Not sure what can be realistically done, I know other modules have ran into this problem too (Rules, etc) but I don't know if there's a reasonable solution.

DamienMcKenna’s picture

Title:error when updating form beta1 (and beta2) to beta 3 with drush» Error when updating to beta 3 with drush pm-updatecode / upc

Clarified the title.

slybud’s picture

Thx, I knew this would be tricky

Maybe it should be mentionned somewhere in the release notes ?

Anyway, it works !!!!

DamienMcKenna’s picture

Status:Active» Fixed

I added a note to the release notes as a reminder to run the database updates: http://drupal.org/node/1842696

fonant’s picture

Can confirm that downloading code and updating database works. I used drush:

# cd sites/all/modules
# drush dl metatag
# drush updatedb

DamienMcKenna’s picture

Title:Error when updating to beta 3 with drush pm-updatecode / upc» Error when updating to beta 3
Category:bug» support
Priority:Normal» Critical
Status:Fixed» Needs review
new1.5 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

There are a few solutions for this:

  • Use Drush to update Metatag's files and run the database updates in one step: drush update metatag
  • Use Drush to run the necessary database updates after having already updated the files: drush updb
  • Be already logged into the site as an administrator prior to updating the module, update the files and then visit update.php.
  • In the sites's settings.php change the $update_free_access value to TRUE (it is FALSE by default), run the database updates by running update.php, and then change $update_free_access back to FALSE.

I am sorry about the schema update causing problems for so many people :-(

This patch wraps metatag_entity_load() with a try-catch block that'll display a message if the problem arrises.

DamienMcKenna’s picture

new1.6 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

A tiny tweak on the patch from #6, this avoids displaying two messages for people running into the error via Drush.

DamienMcKenna’s picture

Status:Needs review» Fixed


Brian E. Conklin’s picture

I'm having the same problem, except I don't use drush. When i try to run the update.php script it says there are no pending updates. How can I the database updates run?

DamienMcKenna’s picture

@Brian: It is extremely strange that it would say there are no pending database updates but still give an error when trying to load records from the database. Please check the "metatag" table in your database and see if there is a 'language' field.

Brian E. Conklin’s picture

@Damien, there is not a 'language' field in the metatag table. There are only 'entity_type', 'entity_id', and 'data'.

I've tried to update on three sites. Two are dev sites running on my local Windows laptop using IIS. The third is a live site on a CentOS Linux server running Apache. All three had the same exact behavior. No database update required on the update.php script and when going to the I get an error the others were reporting.

DamienMcKenna’s picture

@Brian: The next thing to check - please run the following query: SELECT schema_version FROM system WHERE name='metatag'; It should return 7002 if the database updates have not ran yet.

DamienMcKenna’s picture

I've released beta4, hopefully all will go well with the new release :)

Brian E. Conklin’s picture

new109.47 KB

@Damien: I updated to beta4. There was an error when the update.php script runs, but the update appears to have been successful. Attached is a screen shot so you can see the error.

Brian E. Conklin’s picture

@Damien it appears I may spoken too soon. All pages have an error which says "Error loading meta tag data, do the /update.php">database updates need to be ran?" When I attempt to run the update.php script I get the same screen as in the screen shot in my previous post.

The result of the query you asked me to run after upgrading to beta4 is "-1".

I changed that value back to "7002" and reran update.php. This time the page saw there were updates to perform and ran them. The system seems to now be working.

I suspect something funky happened going from beta2 to beta3 and the metatag schema_version got messed up in the process.

All appears to be well now. Thanks for the help!

Status:Fixed» Closed (fixed)

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