Hi,

when upgrading through Drush, I'm getting several different SQL errors on different sites; the upgrade to 6.x-2.0-alpha1 runs almost never smoothly:

WD php: Unknown column 'module' in 'where clause'                                                                               [error]
query: UPDATE xmlsitemap set module = 'xmlsitemap_taxonomy' WHERE module = 'xmlsitemap_term' in
/var/www/drupal1/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.install on line 275.
UPDATE {xmlsitemap} set module = 'xmlsitemap_taxonomy' WHERE module = 'xmlsitemap_term'                     [error]
(...)
An error occurred at function : drush_core_updatedb                                                                             [error]

and:

WD php: Unknown column 'module' in 'where clause'                                                                               [error]
query: UPDATE xmlsitemap set module = 'xmlsitemap_taxonomy' WHERE module = 'xmlsitemap_term' in
/var/www/drupal2/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.install on line 275.
UPDATE {xmlsitemap} set module = 'xmlsitemap_taxonomy' WHERE module = 'xmlsitemap_term'                     [error]
Unknown column 'module' in 'where clause'                                                                   [error]
query: UPDATE xmlsitemap set module = 'xmlsitemap_taxonomy' WHERE module = 'xmlsitemap_term' in
/var/www/drupal2/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.install on line 275.

Running 'drush updatedb' a second time claims to finish correctly:

# drush updatedb
No database updates required                                                                                                    [success]
Finished performing updates.

However, I'm not sure if the errors are corrected in the second run, or if they are even noteworthy. Also I'd like to add that I don't know if this is rather an Drush or an Xmlsitemap problem, so feel free to move this report to a more appropriate issue queue. However, when running update.php on a third site, I got partilly similar errors at ./update.php?op=results:

(red)

user warning: Unknown column 'module' in 'where clause' query: UPDATE xmlsitemap set module = 'xmlsitemap_taxonomy' WHERE module = 'xmlsitemap_term' in /var/www/drupal3/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.install on line 275.

(grey)

The following queries were executed
(...)
Update #6113
Failed: UPDATE {xmlsitemap} set module = 'xmlsitemap_taxonomy' WHERE module = 'xmlsitemap_term'

Thanks & greetings, -asb

Comments

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

Those are updates that are not in the 2.x files, so it seems you have old module files around somewhere. Make sure you delete the module's folder before copying in the new version.

asb’s picture

Drush is supposed to (a) move the updated module's folder to ./backup/modules, then (b) download and extract the new release and (c) run drush updatedb which should be an aequivalent to running update.php.

If Drush is working as it is supposed to, there is nothing to be deleted manually.

What I'm seeing in ./backup/modules after the upgrade from 6th of February is:

# ls
20100112182355  20100118235313  20100129040536  20100130023651
(...)
# ls
20091230020146  20100109044023  20100120015129  20100130024101

So obviously there's no 20100206xxxx folder being created. However, I have been upgrading from XML sitemap 6.x-2.0-unstable6, and I have run drush updatedb multiple times, most probably also several times update.php after installing XML sitemap 6.x-2.0-unstable6.

What I'm getting as available releases through Drush is:

# drush info xmlsitemap
 Projekt     Release            Datum
 xmlsitemap  6.x-2.0-alpha1     2010-Feb-04
 xmlsitemap  6.x-2.0-unstable6  2010-Jan-07
 xmlsitemap  6.x-2.0-unstable5  2009-Okt-08
 xmlsitemap  6.x-2.0-unstable4  2009-Aug-23
 xmlsitemap  6.x-2.0-unstable3  2009-Aug-21
 xmlsitemap  6.x-2.0-unstable2  2009-Aug-20
 xmlsitemap  6.x-2.0-unstable1  2009-Aug-20
 xmlsitemap  6.x-2.x-dev        2010-Feb-07
 xmlsitemap  6.x-1.2            2010-Jan-27
 xmlsitemap  6.x-1.1            2009-Aug-25
 xmlsitemap  6.x-1.0            2009-Aug-24
 xmlsitemap  6.x-1.0-rc2        2009-Jul-24
 xmlsitemap  6.x-1.0-rc1        2009-Jul-02
 xmlsitemap  6.x-1.0-beta6      2009-Jun-25
 xmlsitemap  6.x-1.0-beta5      2009-Mai-26
 xmlsitemap  6.x-1.0-beta4      2009-Mai-26
 xmlsitemap  6.x-1.0-beta3      2009-Mai-13
 xmlsitemap  6.x-1.0-beta2      2009-Mai-12
 xmlsitemap  6.x-1.0-beta0      2009-Mai-12
 xmlsitemap  6.x-1.0-beta1      2009-Mai-10
 xmlsitemap  6.x-1.x-dev        2010-Jan-30

If I'm having a site with XML sitemap 6.x-2.0-unstable6 installed, and am running drush rf and drush up, XML sitemap [xmlsitemap-6.x-2.0-alpha1] is being suggested by Drush as an available update.

If those updates are not in the 2.x files, I don't know what is happening here, sorry.

Greetings, -asb

dave reid’s picture

Yeah, I'm not sure what to say beside that I know for a fact that the updates in 6.x-2.x would and do not run any kind of update like that. The xmlsitemap_term module was renamed to xmlsitemap_taxonomy in 6.x-1.x and eventually removed, but we don't have any module column in {xmlsitemap} with 6.x-2.x.

asb’s picture

Title: SQL errors when upgrading through Drush » XML sitemap: SQL errors when upgrading contributed module with database updates through Drush
Project: XML sitemap » Drush
Version: 6.x-2.0-alpha1 »
Component: Code » Interoperability

Hi Dave,

thanks for your reply - you're the maintainer and you for sure do know what updates 'xmlsitemap' is running when upgraded. So for now exclude 'XML sitemap' as source of these errors (btw, do they indicate something harmful?)

From my end I can summarize:

  • I'm updating contributed Drupal modules as soon as they're advertised by 'update status' (notification through 'Update status advanced settings') with a delay of usually zero to maximal 2-3 days; so I'm having pretty recent D6 setups and am running drush updatecode at least 1-2 times a week; thus I'm pretty sure that there are no pending databases updates (everything assuming that Drush is working correctly; in some cases we know that Drush doesn't do proper database updates)
  • I'm updating contributed Drupal modules (with one exception) fully through Drush; the update sequence is drush rf (refreshs the list of releases) plus drush up (update, installs module updates); if Drush executes database updates, I'm always running an additional drush updatecode (a rough, but not complete aequivalent for running update.php). If errors are reported, I'm logging into the site as user #1 and run update.php manually, as long as no errors are indicated anymore; if SQL errors persists, I'm posting an issue (similar to this one).
  • SQL errors similar to those mentioned above have been reported on 9 of 10 D6 sites where I upgraded the 'XML sitemap' module; so I suspect this is not a occasional hiccup on a singular site with exotic setup - let's see if similar reports pop up.
  • 5 of those 10 sites were "bulk" updated (multiple updates processed in on run of drush up), the rest was updated by running drush dl xmlsitemap (which automatically updates from 6.x-2.0-unstable6 to 6.x-2.0-alpha1) because other updates were causing problems (Panels/Ctools). As far as I can see from the watchdog reports, the approach did not affect if these SQL errors showed up.

So I'd suggest to move this issue from the 'XML sitemap' queue to the 'Drush' issue queue. Adjusting project, version, component and issue title accordingly.

Thanks & greetings,
-asb

dave reid’s picture

@asb Can you double check which versions of all the XML sitemap modules you're seeing on your admin/build/modules page?

asb’s picture

@David Reid:

Searching for "xml sitemap" on ./admin/build/modules gives me on one site:

  • XML sitemap engines test 6.x-2.0-alpha1
  • XML sitemap 6.x-2.0-alpha1
  • XML sitemap custom 6.x-2.0-alpha1
  • XML sitemap engines 6.x-2.0-alpha1
  • XML sitemap internationalization 6.x-2.0-alpha1
  • XML sitemap menu 6.x-2.0-alpha1
  • XML sitemap node 6.x-2.0-alpha1
  • XML sitemap taxonomy 6.x-2.0-alpha1

On another site it gets more interesiting, indeed:

  • XML sitemap 6.x-1.2
  • XML sitemap custom 6.x-2.0-unstable6
  • XML sitemap engines 6.x-1.2
  • XML sitemap internationalization 6.x-2.0-unstable6
  • XML sitemap menu 6.x-2.0-unstable6
  • XML sitemap node 6.x-1.2
  • XML sitemap taxonomy 6.x-1.2
  • XML sitemap user 6.x-1.2

Something is absolutely not working as it should.

Repeating the manual upgrade procedure:

# drush dl xmlsitemap-6.x-2.0-alpha1
Project xmlsitemap (6.x-2.0-alpha1) downloaded to /var/www/amoenus/sites/all/modules/.                                                                 [success]
h1677221:/var/www/amoenus# drush updatedb
The following updates are pending:

 xmlsitemap module
 6200 - Empty update.

 xmlsitemap_node module
 6200 - Cleanup variables.

 xmlsitemap_taxonomy module
 6200 - Cleanup variables.

 xmlsitemap_engines module
 6200 - Empty update.

Do you wish to run all pending updates? (y/n): y
Finished performing updates.

No errors.

Now I have on ./admin/build/modules:

  • XML sitemap engines test 6.x-2.0-alpha1
  • XML sitemap 6.x-2.0-alpha1
  • XML sitemap custom 6.x-2.0-alpha1
  • XML sitemap engines 6.x-2.0-alpha1
  • XML sitemap internationalization 6.x-2.0-alpha1
  • XML sitemap menu 6.x-2.0-alpha1
  • XML sitemap node 6.x-2.0-alpha1
  • XML sitemap taxonomy 6.x-2.0-alpha1 and:
  • XML sitemap user 6.x-1.2

In ./sites/all/modules/xmlsitemap, I have:

# ls
CHANGELOG.txt  xmlsitemap.admin.inc  xmlsitemap.inc      xmlsitemap_node
gss            xmlsitemap.api.php    xmlsitemap.info     xmlsitemap.pages.inc
INSTALL.txt    xmlsitemap_custom     xmlsitemap.install  xmlsitemap_taxonomy
LICENSE.txt    xmlsitemap.drush.inc  xmlsitemap.js       xmlsitemap.test
README.txt     xmlsitemap_engines    xmlsitemap_menu     xmlsitemap_user
translations   xmlsitemap_i18n       xmlsitemap.module   xsl

In ./backup/modules, the last backup folder still is dating from 20100130024101.

So as it seems, Drush (a) does not back up the module's folder when updating a contributed module with something like drush dl xmlsitemap-6.x-2.0-alpha1, and it does not cleanly replace the module's folder.

When manually deleting the directory ./sites/all/modules/xmlsitemap, XML sitemap user 6.x-1.2 is gone from ./admin/build/modules. I'll check my other sites and report back later. Let's see if this behaviour of Drush is intended (this applies to drush.php from January 6th).

Edit: Upgraded to Drush "All-versions-3.0-alpha1" from 2010-Jan-26; it's the same behaviour: When dowing an drush dl xmlsitemap-6.x-2.0-alpha1, no module folder's backup is created, so possibly the new version isn't replaced correctly, either.

Greetings, -asb

asb’s picture

Side note: After finishing the steps described in #6, watchdog started to be flooded with warnings like:

user warning: Unknown column 'lastmod' in 'field list' query: SELECT loc, access, status, lastmod, priority, changefreq, changecount, language FROM xmlsitemap WHERE type = 'node' AND id = 3093 LIMIT 0, 1 in /var/www/drupal/sites/all/modules/xmlsitemap/xmlsitemap.module on line 533.
user warning: Unknown column 'lastmod' in 'field list' query: INSERT INTO xmlsitemap (id, type, subtype, loc, language, access, status, status_override, lastmod, priority, priority_override, changefreq, changecount) VALUES (3093, 'node', 'gallery_image', 'node/3093', '', 1, 1, 0, 1265673969, 0.8, 0, 0, 0) in /var/www/drupal/sites/all/modules/xmlsitemap/xmlsitemap.module on line 867.
moshe weitzman’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

i can't make heads or tails of these posts. please specify problems clearly and tersely.