Last modified: 2014-10-08 11:47:01 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 T42927, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40927 - Moving files results in broken descriptions and deleted images
Moving files results in broken descriptions and deleted images
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.21.x
All All
: Normal major with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 44831 (view as bug list)
Depends on:
Blocks: 28499
  Show dependency treegraph
 
Reported: 2012-10-10 17:29 UTC by Marco
Modified: 2014-10-08 11:47 UTC (History)
13 users (show)

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


Attachments

Comment 1 Sumana Harihareswara 2012-10-12 18:39:06 UTC
Marco, thanks for reporting this. Can you find any pattern in which files are affected?
Comment 2 Sumana Harihareswara 2012-10-12 18:43:11 UTC
For ease in Bugzilla searching, the error message:

API request failed (internal_api_error_DBQueryError): Database query error <i>at Sun, 07 Oct 2012 15:27:11 GMT</i>

Task: movePage
NextTask: removeTemplate
LastTask: reloadPage
Page: File:Hl._Lukas_-_Reliquienschrein_und_Prozessionskerzenhalter.jpg
Skin: vector
[{{fullurl:Special:Contributions|target=Aa1bb2cc3dd4ee5&offset=20121007152843}} Contribs before error]

So, unless this is happening a lot, I think this might have just been a one-time API service outage/hiccup.
Comment 3 Bryan Tong Minh 2012-10-12 22:16:26 UTC
(In reply to comment #2)
> So, unless this is happening a lot, I think this might have just been a
> one-time API service outage/hiccup.

Still, the file moving process should really be resilient against these situations.
Comment 4 Andre Klapper 2012-10-12 22:21:13 UTC
Marco: Is this problem reproducible?
Comment 5 Aaron Schulz 2012-10-12 22:24:15 UTC
(In reply to comment #0)
> Moving of some files results in erroneous behavior: 
> Only partial contents of the files get moved to the new name. The rest of the
> information is either lost or kept on the old file name. 
> 

What do you mean by "partial contents of the files"?
Comment 6 Max Semenik 2012-10-12 22:42:45 UTC
Sun Oct 7 15:26:38 UTC 2012     srv214  commonswiki     LocalFile::lock  10.0.6.41       1205    Lock wait timeout exceeded; try restarting transaction  (10.0.6.41)      SELECT  1  FROM `image`  WHERE img_name = 'Hl._Lukas_-_Reliquienschrein_und_Prozessionskerzenhalter.jpg'  LIMIT 1   FOR UPDATE

Sun Oct 7 15:28:02 UTC 2012     srv252  commonswiki     LocalFile::lock 10.0.6.41       1205    Lock wait timeout exceeded; try restarting transaction (10.0.6.41)      SELECT  1  FROM `image`  WHERE img_name = 'Hl._Lukas_-_Reliquienschrein_und_Prozessionskerzenhalter.jpg'  LIMIT 1   FOR UPDATE
Comment 7 Marco 2012-10-13 07:58:22 UTC
(In reply to comment #1)
> Marco, thanks for reporting this. Can you find any pattern in which files are
> affected?

(In reply to comment #4)
> Marco: Is this problem reproducible?

Sorry, I did not find any pattern and I could also not reproduce the behavior. 

(In reply to comment #5)
> What do you mean by "partial contents of the files"?

Description is one part and the image file is the other part. So only one part gets moved and the other stays as far as I could observe.
Comment 8 Marco 2012-10-15 07:43:37 UTC
At least the error message which seems to be strongly(?) related to this keeps coming up:
https://commons.wikimedia.org/w/index.php?title=MediaWiki_talk:Gadget-AjaxQuickDelete.js/auto-errors&diff=prev&oldid=80841863#Autoreport_by_AjaxQuickDelete_44896219117
Comment 9 Aaron Schulz 2012-10-17 00:16:40 UTC
Title.php has to deal with some transactional things:
a) The file moves
b) The file DB metadata moves
c) The actual description page move

The first two are wrapped in a transaction as best as possible, it's possibly for partitions/errors to cause:
a) no move but duplicate files to be at the destination (failure to delete target files on error)
b) files at the destination and description/metadata still at the target (failure to commit()).

The first two are in a transaction by themselves for contention reasons. One could wrap some code in Title::moveTo() in $file->lock()/$file->unlock() calls to get all three in on DB transaction, but that would hold locks while thumbnails are purged. For this to work, the purges would need to be deferred till the description page is moved. Even still, it would be vulnerable to network partitions (failure to revert files on error or commit failure).

People have made various tweaks to this area to "improve" it (one of which caused a race condition that resulted in numerous lost files). To really fix this, we'd want to redo the file layout so we only create files (under hash names or uuid4s) but don't mutate them. A MW layor would do the "pretty name" and authentication (public vs deleted files) mapping to the actual files. File delete/restore/move would just be shuffling DB rows around (plus some purges outside of the transaction), which could be in one ACID transaction.

I have my doubts that anyone is willing to invest in redoing are stupid file layout anytime soon.
Comment 10 Andre Klapper 2012-11-03 20:26:14 UTC
Not reproducible for the reporter, and no indicators that this happens a lot. => Lowering priority.
Comment 12 Denniss 2013-02-08 13:10:40 UTC
Two more failed moves have been added (linked from post above). All three failed moves have one commons issue, one move entry in the history for the source page but two move entries on the target page. The move order did not move the original description page but the new description page after file deletion.
Comment 13 Denniss 2013-02-10 05:16:59 UTC
*** Bug 44831 has been marked as a duplicate of this bug. ***
Comment 14 Rainer Rillke @commons.wikimedia 2013-02-14 10:20:36 UTC
Lost file description pages can have legal implications.
Comment 15 Aaron Schulz 2013-11-26 18:38:30 UTC
Has this occurred recently?
Comment 16 Rainer Rillke @commons.wikimedia 2013-11-26 21:17:25 UTC
(In reply to comment #15)
> Has this occurred recently?
Yes, at https://commons.wikimedia.org/wiki/File:Cambridge_Public_Libary_-_Cambridge,_MA_-_DSC00103.JPG , the file disappeared after moving.
Comment 17 Bawolff (Brian Wolff) 2014-05-22 23:04:06 UTC
Aaron's https://gerrit.wikimedia.org/r/#/c/127460/ will probably help this situation.
Comment 18 Rainer Rillke @commons.wikimedia 2014-05-22 23:14:10 UTC
(In reply to Bawolff (Brian Wolff) from comment #17)
+++ support, support, support

this has been something i was always in favour of; it allows using MW with IIS properly, file renaming operations will be much faster etc. etc. -- push this!
Comment 19 Mark Holmquist 2014-05-22 23:15:57 UTC
We're trying to get tests built into it first - I took a stab but was struggling to get it working right.
Comment 20 Andre Klapper 2014-08-04 13:25:21 UTC
(In reply to Bawolff (Brian Wolff) from comment #17)
> Aaron's https://gerrit.wikimedia.org/r/#/c/127460/ will probably help this
> situation.

Patch still awaiting review / merge...
Comment 21 Gerrit Notification Bot 2014-08-14 17:26:59 UTC
Change 153990 had a related patch set uploaded by Aaron Schulz:
Made LocalFile move/delete/restore handle network partitions better

https://gerrit.wikimedia.org/r/153990
Comment 22 Gerrit Notification Bot 2014-08-21 15:38:14 UTC
Change 153990 merged by jenkins-bot:
Made LocalFile move/delete/restore handle network partitions better

https://gerrit.wikimedia.org/r/153990
Comment 23 Gerrit Notification Bot 2014-08-21 16:19:20 UTC
Change 155575 had a related patch set uploaded by Aaron Schulz:
Made LocalFile move/delete/restore handle network partitions better

https://gerrit.wikimedia.org/r/155575
Comment 24 Gerrit Notification Bot 2014-08-21 23:51:21 UTC
Change 155575 merged by jenkins-bot:
Made LocalFile move/delete/restore handle network partitions better

https://gerrit.wikimedia.org/r/155575
Comment 25 Andre Klapper 2014-08-31 21:17:05 UTC
All patches merged - what's left to do here?
Comment 26 Andre Klapper 2014-10-08 11:47:01 UTC
(In reply to Andre Klapper from comment #25)
> All patches merged - what's left to do here?

No reply to comment 25. Assuming this bug is FIXED.
If that is not the case: Please reopen and elaborate what is left to do here to get this report fixed.

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


Navigation
Links