Note: I believe this problem also affects 6.x-2.0-beta2, but not 6.x-2.0-beta1. I have verified that XMLWriter is installed. Note: I have also had similar problems with beta3 at least (not sure about beta2) on a linux server, but haven't verified if they're the exact same error messages.
After clicking "Rebuild Sitemap" button, I get this error (I've replaced full Windows path C:\... with [...]):
An error occurred. /batch?id=27&op=do
Fatal error: Uncaught exception 'XMLSitemapGenerationException' with message 'Could not open file sites/default/files/xmlsitemap/NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM/1.xml for writing.' in [...]\sites\all\modules\xmlsitemap\xmlsitemap.xmlsitemap.inc:49 Stack trace: #0 [...]\sites\all\modules\xmlsitemap\xmlsitemap.xmlsitemap.inc(36): XMLSitemapWriter->openUri('sites/default/f...') #1 [...]\sites\all\modules\xmlsitemap\xmlsitemap.generate.inc(152): XMLSitemapWriter->__construct(Object(stdClass), 1) #2 [...]\sites\all\modules\xmlsitemap\xmlsitemap.generate.inc(338): xmlsitemap_generate_page(Object(stdClass), 1) #3 [internal function]: xmlsitemap_regenerate_batch_generate('NXhscRe0440PFpI...', Array) #4 [...]\includes\batch.inc(189): call_user_func_array('xmlsitemap_rege...', Ar in [...]\sites\all\modules\xmlsitemap\xmlsitemap.xmlsitemap.inc on line 49
Continuing on to the error page gives this message:
warning: XMLWriter::openUri() [xmlwriter.openuri]: Unable to resolve file path in [...]\sites\all\modules\xmlsitemap\xmlsitemap.xmlsitemap.inc on line 47.
user error: Could not open file sites/default/files/xmlsitemap/NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM/1.xml for writing. in [...]\sites\all\modules\xmlsitemap\xmlsitemap.generate.inc on line 158.
The sitemap links were not successfully rebuilt.
HOWEVER, I was able to get it working with some manual intervention. Here is what I tried and the resulting behaviors:
- If I manually create an empty text file called "1.xml" (or in fact any number of sequentially-numbered xml files) in the sites/default/files/xmlsitemap/[...whatever...]/ directory before clicking the "Rebuild Sitemap" button, it deletes the file(s), then gives the same error message about not being able to open the file for writing.
- If I then immediately create the empty 1.xml file and refresh the actual rebuild page (with the batch id still in the query string), it does not delete the 1.xml file, but now the error message says it is missing 2.xml.
- Here is where I can get it to work: if I then create a 2.xml file (now there are both 1.xml and 2.xml files) and refresh the actual rebuild page (with the batch id still in the query string), it will build the sitemap successfully using 1.xml, while deleting 2.xml. At the end it still gives various errors that it couldn't find 1.xml and 2.xml for writing, but now visiting /sitemap.xml works.
Comments
Comment #1
sycho commentedI have the same problem and I can't put files in my ftp folder. No rights and chmod 777 won't work either on that folder.
Comment #2
carvalhar commentedsame problem...fresh install.
but downgrade to 6.x-1.2 works.
Comment #3
malks commentedAlso confirming the same issue, and that downgrade works. Additionally this is not working on a Windows system and I've tried using attrib to reset everything on the files with no luck. Deleting the cache directory makes xmlsitemap successfully recreate the directories that it needs, but it is still not able to create the required file. I can re-upgrade to latest version (this is a local test system) if required.
Comment #4
luluberlufondu commentedsolution here : http://drupal.org/files/issues/920062.patch
Comment #5
Anonymous (not verified) commented#920062: XMLWriter::openUri(): Unable to resolve file path as returned from xmlsitemap_sitemap_get_file.
Comment #6
dilari commented#4 helps...
Comment #7
gnucifer commentedPatch works, thanks!