If you are receiving this error then please ensure that your files directory has write permissions for the httpd service. The most secure setting would be to ensure the group for the files directory is the same as the httpd service owner and give the group on the files directory read, write and execute permissions. If you have the correct permissions and still receive this error then please tell us in a comment below.
ORIGINAL SUMMARY:
I have set up a Drupal 7.12 on a local LAMP running on Debian for a restailying of a site of mine.
Trying to use XML sitemap 7.x-2.0-rc1 and I get the following error while trying to generate the sitemap:
Warning: XMLWriter::openUri(): Empty string as source in XMLSitemapWriter->openUri() (line 40 of /srv/www/silicongadget.com/public_html/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc).
Please tell me if you need any particular info.
Comment | File | Size | Author |
---|---|---|---|
#19 | remove_deprecated_realpath-1554488-5.patch | 519 bytes | Dr Jay |
#18 | s3-open-uri-1554488-18.patch | 972 bytes | Anonymous (not verified) |
#14 | xmlsitemap-s3-open-uri-1554488-14.patch | 795 bytes | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedRelated: #920062: XMLWriter::openUri(): Unable to resolve file path as returned from xmlsitemap_sitemap_get_file.
Comment #2
davidcsonka CreditAttribution: davidcsonka commentedI get the same error. Running Drupal 7.14, 7.x-2.0-rc1, on a Centos multi-site installation.
Comment #3
mgiffordI got the same issue on CentOS as well.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedPlease do not change the Version parameter.
Comment #5
jampsi CreditAttribution: jampsi commentedI got the same error message just after enabling the module:
Warning: XMLWriter::openUri(): Empty string as source in XMLSitemapWriter->openUri() (line 40 of /var/www/drupal/sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc).
Comment #6
kaidjohnson CreditAttribution: kaidjohnson commentedI was also getting this error when enabling the module. It turns out that my public:// directory (usually sites/default/files, but may differ based on your site settings) did not have the proper permissions and wasn't writable, so the xmlsitemap directory that needs to get created does not get created so the argument passed through XMLSitemapWriter->openUri() path doesn't exist.
I resolved this simply by setting the permissions of my public:// directory to be writable by the web server user (www-data in my case).
Hope it helps!
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commented@kaidjohnson: Thanks for the update. Based on your resolution I updated the issue summary.
Comment #8
vanvemdenHaving this issue on Drupal 7.15 install with XML Sitemap 7.x-2.0-rc2 and with the sites default download method set to 'Amazon Simple Storage Service'. When dumping the $uri variable used in public function openUri($uri) in xmlsitemap.xmlsitemap.inc, this is set to 's3://xmlsitemap/NXhscRe04…..'. In the xmlsitemap admin settings the sitemap cache directory is set to s3://xmlsitemap, where the S3// cannot be changed.
Could this be the problem? Should the path not be set to the public file system path, default 'sites/default/files'? Unfortunately I don't have enough knowledge to come up with a patch, but hopefully this will help finding a speedy solution.
Happy New Year, by the way.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commented@vanvemden: What is the owner:group and permissions for sites/SITE/files or sites/default/files?
Comment #10
vanvemden@earnie: Permissions for sites/default/files is set to 755. Owner and group are set to the account name used to do the Drupal install on the server (which is also the same owner/group for all the other directories). As other modules (e.g. Ctools and CSS injector) had no trouble adding subdirectories in the sites/default/files/ folder, I thought this could not be the problem. Thanks for any help you can provide.
Comment #11
borgenk CreditAttribution: borgenk commentedSeems to be an issue when default stream is s3:// as @vanvemden pointed out. Not sure if the problem lies with the xmlsitemap or amazon s3 module though.
Resolved with this hack for now:
Comment #12
vanvemden@borgenk: Thank you, thank you! It worked!
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedCan you work that into a proper patch, please? Also what are the timing differences before and after the patch with http://?
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedcreated a patch based on #11
Comment #15
gregglesPatches "need review".
Thanks, @r_smylski!
Comment #17
Anonymous (not verified) CreditAttribution: Anonymous commentedYou need to use ``git diff'' in order to for the test environment to be happier.
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedre-worked patch
Comment #19
Dr Jay CreditAttribution: Dr Jay commentedI think this approach may be too specific. The answer is more likely to be in the drupal_realpath call in the method as the function is deprecated:
As an alternative, we can use file_create_url to accomplish the same end without the assumptions of drupal_realpath. Submitting a patch for this solution:
Comment #20
haysuess CreditAttribution: haysuess commented#18 worked for me, #19 did not.
With #19 I got these messages:
Comment #21
bkonetzny CreditAttribution: bkonetzny commentedCan confirm that patch from #18 works (despite the fact that my file now is not on s3) whereas #19 produces the same s3 error message as in #20.
Comment #22
Anonymous (not verified) CreditAttribution: Anonymous commentedGetting the same error when running Drupal multisite. "Site 1" running from sites/default is fine but "Site 2" running from folder sites/example.com produces:
"Warning: XMLWriter::openUri(): Empty string as source in XMLSitemapWriter->openUri() (line 40 of /var/www/html/sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc)."
Comment #23
ressa CreditAttribution: ressa commentedThanks @kaidjohnson (#6). The newly created xmlsitemap folder owners were MY_USER_NAME:MY_USER_NAME
Updating it to MY_USER_NAME:www-data with
sudo chown -R MY_USER_NAME:www-data .
fixed it.Comment #23.0
ressa CreditAttribution: ressa commentedAdd potential resolution to issue summary.