• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 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.

Item7428: No useful error code provided from unzip when restore fails

Item Form Data

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

Edit Form Data

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


-- TWiki:Main/EricSchultz - 2014-02-05

I recently was using the restore feature of the BackupRestore plugin, and it failed with an Error:

ERROR: Can't unzip twiki-backup-2014-02-04-17-02.zip.

But that was it - no further information. Apparently, unzip doesn't print anything to STDERR, so you don't get anything useful from this code:

$this->_setError( "ERROR: Can't unzip $name. $stdErr" );

I've made this small change so you also get the exit code from unzip, which is vastly more helpful:

@@ -1212,7 +1212,8 @@
my @cmd = split( /\s+/, $this->{unZipCmd} );
my ( $stdOut, $stdErr, $success, $exitCode ) = capture_exec( @cmd, $zipFile );
if( $exitCode ) {
- $this->_setError( "ERROR: Can't unzip $name. $stdErr" );
+ my $newcode = ($exitCode & 0xff00) >> 8;
+ $this->_setError( "ERROR: Can't unzip $name. $stdErr ($newcode)" );

In my case, $newcode ended up being 50, which is "out of disk space" (I had forgotten to change from the default of /tmp for extraction). I didn't know this without that exit code smile

Summary No useful error code provided from unzip when restore fails
ReportedBy TWiki:Main.EricSchultz
Codebase 6.0.0
SVN Range TWiki-6.0.1-trunk, Thu, 09 Jan 2014, build 26720
AppliesTo Extension
Component BackupRestorePlugin
Priority Low
CurrentState New


TargetRelease n/a

Topic revision: r1 - 2014-02-05 - EricSchultz
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback