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
Comment #1
OsterD commentedWhen browsing on page admin/config
Comment #2
dave reidHave 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.
Comment #3
OsterD commentedMaybe my development server is the one to blame.
I'll come back to it.
Comment #4
TallDavid commentedI 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:
Attempting to uninstall xmlsitemap_node via Drush 4 pm-uninstall yields:
In the current state, I can't enable or uninstall xmlsitemap. Suggestions?
Note to self: aft.c
Comment #5
TallDavid commentedI found a work around that solved the problem on this installation:
Comment #6
dejavu_007 commentedFound 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
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.
Comment #7
dave reidComment #8
dave reidIf 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.
Comment #9
mgiffordOr you can just uninstall the module & then re-install it. That seemed to work fine for me with beta2 - Thanks!
Comment #11
bhosmer commentedI 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.
Comment #12
mdlamar commentedI'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.
Comment #13
Anonymous (not verified) commented@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.
Comment #14
mdlamar commentedExcellent! Thank you earnie! I should've known better.
Comment #15
djflux commentedAgree 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.
Comment #16
groovyart commentedComment #17
barnettech commentedThis 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
Comment #18
petrovnn commentedIdea 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
Comment #19
eigentor commentedThis 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.
Comment #20
Anonymous (not verified) commented@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.
Comment #21
Anonymous (not verified) commentedFantastic 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
Comment #22
jmlavarenne commentedUseful to me to do steps 3 #17:
DELETE FROM `system` WHERE `filename` LIKE '%xmlsitemap%';
Comment #23
Manohar@007 commentedi 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:
Comment #24
yan commentedJust 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".
Comment #25
noduslabs commented#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.
Comment #26
liquidcms commentedI am not doing an upgrade. I simply added this module and installed from drush. most likely there is a bug in the install file.