Hi all,

With fresh install of XMLSitemap module, it can't generate XMLSitemap data.
I have this error :

warning: fopen(sites/default/files/xmlsitemap/xmlsitemap-fr-0.xml) 
[function.fopen]: failed to open stream: No such file or directory in /home/drupal/sites/all/modules/xmlsitemap/xmlsitemap.inc on line 192.
user notice: Could not open file sites/default/files/xmlsitemap/xmlsitemap-fr-0.xml for writing. in /home/drupal/sites/all/modules/xmlsitemap/xmlsitemap.inc on line 193.

I have created these 2 files manually and after that it works.
It's not a problem with access rights. Drupal have full access on directory "sites/default/files/xmlsitemap/"

Regards

Comments

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

Do you have any error messages on your status report (admin/reports/status)? Are you sure the web server user has write permissions on the sites/default/files and sites/default/files/xmlsitemap folders? There must be some configuration going wrong here. You're the first user of 6.x-2.x to report this problem.

srobert72’s picture

Status: Postponed (maintainer needs more info) » Active

Yes Drupal (Apache server) has full access to these directories.

When are these files created ?
During installation of module ? Or during generation of XML Sitemap file ?
Maybe I had access problem during installation, but not now it's sure.

dave reid’s picture

The directory should be set up on install, files inside the directory are created during generation of the XML sitemaps.

srobert72’s picture

So if we delete files in sites/default/files/xmlsitemap they should be recreated again during last generation ?
In my case this test doesn't work, they are not recreated.

Extract of rights before I deleted them :
ls -al sites/default/files/xmlsitemap
total 16
drwxrwxr-x 2 www-data www-data 4096 2009-12-29 19:19 .
drwxr-x--- 11 www-data www-data 4096 2009-12-29 19:19 ..
-rw-r--r-- 1 www-data www-data 1866 2009-12-29 19:19 xmlsitemap-en-0.xml
-rw-r--r-- 1 www-data www-data 1892 2009-12-29 19:19 xmlsitemap-fr-0.xml

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

Make sure your Minimum sitemap lifetime is set to 'No minimum' at admin/settings/xmlsitemap temporarily to help debug this. The files should be created whenever the sitemaps are generated then.

Can you also double check for any xmlsitemap error messages in admin/reports/dblog?

srobert72’s picture

I didn't change "Minimum sitemap lifetime" which is still setted as default "No minimum".
I deleted xmlsitemap.xml files to test again. Here are errors :

In Admin Console :

warning: fopen(sites/default/files/xmlsitemap/xmlsitemap-fr-0.xml) [function.fopen]: failed to open stream: No such file or directory in /home/drupal/sites/all/modules/xmlsitemap/xmlsitemap.inc on line 192.
user notice: Could not open file sites/default/files/xmlsitemap/xmlsitemap-fr-0.xml for writing. in /home/drupal/sites/all/modules/xmlsitemap/xmlsitemap.inc on line 193.

and under this

The sitemap was rebuilt.
The directory sites/default/files/xmlsitemap has been created.

In DbLog :

Type	: file system
Date	: Saturday, January 9, 2010 - 11:11
User	: xxxx
Location : 	http://www.example.com/batch?id=53&op=do
Referrer :	http://www.example.com/batch?op=start&id=53
Message : The directory sites/default/files/xmlsitemap is not writable, because it does not have the correct permissions set.
Severity :	error

ls -al /home/drupal/sites/default/files/xmlsitemap

drwxrwxr-x  2 www-data www-data 4096 2010-01-09 08:11 .
drwxr-x--- 14 www-data www-data 4096 2010-01-09 08:11 ..

www-data is Linux user who runs Apache.
Shoul I set write access to All users ? Why ?
With same access to all directories, FileField as no problem to write uploaded files.

dave reid’s picture

Might as well try different permissions on that folder. Might want to try using 775 or rwx-rwx-r-x.

srobert72’s picture

Why FileField upload (for example) can write files without any problem ?

I used chmod 750 as recommended for security reason (I don't remeber where I found that information).
Quick search gives me that :
http://drupal.org/node/244924

dave reid’s picture

That pages shows 770 in its examples, it's worth trying temporarily.

asd123asd5’s picture

actually I have the same problem. for me the file is created under apache:apache instead my usual ownership, even if you chown it, the folder gets deleted and recreated everytime you rebuild.

dave reid’s picture

Ok I found a bug that was deleting the root files/xmlsitemap folder every generation, and changed it to only delete the files in the directory. Please give the latest 6.x-2.x code a try sometime tomorrow after it get repackaged.

asd123asd5’s picture

Hi Dave,

Latest of 6.x-2.x is working perfectly for me. Thank-you!

dave reid’s picture

Status: Postponed (maintainer needs more info) » Fixed

Great to hear. We're actually testing it on a test site for deployment on drupal.org yesterday and encountered the same problem. With the new code it resolved itself. Sorry everyone! :/

srobert72’s picture

Latest 6.x-2.x-dev (2010-Jan-18) is working for me too.
Thank you Dave.

dave reid’s picture

@srobert72: Thanks for the report back here too. Yay!

grahamshepherd’s picture

This worked for me too. Thank you Dave.

Status: Fixed » Closed (fixed)

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