I am sure it comes as little surprise from the direction of my posts lately that I have been up to my nose in Drupal management and development. With that I have found some tweaks and quirks of the system I am trying to document, partly for my own good later on for reference, and partly for anyone else that has the problem and may find this blog.
Most recently I have developed a Drupal based site for a client on my multisite install, and, after development, had to move it to another server.
This presents issues of file and folder permissions and ownership, and most any shared hosting has no ability to run a CHOWN (change owner) functions on files or folders, though most allow CHMOD (change mode).
When Drupal is installed, the user sets the domain folder to a 0777 CHMOD and, during install, it creates a few subfolders for file uploads, theme settings and images and any other user storage needs. When it creates these folders it is owned by "apache" (or whatever the web server is) and CHMOD of 0775, which allows the server to read and right to and from those folders with no problems. However, when the web site is moved to a new server, if you download the existing site, and upload it all to a new server, all folders are owned by the user and typically has default permissions of 0755, and files of 0644.
To work around this, typically setting all those same files and folders to 0777 and leaving the ownership as user owned is a valid and workable tactic. But there are some cases where it does not. I recently learned that in one case, the module xmlSiteMap, the site map is not retrievable with those permissions.
Should you encounter such errors with xmlSiteMap, or any other file creating module or the core of Drupal, what I have found the quickest and easiest way to get around the problems is simply to delete the directory altogether, and go back to the module or theme and rebuild it by rerunning the configuration of said module or theme. Doing so will rebuild the necessary directories and files with proper permissions on each.