today I had to debug the reason why dokuwiki's indexer.php does not create a google sitemap, although the root directory is writeable. The problem here is line 229 in indexer.php:
if(!is_writable(DOKU_INC.$sitemap)) return false;
This will return false if the file does not exist!
Attached patch fixes this behaviour and adds a line to show the error.