You are here

Drupal XMLSiteMap: public://xmlsitemap/ not found or not writable

Submitted by Druss on Fri, 2014-04-11 00:48

I ran into the following error (or something like it) while setting up Drupal's xmlsitemap module:

public://xmlsitemap/lOtsOfgoBBlDegOOk not found or not writable

This is as expected some kind of permissions issue. Why the module can't sort this on its own, I do not know. As with everything Drupal, clear the cache first to see if that fixes things. It sometimes does. If not, you will need to get your hands dirty on the commandline (if linux):

  1. Go to your site's files directory. This should typically be somewhere like:
    sites/foo.example.com/files/
    within your Drupal (7) installation.
  2. You should find a directory named xmlsitemap. If you use an ls -l, you should be able to find out what its permissions are. In my case, it read:
    drwxrwxr-x 3 www-data www-data  4096 Mar 24 11:13 xmlsitemap

    Note that the "owner" and "group" are both www-data which has write permissions to this directory.

  3. If you enter this directory, you should be able to find a directory where the xmlsitemap module stores the sitemap. On my box this read something like:
    drwxrwxr-x 2 druss druss 4096 Apr 10 15:05 UTYUiutuyjh765uytuytujgjhgujhg76776yyygh
    Note that only the user druss has write permissions here. "All" users do not.
  4. Changing the ownership here to www-data using:
    sudo chown -R www-data UTYUiutuyjh765uytuytujgjhgujhg76776yyygh
  5. Clear the Drupal cache once again to see if this fixes things. It did for me.

Again, why the module can't do this by its own, I do not know.