I recently configured a new TWiki 5.1.3 site and am now trying to upgrade it to 5.1.4, using the new BackupRestorePlugin
to move the old wiki data to the new wiki.
Backing up the old wiki through the webinterface works fine, but once I try to restore it on the new wiki, the following errors are thrown:
[Tue Mar 19 15:10:05 2013] backuprestore: cannot remove path when cwd is /tmp/TWiki_BackupRestorePlugin_Daemon/_tmp_restore for /tmp/TWiki_BackupRestorePlugin_Daemon/_tmp_restore: at /var/www/twiki/lib/TWiki/Plugins/BackupRestorePlugin/Core.pm line 760
NOTE: The following webs of twiki-backup-2013-03-19-11-05.zip have been successfully restored: Main, Sandbox, Trash, _empty
ERROR: Can't copy /tmp/TWiki_BackupRestorePlugin_Daemon/_tmp_restore/working/work_areas/README to /var/www/twiki/working/work_areas
Looking at the local file tree, the errors makes sense since the default
TWiki permissions on for example the README file isn't writeable by the owner (the apache user in my case):
# ls -l /var/www/twiki/working/work_areas/README
-r--r--r-- 1 apache apache 192 Feb 17 00:10 /var/www/twiki/working/work_areas/README
This would mean that the file only can be overwritten/modified by the root user. This doesn't comply with the documentation at http://twiki.org/cgi-bin/view/TWiki05x01/BackupRestorePlugin
which states that:
- The utility must run as the same user as the CGI scripts executed by the webserver. This can be
wwwrun or the like, and depends on the webserver configuration.
Executing "chmod u+w /var/www/twiki/working/work_areas/README" fixes the last error as expected. It appears that the "Core.pm line 760" error is fundamentally the same, since both twiki/data/Main and twiki/working contain files with no write permissions for the owner, meaning that the apache user can't delete it's temporary files.
I assume that I can ignore the above errors, but how is this supposed to work at all with a non-root user?
Thanks for reporting this. It needs to be fixed.