When enabling the module, it comes up with the following 500 error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xmlsitemap_sitemap' doesn't exist: SELECT xmlsitemap_sitemap.* FROM {xmlsitemap_sitemap} xmlsitemap_sitemap; Array ( ) in xmlsitemap_sitemap_load_multiple() (line 362 of sites\all\modules\xmlsitemap\xmlsitemap.module).

Comments

OsterD’s picture

When browsing on page admin/config

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

Have you run update.php? There is a missing table that should have been created in an update function and no one else has had problems running.

OsterD’s picture

Maybe my development server is the one to blame.
I'll come back to it.

TallDavid’s picture

Title: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'odphotography.xmlsitemap_sitemap' doesn't exist » PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table xmlsitemap_sitemap doesn't exist
Status: Postponed (maintainer needs more info) » Active

I am also getting the error on a recently upgraded 6.19=>7.0-RC3 site. Update.php has been run.

Attempting to uninstall 'XML sitemap node' via the D7 UI resulted in this error:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'subtype' in 'where clause': DELETE FROM {xmlsitemap} WHERE (type = :db_condition_placeholder_0) AND (subtype = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => node [:db_condition_placeholder_1] => blog ) in xmlsitemap_link_delete_multiple() (line 687 of .../sites/all/modules/xmlsitemap/xmlsitemap.module).

Attempting to uninstall xmlsitemap_node via Drush 4 pm-uninstall yields:

WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown[error]
column 'subtype' in 'where clause': DELETE FROM {xmlsitemap}
WHERE (type = :db_condition_placeholder_0) AND (subtype =
:db_condition_placeholder_1) ; Array
(
[:db_condition_placeholder_0] => node
[:db_condition_placeholder_1] => blog
)
in xmlsitemap_link_delete_multiple() (line 687 of
.../sites/all/modules/xmlsitemap/xmlsitemap.module).
WD php: Warning: Cannot modify header information - headers already [warning]
sent by (output started at
/home/talldave/.drush/drush/includes/drush.inc:397) in
drupal_send_headers() (line 1040 of
.../includes/bootstrap.inc).
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'subtype' in 'where clause': DELETE FROM {xmlsitemap}
WHERE (type = :db_condition_placeholder_0) AND (subtype = :db_condition_placeholder_1) ; Array
(
[:db_condition_placeholder_0] => node
[:db_condition_placeholder_1] => blog
)
in xmlsitemap_link_delete_multiple() (line 687 of .../sites/all/modules/xmlsitemap/xmlsitemap.module).
Drush command terminated abnormally due to an unrecoverable error. [error]

In the current state, I can't enable or uninstall xmlsitemap. Suggestions?

Note to self: aft.c

TallDavid’s picture

Priority: Critical » Normal

I found a work around that solved the problem on this installation:

  1. Manually DROP the xmlsitemap and xmlsitemap_node TABLES from the database
  2. Re-enable the xmlsitemap module
  3. Run CRON to update old sitemap cache files
dejavu_007’s picture

Found this error while upgrading 6.20 to 7.0.
When I tried update.php, I was not able to run update and got this message

Some of the pending updates cannot be applied because their dependencies were not met.
Status message

No pending updates.

Was not able to uninstall xmlsitemap either.
So did like #5: Support - manually drop the table, uninstalled xml sitemap, re-enabled xml sitemap and run cron. It worked.

dave reid’s picture

Status: Active » Fixed
dave reid’s picture

If you were using the 6.x-1.x version of the module on Drupal 6 and not the 6.x-2.x version, you need to *first* upgrade to 6.x-2.0-beta2 of XML sitemap before attempting your Drupal 7 upgrade.

mgifford’s picture

Or you can just uninstall the module & then re-install it. That seemed to work fine for me with beta2 - Thanks!

Status: Fixed » Closed (fixed)

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

bhosmer’s picture

I think there is an issue with drush when installing this module. When you install it manually, even using the admin interface as opposed to uploading the module, these errors don't occur.

mdlamar’s picture

I'd like to reopen this issue. I'm on the 7.2 core. This problem came to me when I wanted to switch base urls because the site moved. I did as #5 suggested and dropped xmlsitemap and xmlsitemap_sitemap tables. Note: there was no xmlsitemap_node table. Anyway, I thought it might have been a drush issue, so I tried to do it all manually as well. I believe the issue may have been caused by uninstalling all the sub modules at once with drush. After reading the README.txt file I see it is very specific about uninstalling sub-module dependencies in order.

So, here I stand, no xmlsitemap tables, and I've tried my best to purge all existence of xmlsitemap modules from all tables, including cache tables and the variable table. Yet when I reinstall the module it complains about the base table not being there.

I'm willing to hack the dev database if anyone is willing to provide a dump of said tables for xmlsitemap. Or if you have a suggestion about somewhere else in the database that xmlsitemap is checking to see if it's already been installed, I'll dig around. Willing to try anything. Thanks.

Anonymous’s picture

@mdlamar: This sounds as if you did not use the uninstall function of the admin/modules page? Since you've dropped the tables already, if you use it now you will see messages that the tables don't exist but that is fine. Go to the Uninstall tab and uninstall xmlsitemap. Make sure you don't have it enabled. Uninstalling it will allow the module hook_install to fire and recreate the tables.

mdlamar’s picture

Excellent! Thank you earnie! I should've known better.

djflux’s picture

Agree with Comment #11. I tried to install via drush and didn't work. Used the web interface to install the module and it worked just fine. May be an issue with drush and not xmlsitemap.

groovyart’s picture

barnettech’s picture

This problem I didn't have time for, for a long time. Alas here is the solution. My xmlsitemap module is working again: http://www.barnettech.com/content/xmlsitemap-problems

basically: 1.) disable the module
2.) Drop the xmlsitemap and xmlsitemap_sitemap tables
3.) Get rid of all records in the system table that has xmlsitemap in it
4.) Get rid of all records in the menu_links table that has xmlsitemap in it

petrovnn’s picture

Idea from #17 solved my problem. I disabled module, deleted ALL records in database, contained "xmlsitemap" srting (in many different tables). Then install xmlsitemap - all works fine.

My mistake: i start upgrade from drupal 6 to 7, and not updating all modules to latest versions

eigentor’s picture

This is not so easy. Once you have messed it up, it is hard to find and delete all traces of the module in different tables.

What I understood: as long as you cannot run hook_uninstall, the module cannot re-install the module.
@Dave: is it possible to manually remove all traces in the database without running hook_uninstall?

I never was able to run that hook. It did not work when I had the rests of my old 6.x-Stuff in there, after manually deleting the xml_% tables it of course works even less. I have also deleted the entries in the menu_links table, run cache clear after every step.

Might registry rebuild or rebuilding permissions help?
I had problems before with old 6.x tables of modules I did not think about when upgrading to 7, but this one is especially tricky.

Well, reading saves writing. This was easy, following the step

Scenario A: You get the error, and the xml_sitemap or xmlsitemap tables are still in your Database

Try uninstalling from the "Uninstall" tab on the modules page all XML Sitemap modules. If this goes through, you should be fine. Clear cache, and you should be able to run the 7.x version of the module.

Scenario B: You have already gone berserk and manually deleted the tables that start with xml_sitemap or xmlsitemap, or Method A does not work

Go into you database and search for all records containing xmlsitemap. Make sure to make a database backp first, and best test on a local copy!
No go ahead and delete all occurrences of records that contain xmlsitemap. Especially important: menu tables, system table and I would say variables table.

Clear cache.
Now you should be fine to install the 7.x version.

Anonymous’s picture

@eigentor: Did you try to upgrade from 6.x-1.x to 7.x-2.x? You know when upgrading any module you must upgrade to the most recent versions of all your module before you do the major upgrade, right? To manually remove the tables, you also need to consider the variable table rows and the system table row as well as clear your caches.

Anonymous’s picture

Fantastic post, this worked for me.

I was struggling after upgrading Drupal 6 site to 7 and XMLsitemap not working properly.

I followed Scenario B and all fixed.

I love the Drupal community thank you all so much

jmlavarenne’s picture

Useful to me to do steps 3 #17:
DELETE FROM `system` WHERE `filename` LIKE '%xmlsitemap%';

Manohar@007’s picture

i had similar errors.When i delete any field in content type the website encountered an unexpected error.
I am using drupal 7.
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ArmyInstitute.field_data_field_is_the_college_web_site_in' doesn't exist:

yan’s picture

Issue summary: View changes

Just in case somebody stumbles upon this: I had a similar error message because in my settings.php (or in ad drush alias) the database driver was defined as "msqli" and not "msql".

noduslabs’s picture

#17 worked very well - the problem arises because of the upgrade from 6 to 7. simply delete the tables and mentions of xmlmapsite in the system table and reinstall the module.

liquidcms’s picture

I am not doing an upgrade. I simply added this module and installed from drush. most likely there is a bug in the install file.