Page MenuHomePhabricator

DBQueryError and DBTransactionSizeError while undeleting files on Commons
Closed, DuplicatePublicPRODUCTION ERROR

Description

Error

I got several errors while undeleting files from https://commons.wikimedia.org/wiki/Commons:Deletion_requests/Files_in_Category:Videos_by_Bandai_Namco

[d34eac5e-9bcc-4b05-ba97-81e380aa456e] 2023-12-12 15:29:13: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"
[643421e1-ae22-495a-b8e0-1de41abe9f66] 2023-12-12 15:29:13: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"
[0918a561-1c47-4ee0-81c5-cc1026d82ab0] 2023-12-12 15:29:13: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"
[c176a9be-c13d-4817-8f36-74a9bb90d9f7] 2023-12-12 15:29:14: Fatal exception of type "Wikimedia\Rdbms\DBTransactionSizeError"
Impact

Files can't be undeleted.

Notes

Event Timeline

Couldn't be undeleted at that time, but were they undeleted eventually ? Or did content end up in partials states ?

Some logstash retrieved logging: All failures on db2140

d34eac5e-9bcc-4b05-ba97-81e380aa456e

from /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/TransactionProfiler.php(525)
#0 /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/TransactionProfiler.php(337): Wikimedia\Rdbms\TransactionProfiler->reportExpectationViolated(string, Wikimedia\Rdbms\Query, double, string, string)
#1 /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/database/TransactionManager.php(615): Wikimedia\Rdbms\TransactionProfiler->recordQueryCompletion(Wikimedia\Rdbms\Query, double, boolean, integer, string, string)
#2 /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/database/Database.php(860): Wikimedia\Rdbms\TransactionManager->recordQueryCompletion(Wikimedia\Rdbms\Query, double, boolean, integer, string)
#3 /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/database/Database.php(750): Wikimedia\Rdbms\Database->attemptQuery(Wikimedia\Rdbms\Query, string, boolean)
#4 /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/database/Database.php(670): Wikimedia\Rdbms\Database->executeQuery(Wikimedia\Rdbms\Query, string, integer)
#5 /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/database/Database.php(1520): Wikimedia\Rdbms\Database->query(Wikimedia\Rdbms\Query, string)
#6 /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/database/DBConnRef.php(119): Wikimedia\Rdbms\Database->insert(string, array, string, array)
#7 /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/database/DBConnRef.php(407): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#8 /srv/mediawiki/php-1.42.0-wmf.7/includes/libs/rdbms/querybuilder/InsertQueryBuilder.php(345): Wikimedia\Rdbms\DBConnRef->insert(string, array, string, array)
#9 /srv/mediawiki/php-1.42.0-wmf.7/includes/filerepo/file/LocalFileRestoreBatch.php(327): Wikimedia\Rdbms\InsertQueryBuilder->execute()
#10 /srv/mediawiki/php-1.42.0-wmf.7/includes/filerepo/file/LocalFile.php(2345): LocalFileRestoreBatch->execute()
#11 /srv/mediawiki/php-1.42.0-wmf.7/includes/page/UndeletePage.php(313): LocalFile->restore(array, boolean)
#12 /srv/mediawiki/php-1.42.0-wmf.7/includes/page/UndeletePage.php(259): MediaWiki\Page\UndeletePage->undeleteUnsafe(string)
#13 /srv/mediawiki/php-1.42.0-wmf.7/includes/specials/SpecialUndelete.php(1533): MediaWiki\Page\UndeletePage->undeleteIfAllowed(string)
#14 /srv/mediawiki/php-1.42.0-wmf.7/includes/specials/SpecialUndelete.php(364): MediaWiki\Specials\SpecialUndelete->undelete()
#15 /srv/mediawiki/php-1.42.0-wmf.7/includes/specialpage/SpecialPage.php(727): MediaWiki\Specials\SpecialUndelete->execute(NULL)
#16 /srv/mediawiki/php-1.42.0-wmf.7/includes/specialpage/SpecialPageFactory.php(1644): MediaWiki\SpecialPage\SpecialPage->run(NULL)
#17 /srv/mediawiki/php-1.42.0-wmf.7/includes/MediaWiki.php(359): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#18 /srv/mediawiki/php-1.42.0-wmf.7/includes/MediaWiki.php(962): MediaWiki->performRequest()
#19 /srv/mediawiki/php-1.42.0-wmf.7/includes/MediaWiki.php(615): MediaWiki->main()
#20 /srv/mediawiki/php-1.42.0-wmf.7/index.php(50): MediaWiki->run()
#21 /srv/mediawiki/php-1.42.0-wmf.7/index.php(46): wfIndexMain()
#22 /srv/mediawiki/w/index.php(3): require(string)

on the insert query into the image table of the previously deleted file entry:

INSERT INTO `image` (img_name,img_size,img_width,img_height,img_metadata,img_bits,img_media_type,img_major_mime,img_minor_mime,img_actor,img_timestamp,img_sha1,img_description_id) VALUES ('Dark_Souls_3_-_Only_embers_remain_(E3_announcement_trailer).webm','23677284','1920','1080','a:13:{s:14:\"GETID3_VERSION\";s:14:\"1.9.6-20130603\";s:8:\"filesize\";i:23677284;s:12:\"avdataoffset\";i:0;s:9:\"avdataend\";i:23677284;s:10:\"fileformat\";s:8:\"matroska\";s:5:\"audio\";a:11:{s:10:\"dataformat\";s:6:\"vorbis\";s:11:\"sample_rate\";i:48000;s:8:\"channels\";i:2;s:8:\"language\";s:3:\"eng\";s:15:\"bits_per_sample\";i:32;s:8:\"lossless\";b:0;s:12:\"bitrate_mode\";s:3:\"vbr\";s:7:\"bitrate\";i:192000;s:7:\"streams\";a:1:{i:0;a:10:{s:10:\"dataformat\";s:6:\"vorbis\";s:7:\"default\";b:1;s:11:\"sample_rate\";i:48000;s:8:\"channels\";i:2;s:8:\"language\";s:3:\"eng\";s:15:\"bits_per_sample\";i:32;s:8:\"lossless\";b:0;s:12:\"bitrate_mode\";s:3:\"vbr\";s:7:\"bitrate\";i:192000;s:17:\"compression_ratio\";d:0.0625;}}s:11:\"channelmode\";s:6:\"stereo\";s:17:\"compression_ratio\";d:0.0625;}s:5:\"video\";a:9:{s:10:\"dataformat\";s:3:\"vp8\";s:12:\"resolution_x\";i:1920;s:12:\"resolution_y\";i:1080;s:12:\"display_unit\";s:6:\"pixels\";s:9:\"display_x\";i:1920;s:9:\"display_y\";i:1080;s:10:\"frame_rate\";d:24;s:7:\"streams\";a:1:{i:0;a:8:{s:10:\"dataformat\";s:3:\"vp8\";s:7:\"default\";b:1;s:12:\"resolution_x\";i:1920;s:12:\"resolution_y\";i:1080;s:12:\"display_unit\";s:6:\"pixels\";s:9:\"display_x\";i:1920;s:9:\"display_y\";i:1080;s:10:\"frame_rate\";d:24;}}s:7:\"bitrate\";d:1085126;}s:8:\"encoding\";s:5:\"UTF-8\";s:9:\"mime_type\";s:10:\"video/webm\";s:16:\"playtime_seconds\";d:148.316;s:7:\"bitrate\";d:1277126;s:15:\"playtime_string\";s:4:\"2:28\";s:7:\"version\";i:2;}','0','VIDEO','video','webm','28552','20160501045904','feyzph7tkmtuyf3wbgdtj975s4wz325','68068051')

Lock wait timeout exceeded; try restarting transaction

643421e1-ae22-495a-b8e0-1de41abe9f66
Similiar: Deadlock found when trying to get lock; try restarting transaction

0918a561-1c47-4ee0-81c5-cc1026d82ab0
Similiar: Deadlock found when trying to get lock; try restarting transaction

c176a9be-c13d-4817-8f36-74a9bb90d9f7
Slightly different: Transaction spent {time}s in writes, exceeding the 3s limit
Followed by quite a few changeprop errors.

All this happened on Dec 12, 2023 @ 15:29:13.*

I don't see anything particular in the december 12th admin log, and couldn't really find anything in the logs either. It means that the database could not be edited and that it took more than 3 seconds for the database to execute the action. Based on the page you are linking, i'm assuming the trigger for this might be locked table rows because of how fast the undeletes were being done in succession.