From c174bbe88089245241fb2b9a21886cc09d508374 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 18 Jan 2012 21:20:50 +0000 Subject: [PATCH] Just experienced with commons. Dealt with UploadStashBadPathException 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/maintenance/cleanupUploadStash.php b/maintenance/cleanupUploadStash.php index 788f0f59a5..e46b85350b 100644 --- a/maintenance/cleanupUploadStash.php +++ b/maintenance/cleanupUploadStash.php @@ -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; + } } } } -- 2.20.1