I released a new site yesterday and tonight its first cronjob appeared *yay*.

Unfortunatley the sitemap was sent to times to all searchengines:

xmlsitemap 21.08.2009 - 05:05 Die Sitemap wurde erfolgreich an Yahoo! übertragen. Gast
xmlsitemap 21.08.2009 - 05:05 Die Sitemap wurde erfolgreich an Google übertragen. Gast
xmlsitemap 21.08.2009 - 05:05 Die Sitemap wurde erfolgreich an Bing (formerly Live ... Gast
xmlsitemap 21.08.2009 - 05:05 Die Sitemap wurde erfolgreich an Ask.com übertragen. Gast
xmlsitemap 21.08.2009 - 05:05 Die Sitemap wurde erfolgreich an Yahoo! übertragen. Gast
xmlsitemap 21.08.2009 - 05:05 Die Sitemap wurde erfolgreich an Google übertragen. Gast
xmlsitemap 21.08.2009 - 05:05 Die Sitemap wurde erfolgreich an Bing (formerly Live ... Gast
xmlsitemap 21.08.2009 - 05:05 Die Sitemap wurde erfolgreich an Ask.com übertragen. Gast

My crontab:
5 5 * * * wget -O - -q -t 1 http://www.example.com/cron.php

Do you have any ideas why this happens? Could this be the matter why google has no content indexed yet?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Status: Active » Fixed

There is no reason that I know of that should cause the cron hook to execute more than once other than perhaps the instance of using cron.php in a crontab and having poorman's cron enabled at the same time. I do use this module in a live site and have zero issues with submitting the sitemap to search engines. Google would be the only one to answer why your site isn't indexed by their service. I doubt that this issue would be a result to non-index.

SaxxIng’s picture

Version: 6.x-1.0-rc2 » 6.x-1.1
Status: Fixed » Active

Same problem to me too.
I have a site with two languages (but english is not the default one) and "Add all the links to the default language sitemap" checked. Is this a possible cause?
The duplicated log row are exactly identical (time and text).
Ask me if you need some other infos!
Regards,
Saxx

Anonymous’s picture

Maybe possible. Are you able to test different scenarios to narrow down what you see?

Dave Reid’s picture

This happens because of this code in xmlsitemap_engines_cron():

  // Get a list of enabled languages.
  $languages = language_list('enabled');
  $languages = $languages[1];

  foreach ($languages as $language) {
    if (!isset($engine)) {
      foreach ($engines as $id => $info) {
        if (variable_get("xmlsitemap_engines_{$id}_submit", FALSE)) {
          xmlsitemap_engines_submit_sitemap($info[0], "xmlsitemap_engines_{$id}_url", $info[1], $language);
        }
      }
    }
    elseif (isset($engines[$engine])) {
      xmlsitemap_engines_submit_sitemap($engines[$engine][0], "xmlsitemap_engines_{$engine}_url", $engines[$engine][1], $language);
    }
  }

We automatically submit sitemaps for all enabled languages. One of the issue reporters already established he has two enabled languages. I'd be willing to bet the original issue reporter has two languages as well. With the change to xmlsitemap_engines_submit_sitemap() in #537140: Error occurred submitting sitemap to Google: 400. you would see the different language sitemaps in the watchdog messages.

What we should do is skip looping through all languages if variable_get('xmlsitemap_all_links_to_default_language', 0) is TRUE and only submit the default language sitemap.

Dave Reid’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Component: xmlsitemap.module » xmlsitemap_engines.module
Assigned: Unassigned » Dave Reid
Category: support » bug
Status: Active » Needs review
FileSize
1.03 KB

Please give the attached patch a try. If you have the "Add all the links to the default language sitemap" option enabled, it should only submit once to each search engine.

xmarket’s picture

Hi!

I applied this patch on my site without errors, and seems to be working very well. I run the cron many times, and the problem disappeard. On my site the "Add all the links to the default language sitemap" option enabled, and my sitemap not submitted any of the search engines. The content didn't changed on my site during the test, and I use the xmlsitemap 6.x-1.1 version.

a.a.egoroff’s picture

Subsr. I`m near site release. I will test patch as soon as possible.

haggins’s picture

Thanks for the patch but I don't think it will work for me since I have only one enabled language (german). I'm too busy at the moment to have a deeper look into this issue, sorry.
"Add all the links to the default language sitemap" is disabled.

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community
Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

edjay’s picture

Status: Closed (fixed) » Active

I have the same problem with one language enabled only, i have tested to enable "Add all the links to the default language sitemap" but it seems not working

Dave Reid’s picture

@edjay Are you using the latest 6.x-1.x-dev? Because this fix isn't yet included in the official release.

edjay’s picture

Ok sorry and thx Dave, i am using the recommended version.
Do you think i can switch to the dev without meeting many problems ?

Dave Reid’s picture

Status: Active » Fixed

@edjay: No, there shouldn't be any problems using the dev versions like there were before. When we make a 6.x-1.2 release though, you'll want to upgrade to that again.

edjay’s picture

Oki, very nice Dave and thx for this module

Status: Fixed » Closed (fixed)

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