Just experienced with commons. Dealt with UploadStashBadPathException
authorSam Reed <reedy@users.mediawiki.org>
Wed, 18 Jan 2012 21:20:50 +0000 (21:20 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 18 Jan 2012 21:20:50 +0000 (21:20 +0000)
path doesn't exist
Backtrace:
#0 /home/wikipedia/common/php-1.18/maintenance/cleanupUploadStash.php(68): UploadStash->getFile('zyvzeiza5hg.xab...', true)
#1 /home/wikipedia/common/php-1.18/maintenance/doMaintenance.php(105): UploadStashCleanup->execute()
#2 /home/wikipedia/common/php-1.18/maintenance/cleanupUploadStash.php(75): require_once('/home/wikipedia...')
#3 /home/wikipedia/common/multiversion/MWScript.php(73): require_once('/home/wikipedia...')
#4 {main}

maintenance/cleanupUploadStash.php

index 788f0f5..e46b853 100644 (file)
@@ -69,8 +69,13 @@ class UploadStashCleanup extends Maintenance {
                $stash = new UploadStash( $repo );
 
                foreach( $keys as $key ) {
-                       $stash->getFile( $key, true );
-                       $stash->removeFileNoAuth( $key );
+                       try {
+                               $stash->getFile( $key, true );
+                               $stash->removeFileNoAuth( $key );
+                       } catch ( UploadStashBadPathException $ex ) {
+                               $this->output( 'Failed removing stashed upload with key:' . $key );
+                               continue;
+                       }
                }
        }
 }