3

We're having trouble with the Google sitemap feature in Magento 1.9.0.1. When generating the sitemap the error "Unable to generate the sitemap.".

The file sitemap.xml is created but only contains the following lines:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

We've tried adding a new sitemap and changing the location of the sitemap.xml file but that doesn't change anything.

Any help on the matter would be greatly appreciated.

4
  • Can you try going through this inchoo.net/magento/manual-creation-of-google-sitemap-in-magento
    – seb
    Commented Feb 26, 2015 at 8:31
  • Tried this (the full url = aedwinkel.nl/index.php/admin/sitemap/generate/sitemap_id/7). But this just bounces me to the admin page. No file is created on the server
    – Kris Coady
    Commented Feb 26, 2015 at 8:42
  • are the rights etc correct on the sitemap.xml file and its parent dir? Commented Feb 26, 2015 at 13:10
  • 1
    Chmodding the /sitemap/ folder or the /sitemap/sitemap.xml file to 777 doesn't make any difference. I'm not convinced the problem is caused by rights malfunction, as the sitemap.xml file is created upon generating a sitemap. I believe the problem occurs while reading data from perhaps the database, but I have no idea how to debug this.
    – Kris Coady
    Commented Feb 26, 2015 at 14:47

1 Answer 1

1

You're getting this error because an Exception is thrown during the sitemap generation process.

     if ($sitemap->getId()) {
        try {
            $sitemap->generateXml();

            $this->_getSession()->addSuccess(
                Mage::helper('sitemap')->__('The sitemap "%s" has been generated.', $sitemap->getSitemapFilename()));
        }
        catch (Mage_Core_Exception $e) {
            $this->_getSession()->addError($e->getMessage());
        }
        catch (Exception $e) {
            $this->_getSession()->addException($e,
                Mage::helper('sitemap')->__('Unable to generate the sitemap.'));
        }
    }

But the addException method replaces the original error with the alternative text "Unable to generate the sitemap".

To find out what the problem is you need to check your var/log/exception.log file (make sure logs are enabled first) and/or the var/reports folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.