I am using this module with amazons3. The sitemap is generating as expected and I can find the file. However, when I navigate to /sitemap.xml, the file is truncated at line 32. Since it is technically invalid, Chrome/Safari don't display the formatting, and the file appears blank, but the truncated data is visible in the source. I relatively few nodes and the http request is returning 200 OK. I've cron/cleared cache in Drupal/cleared cache in browser. Any help would be appreciated. Linux, PHP 5.3.

Additionally, when I click on the Edit action for my sitemap from the admin panel, I get a message "There are currently no XML sitemap contexts available." I don't know what this means, or if it is bad, or if it is relevant. This may be related to #1445174: Document how to add content, but since the original commenter pretty much answered his own question and was making a point about documentation, I thought I would open a bug issue.

I don't really know what component this is related to, so I picked the first one.

Any help would be greatly appreciated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

djake’s picture

Status: Active » Needs review
FileSize
542 bytes

The file was truncating because the database was not updating the size of the file. There was also a watchdog message saying "Failed to delete file because it does not exist."

It appears the problem may have been due to a drupal_realpath() call in _xmlsitemap_delete_recursive. This breaks functionality with stream wrappers (see #1201024: drupal_realpath() should describe when it should be used and #1083982: Fix support for remote streamwrappers). The attached patch simply removes the rewrite of the path, and the module now appears to be functioning correctly.

There are also a couple other calls to drupal_realpath which I did not remove but could submit an updated patch if that's helpful.I'm relatively new to the forum so if I've done something wrong with the patch or the meta tags, please let me know.

Status: Needs review » Needs work

The last submitted patch, xmlsitemap-recursivedeletepath-2055143-1.patch, failed testing.

djake’s picture

Version: 7.x-2.0-rc2 » 7.x-2.x-dev
FileSize
552 bytes

Trying this again..sorry for the noise

djake’s picture

Status: Needs work » Needs review
FileSize
552 bytes
bkonetzny’s picture

Fix from #4 solves the delete issue on s3.

mgifford’s picture

Issue summary: View changes

Would be so much nicer to have this fixed so that there was a patch that could go in an upcoming release:

  // If not on Amazon S3, then:
  if (!(substr($path, 0, 5) == 's3://')) {
    // Resolve streamwrapper URI to local path.
    $path = drupal_realpath($path);
  }
mgifford’s picture

Title: Sitemap generates correctly but truncated on delivery » Sitemap generates correctly but truncated on delivery - amazons3
Issue tags: +amazons3

I'm also getting this error:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=1042&op=do StatusText: Service unavailable (with message) ResponseText:

mgifford’s picture

Status: Needs review » Needs work

I'm also getting this fatal error

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=1107&op=do StatusText: Service unavailable (with message) ResponseText:

contrib/xmlsitemap/xmlsitemap.module

And can't load the /sitemap.xml