Hello

I have this problem with xmlsitemap.
I have upgraded to lastest 5.x-1.x-dev (27-nov-2007) but still have the same problem.

Whenever I edit or update a node, the sitemap should be updated, but this ends in an error displayed in pages like this

* Impossibile copiare il file selezionato (/var/www/vhosts/prometeoinformatica.it/httpdocs/portale/tmp/fileWgJQK7).
* Unable to load site map. Make sure your temporary directory exists and is writable by Drupal.

Localization is in italian, so the first line should sound like (don't know exact phrase in english)
* Unable to copy the selected file (/var/www/vhosts/prometeoinformatica.it/httpdocs/portale/tmp/fileWgJQK7).

After the procedure, the file /var/www/vhosts/prometeoinformatica.it/httpdocs/portale/tmp/fileWgJQK exists, but I don't know what happens.
The tmp directrory is chmod 777 so everyone should be able to do everything inside there.

This bug happens on two different drupal sites, on different servers and different providers (different software, different policy)

Please let me know if more informations are needed.

Thanks
Best regards
Gianluca Bonetti

Comments

Darren Oh’s picture

This happens when Drupal is unable to overwrite an existing file in your files directory.

deverman’s picture

I also have this problem and reported it in the past but it was not resolved to my knowledge. I don't know how to set the permissions on the directory or patch the module correctly.

Anonymous’s picture

Hello Darren

I'm sorry but I cannot see why Drupal cannot overwrite existing files in directories.

In my specific case, under /var/www/vhosts/prometeoinformatica.it directory I have
/httpdocs (mode 0755)
/httpdocs/portale (mode 0755)
/httpdocs/portale/files (mode 0777)
/httpdocs/portale/tmp (mode 0777)

So files and tmp directories are world-readable and world-writable.

If I clean the tmp directory and manually ask for cron job run, same error is reported again.
It says it cannot copy the temporary file 'fileehcylX' (for example) but if I look at the tmp directory, 'fileehcylX' exists and is created by Drupal with mode 0600.
Where would it like to copy the file? The 'files' directory is world writeable.

The problem is not provider-related, as other 2 sites hosted by other 2 different providers give me the same error.

Thanks to everybody who could help me to find a solution.
Hope it helps others to solve the problem.

Best regards
Gianluca Bonetti

Darren Oh’s picture

Status: Active » Postponed (maintainer needs more info)

XML Sitemap must be able to create an xmlsitemap directory in the files directory. It must then be able to copy site map files to that directory and overwrite them when the site map is updated.

If you are using Unix or Linux, run 'ls -l' in the files directory and the xmlsitemap directory if it exists. Determine the user that PHP runs as and make sure it matches the owner of the xmlsitemap directory.

Darren Oh’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Closed (fixed)

Most likely xmlsitemap directory has been deleted from your files directory. Disable and re-enable the module to recreate the directories.

Darren Oh’s picture

Updated error message in CVS commit 90828.

Darren Oh’s picture

Version: 5.x-1.x-dev » 5.x-1.3
Status: Closed (fixed) » Fixed
deverman’s picture

I installed the latest development version of this module. it does not correctly create the xmlsitemap directory properly. If I activate the module it creates a directory like this:

drwxrwxr-x 2 apache apache 1024 Dec 11 11:30 xmlsitemap

I must then change permissions on the directory to:

drwxrwxrwx 2 myuser psaserv 1024 Dec 11 11:30 xmlsitemap

This is on a VDS server running plesk. I would still consider this a bug because it doesn't work out of the box.

Darren Oh’s picture

Unfortunately this is not under the control of XML Sitemap.

Rodeo.be’s picture

I have the same problem, on my multisite configuration (running on Plesk).

How can I change permissions of the directory (using SSH)?

greg@beargroup.com’s picture

Status: Fixed » Active

Ran into this same issue.

It might be better to change the folder auto-creation logic, and instead require that a directory in /files/xmlsitemap be manually created by the user of this module, like you do when you first create a /files directory. Then the permissions would not need to be reset - the way it functions now requires an SSH login as root to chown the apache:apache user & group - which a lot of people won't have access to change.

-G

Darren Oh’s picture

Status: Active » Fixed

I don't understand you. Normally Drupal creates the files directory with the correct permissions. The xmlsitemap directory is also created with the correct permissions. Many modules create directories. It's a great convenience for most people.

If some people choose to use systems which create directories with incorrect permissions, they will have to create the directories manually before installing these modules. The best we can do for them is provide an error message which accurately describes the problem. This has been done.

tydushikari’s picture

when i explore my drupal website with xml sitemaps, i found there are sitemaps file (compressed with .gz). XML-Sitemaps module create sitemap file, but it located in yourdomain.com/files/xmlsitemap/sitemap.xml.gz.

I don't know why xml sitemaps module didn't make a file to yourdomain.com/sitemap.xml. It will make us better to submit to search engine.

Thanks

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

greg.harvey’s picture

Version: 5.x-1.3 » 5.x-1.7
Component: xmlsitemap » xmlsitemap.module
Category: support » bug
Status: Closed (fixed) » Active

Latest 5.x version of xmlsitemap. Permissions on files/xmlsitemap are:

drwxrwxrwx  2 apache apache   4096 Apr  8  2009 xmlsitemap

Permissions *within* that directory are:

[root@server tmp]# ls -la ./httpdocs/files/xmlsitemap/
total 256
drwxrwxrwx  2 apache apache   4096 Apr  8  2009 .
drwxrwxrwx 10 root   root   241664 Oct 14 14:03 ..
-rwxrwxrwx  1 apache apache   3698 Apr  8  2009 gss.xsl
-rwxrwxrwx  1 apache apache   4271 Sep 29 14:14 sitemap.xml.gz

The core File system is happy. Permissions on tmp directory are:

drwxrwxrwx  2 root     root        4096 Oct 14 14:53 tmp

Permissions on files *created* by xmlsitemap.module are:

[root@server tmp]# ls -la
total 16
drwxrwxrwx  2 root   root   4096 Oct 14 14:53 .
drwxr-xr-x 16 root   root   4096 Oct 14 14:52 ..
-rw-------  1 apache apache 3917 Oct 14 14:53 filevW1BGd

When I update a piece of content I get this message:

The selected file /var/www/vhosts/mysite.co.uk/tmp/filevW1BGd could not be copied.
Unable to load site map. Make sure that there is an xmlsitemap directory in your files directory and that it is writable by Drupal.

As you can see, there *is* an xmlsitemap directory, it *is* writeable by Drupal, so are the files within it. The only thing in this entire process that is *not* set to 777 permissions is the file created by apache when xmlsitemap.module creates it's temporary resource. But even that is readable and writeable by the apache user, so I don't see why it wouldn't copy.

I'm stumped! Feels like a bug, but I can't see much wrong with the module, so I don't know. Any enlightenment gratefully received! =/

Anonymous’s picture

Version: 5.x-1.7 » 5.x-1.3
Category: bug » support
Status: Active » Closed (fixed)

Open a new issue.

leenas’s picture

Just had this same issue with one of my sites. Turning PHP Safe Mode Off fixed it.

Hope this helps!
Leenas

Check out my new beta site.... http://www.sportymule.com