• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7700 for generic doc work for TWiki-6.0.2. Use View topic Item7703 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7198: Default fIle permissions cause BackupRestorePlugin to throw errors

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension BackupRestorePlugin Urgent New   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


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:

Important Notes:

  • The utility must run as the same user as the CGI scripts executed by the webserver. This can be apache, nobody, www-data, 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?

-- TWiki:Main/KenniLund - 2013-03-19

Thanks for reporting this. It needs to be fixed.

-- TWiki:Main.PeterThoeny - 2013-03-19

Summary Default fIle permissions cause BackupRestorePlugin to throw errors
ReportedBy TWiki:Main.KenniLund
Codebase 5.1.4, 5.1.3
SVN Range TWiki-5.1.3-trunk, Tue, 19 Mar 2013, build 25461
AppliesTo Extension
Component BackupRestorePlugin
Priority Urgent
CurrentState New


TargetRelease n/a

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2013-03-19 - PeterThoeny
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback