Page MenuHomePhabricator

DBUnexpectedError while deleting or moving file
Closed, DuplicatePublicPRODUCTION ERROR

Description

Trying to delete https://commons.wikimedia.org/wiki/File:Mingler.webm (copyright violation), I get the following message:

[50fcb928-8d50-4432-b176-a5f3a8a79439] 2023-10-11 15:17:34: Fatal exception of type "Wikimedia\Rdbms\DBUnexpectedError"

The file is not deleted. I got quite a lot of fails today while deleting files.
Something it works on the second attempt, but in this case, the error appears repeatedly.

Error
normalized_message
[50fcb928-8d50-4432-b176-a5f3a8a79439] /w/index.php?action=delete&title=File:Mingler.webm   Wikimedia\Rdbms\DBUnexpectedError: MediaWiki\TimedMediaHandler\WebVideoTranscode\WebVideoTranscode::updateStreamingManifests: Cannot flush pre-lock snapshot; write
exception.trace
from /srv/mediawiki/php-1.41.0-wmf.30/includes/libs/rdbms/database/TransactionManager.php(962)
#0 /srv/mediawiki/php-1.41.0-wmf.30/includes/libs/rdbms/database/Database.php(3037): Wikimedia\Rdbms\TransactionManager->onGetScopedLockAndFlush(Wikimedia\Rdbms\DatabaseMySQL, string)
#1 /srv/mediawiki/php-1.41.0-wmf.30/includes/libs/rdbms/database/DBConnRef.php(119): Wikimedia\Rdbms\Database->getScopedLockAndFlush(string, string, integer)
#2 /srv/mediawiki/php-1.41.0-wmf.30/includes/libs/rdbms/database/DBConnRef.php(750): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#3 /srv/mediawiki/php-1.41.0-wmf.30/extensions/TimedMediaHandler/includes/WebVideoTranscode/WebVideoTranscode.php(1217): Wikimedia\Rdbms\DBConnRef->getScopedLockAndFlush(string, string, integer)
#4 /srv/mediawiki/php-1.41.0-wmf.30/extensions/TimedMediaHandler/includes/WebVideoTranscode/WebVideoTranscode.php(1040): MediaWiki\TimedMediaHandler\WebVideoTranscode\WebVideoTranscode::updateStreamingManifests(LocalFile)
#5 /srv/mediawiki/php-1.41.0-wmf.30/extensions/TimedMediaHandler/includes/Hooks.php(371): MediaWiki\TimedMediaHandler\WebVideoTranscode\WebVideoTranscode::removeTranscodes(LocalFile)
#6 /srv/mediawiki/php-1.41.0-wmf.30/includes/HookContainer/HookContainer.php(161): MediaWiki\TimedMediaHandler\Hooks->onFileDeleteComplete(LocalFile, string, WikiFilePage, MediaWiki\User\User, string)
#7 /srv/mediawiki/php-1.41.0-wmf.30/includes/HookContainer/HookRunner.php(1723): MediaWiki\HookContainer\HookContainer->run(string, array)
#8 /srv/mediawiki/php-1.41.0-wmf.30/includes/page/File/FileDeleteForm.php(158): MediaWiki\HookContainer\HookRunner->onFileDeleteComplete(LocalFile, string, WikiFilePage, MediaWiki\User\User, string)
#9 /srv/mediawiki/php-1.41.0-wmf.30/includes/actions/FileDeleteAction.php(124): MediaWiki\Page\File\FileDeleteForm::doDelete(MediaWiki\Title\Title, LocalFile, string, string, boolean, MediaWiki\User\User, array, boolean)
#10 /srv/mediawiki/php-1.41.0-wmf.30/includes/actions/FileDeleteAction.php(75): MediaWiki\Actions\FileDeleteAction->tempExecute(LocalFile)
#11 /srv/mediawiki/php-1.41.0-wmf.30/includes/actions/DeleteAction.php(136): MediaWiki\Actions\FileDeleteAction->tempDelete()
#12 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(583): DeleteAction->show()
#13 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(363): MediaWiki->performAction(ImagePage, MediaWiki\Title\Title)
#14 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(960): MediaWiki->performRequest()
#15 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(613): MediaWiki->main()
#16 /srv/mediawiki/php-1.41.0-wmf.30/index.php(50): MediaWiki->run()
#17 /srv/mediawiki/php-1.41.0-wmf.30/index.php(46): wfIndexMain()
#18 /srv/mediawiki/w/index.php(3): require(string)
#19 {main}
Impact
Notes

Event Timeline

Error
normalized_message
[50fcb928-8d50-4432-b176-a5f3a8a79439] /w/index.php?action=delete&title=File:Mingler.webm   Wikimedia\Rdbms\DBUnexpectedError: MediaWiki\TimedMediaHandler\WebVideoTranscode\WebVideoTranscode::updateStreamingManifests: Cannot flush pre-lock snapshot; write
exception.trace
from /srv/mediawiki/php-1.41.0-wmf.30/includes/libs/rdbms/database/TransactionManager.php(962)
#0 /srv/mediawiki/php-1.41.0-wmf.30/includes/libs/rdbms/database/Database.php(3037): Wikimedia\Rdbms\TransactionManager->onGetScopedLockAndFlush(Wikimedia\Rdbms\DatabaseMySQL, string)
#1 /srv/mediawiki/php-1.41.0-wmf.30/includes/libs/rdbms/database/DBConnRef.php(119): Wikimedia\Rdbms\Database->getScopedLockAndFlush(string, string, integer)
#2 /srv/mediawiki/php-1.41.0-wmf.30/includes/libs/rdbms/database/DBConnRef.php(750): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#3 /srv/mediawiki/php-1.41.0-wmf.30/extensions/TimedMediaHandler/includes/WebVideoTranscode/WebVideoTranscode.php(1217): Wikimedia\Rdbms\DBConnRef->getScopedLockAndFlush(string, string, integer)
#4 /srv/mediawiki/php-1.41.0-wmf.30/extensions/TimedMediaHandler/includes/WebVideoTranscode/WebVideoTranscode.php(1040): MediaWiki\TimedMediaHandler\WebVideoTranscode\WebVideoTranscode::updateStreamingManifests(LocalFile)
#5 /srv/mediawiki/php-1.41.0-wmf.30/extensions/TimedMediaHandler/includes/Hooks.php(371): MediaWiki\TimedMediaHandler\WebVideoTranscode\WebVideoTranscode::removeTranscodes(LocalFile)
#6 /srv/mediawiki/php-1.41.0-wmf.30/includes/HookContainer/HookContainer.php(161): MediaWiki\TimedMediaHandler\Hooks->onFileDeleteComplete(LocalFile, string, WikiFilePage, MediaWiki\User\User, string)
#7 /srv/mediawiki/php-1.41.0-wmf.30/includes/HookContainer/HookRunner.php(1723): MediaWiki\HookContainer\HookContainer->run(string, array)
#8 /srv/mediawiki/php-1.41.0-wmf.30/includes/page/File/FileDeleteForm.php(158): MediaWiki\HookContainer\HookRunner->onFileDeleteComplete(LocalFile, string, WikiFilePage, MediaWiki\User\User, string)
#9 /srv/mediawiki/php-1.41.0-wmf.30/includes/actions/FileDeleteAction.php(124): MediaWiki\Page\File\FileDeleteForm::doDelete(MediaWiki\Title\Title, LocalFile, string, string, boolean, MediaWiki\User\User, array, boolean)
#10 /srv/mediawiki/php-1.41.0-wmf.30/includes/actions/FileDeleteAction.php(75): MediaWiki\Actions\FileDeleteAction->tempExecute(LocalFile)
#11 /srv/mediawiki/php-1.41.0-wmf.30/includes/actions/DeleteAction.php(136): MediaWiki\Actions\FileDeleteAction->tempDelete()
#12 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(583): DeleteAction->show()
#13 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(363): MediaWiki->performAction(ImagePage, MediaWiki\Title\Title)
#14 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(960): MediaWiki->performRequest()
#15 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(613): MediaWiki->main()
#16 /srv/mediawiki/php-1.41.0-wmf.30/index.php(50): MediaWiki->run()
#17 /srv/mediawiki/php-1.41.0-wmf.30/index.php(46): wfIndexMain()
#18 /srv/mediawiki/w/index.php(3): require(string)
#19 {main}
Impact
Notes

While deleting https://commons.wikimedia.org/wiki/File:Why_Elephants_are_in_Super_Mario_Bros_Wonder.webm
I get

[3ea51c0a-f1aa-487d-ba0e-967f0af1b993] 2023-10-11 21:58:36: Fatal exception of type "Wikimedia\Rdbms\DBUnexpectedError"

It is certainly not a coincidence that all files are videos.

Aklapper changed the subtype of this task from "Bug Report" to "Production Error".Oct 12 2023, 8:02 AM

Fatal exception => Production Error type

So is this believed to be fixed by the recent fix? Or did the fix already go out and didn't fix this?

[that other bit was related but not this i think. attached fix should simply remove the unneeded lock, and later i will replace it with a more permanent solution for serializing file updates]

Change 965520 had a related patch set uploaded (by Brion VIBBER; author: Brion VIBBER):

[mediawiki/extensions/TimedMediaHandler@master] Don't try to lock to serialize m3u8 file writes

https://gerrit.wikimedia.org/r/965520

Change 965520 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] Don't try to lock to serialize m3u8 file writes

https://gerrit.wikimedia.org/r/965520

Change 965220 had a related patch set uploaded (by Jforrester; author: Brion VIBBER):

[mediawiki/extensions/TimedMediaHandler@wmf/1.41.0-wmf.30] Don't try to lock to serialize m3u8 file writes

https://gerrit.wikimedia.org/r/965220

Change 965221 had a related patch set uploaded (by Jforrester; author: Brion VIBBER):

[mediawiki/extensions/TimedMediaHandler@REL1_41] Don't try to lock to serialize m3u8 file writes

https://gerrit.wikimedia.org/r/965221

Change 965221 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@REL1_41] Don't try to lock to serialize m3u8 file writes

https://gerrit.wikimedia.org/r/965221

Graham87 renamed this task from DBUnexpectedError while deleting file to DBUnexpectedError while deleting or moving file.Oct 15 2023, 7:22 AM
Graham87 added a subscriber: Graham87.

This is a very serious problem now. It should be set as "Unbreak now" as no video can be renamed or deleted for 4 days. It is specially a problem as https://video2commons.toolforge.org/ is broken and many uploaded videos must be deleted. See https://commons.wikimedia.org/wiki/Category:Deletion_error/T348667

This is a very serious problem now. It should set a "Unbreak now" as no video can be renamed or deleted for 4 days.

It looks like the fix needs to be backported to production, which is unlikely to take place on a weekend — I imagine it'll be dealt with tomorrow as a priority

TheresNoTime triaged this task as Unbreak Now! priority.Oct 15 2023, 11:54 AM

I agree with the UBN, so have set this for attention tomorrow

Change 965220 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@wmf/1.41.0-wmf.30] Don't try to lock to serialize m3u8 file writes

https://gerrit.wikimedia.org/r/965220

Mentioned in SAL (#wikimedia-operations) [2023-10-16T07:57:35Z] <hashar@deploy2002> jforrester and hashar: Backport for [[gerrit:965220|Don't try to lock to serialize m3u8 file writes (T348689 T348667 T348375 T348753)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2023-10-16T08:10:25Z] <hashar@deploy2002> Finished scap: Backport for [[gerrit:965220|Don't try to lock to serialize m3u8 file writes (T348689 T348667 T348375 T348753)]] (duration: 27m 04s)

I think there should also be an incident report on this as a bug blocking the deletion of files could cause very serious problems if there is a file that needs to be deleted immediately. The legal team should also comment on this topic.

Does the legal team have a specific thing they're interested in investigating? (eg, are you claiming that a specific problem file was reported and could not be deleted, and that nobody forwarded the issue on to the ops team to expedite deployment of the fix? Or are you just thinking out loud?)

This should be fixed since the deployment circa 12 hours ago. Please confirm and resolve when you have a chance, thanks!

OK, I deleted all files mentioned here.