Last modified: 2014-09-02 12:23:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32916, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30916 - Trying to delete a file, which fails (when trying to move to archive), generates a false recent changes entry, and doesn't delete the file
Trying to delete a file, which fails (when trying to move to archive), genera...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Page deletion (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-15 17:50 UTC by Sam Reed (reedy)
Modified: 2014-09-02 12:23 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Recentchanges showing delete entries, but files/pages still exist (9.55 KB, image/png)
2011-09-15 17:50 UTC, Sam Reed (reedy)
Details

Description Sam Reed (reedy) 2011-09-15 17:50:30 UTC
Created attachment 9063 [details]
Recentchanges showing delete entries, but files/pages still exist

Noticed on eswikibooks, when trying to batch delete (using deleteBatch.php) all files:


Archivo:02265 suciedad 3.jpg
Warning: wfMkdirParents: failed to mkdir "/mnt/upload6/private/archive/wikibooks/es/m/6/g" mode 511 in /home/wikipedia/common/php-1.17/includes/GlobalFunctions.php on line 2354

http://es.wikibooks.org/wiki/Archivo:02265_suciedad_3.jpg

Not sure if it's just an issue with the deleteBatch, but if it can't delete, the whole thing should abort, and not generate the RC entry
Comment 1 Sam Reed (reedy) 2011-09-15 18:00:44 UTC
In these cases, it seems it's deleted the page, but the image still exists, and is also a dupe of one on commons
Comment 2 Sam Reed (reedy) 2011-09-16 11:29:05 UTC
So yeah, if it can't create the archive folders, the whole delete should abort and rollback...
Comment 3 Brion Vibber 2011-09-16 18:08:02 UTC
deleteBatch seems to act differently from the UI deletion...

Looks like it first deletes the image, then deletes the page. If the file deletion fails, it will print a warning message... but continue on deleting the page anyway.

deleteBatch also assumes that failure from File->delete will return something evaluating to false, which seems to match its doc comments... but LocalFile->delete claims it actually returns a status object. 

So it may be getting a status object saying it's failing, thinking that's success, and then continuing along deleting the pages anyway.


So I think what's happening is:
* it's failing to delete the files, and doesn't detect that fact
* it is deleting the pages regardless of whether the image delete succeeds
* the page delete saves a log entry
* the link still shows blue instead of red because the file still exists


(Note that when deleting through the web UI, you end up going through FileDeleteForm which hits the article first and then the image, IIRC. Eek! It at least attempts to roll back the page deletion, but with all the stuff we have in there these days I don't know if that actually works as expected.)

Short fix should be something like:
* update doc comment on File->delete to match LocalFile->delete etc
* fix deleteBatch (and any other callers of File->delete) to check status objects
* change deleteBatch to skip over the page if the image won't delete properly

Longer fix probably involves refactoring the delete / doDelete on Article / WikiPage / ImagePage to be more consistent and handle that for us. :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links