Page MenuHomePhabricator

Error when moving page: Error: 1305 SAVEPOINT wikimedia_rdbms_atomic1 does not exist (<dbname>.wikiname.ca)
Open, LowPublicBUG REPORT

Description

Right after moving a page, we consistently get an error for the last two weeks or so. We had not done any updates to MediaWiki in that time frame. MediaWiki 1.33.0 (1e0e638); PHP 7.2.22 (cgi-fcgi); MySQL 5.7.25-log

With debugging enabled, the error is the following:

[Xa9e60Wj@38AAFnvW98AAAAJ] /index.php?title=Special:MovePage&action=submit Wikimedia\Rdbms\DBQueryError from line 1587 of /home/.../wiki.wikiname.ca/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: RELEASE SAVEPOINT `wikimedia_rdbms_atomic1`
Function: MovePage::move
Error: 1305 SAVEPOINT wikimedia_rdbms_atomic1 does not exist (<dbname>.wikiname.ca)

Backtrace:

#0 /home/.../wiki.wikiname.ca/includes/libs/rdbms/database/Database.php(1556): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#1 /home/.../wiki.wikiname.ca/includes/libs/rdbms/database/Database.php(1274): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /home/.../wiki.wikiname.ca/includes/libs/rdbms/database/Database.php(3705): Wikimedia\Rdbms\Database->query(string, string)
#3 /home/.../wiki.wikiname.ca/includes/libs/rdbms/database/Database.php(3794): Wikimedia\Rdbms\Database->doReleaseSavepoint(string, string)
#4 /home/.../wiki.wikiname.ca/includes/MovePage.php(398): Wikimedia\Rdbms\Database->endAtomic(string)
#5 /home/.../wiki.wikiname.ca/includes/specials/SpecialMovepage.php(606): MovePage->move(User, string, boolean)
#6 /home/.../wiki.wikiname.ca/includes/specials/SpecialMovepage.php(128): MovePageForm->doSubmit()
#7 /home/.../wiki.wikiname.ca/includes/specialpage/SpecialPage.php(569): MovePageForm->execute(NULL)
#8 /home/.../wiki.wikiname.ca/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#9 /home/.../wiki.wikiname.ca/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#10 /home/.../wiki.wikiname.ca/includes/MediaWiki.php(865): MediaWiki->performRequest()
#11 /home/.../wiki.wikiname.ca/includes/MediaWiki.php(515): MediaWiki->main()
#12 /home/.../wiki.wikiname.ca/index.php(42): MediaWiki->run()
#13 {main}

Thank you.

Event Timeline

Tomgle93 created this task.Oct 22 2019, 8:31 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 22 2019, 8:31 PM
Masumrezarock100 changed the subtype of this task from "Task" to "Bug Report".
Masumrezarock100 added a subscriber: Masumrezarock100.
Reedy updated the task description. (Show Details)Oct 22 2019, 10:48 PM
Reedy added a project: Wikimedia-Rdbms.
Restricted Application added a project: Platform Engineering. · View Herald TranscriptOct 22 2019, 10:48 PM
Anomie added a subscriber: Anomie.Oct 23 2019, 1:40 PM

At first glance I don't see a code path in MovePage that would cause a problem like this, and the atomic section logic in the rdbms library hasn't to my knowledge had problems like this in Wikimedia production. My first guess would be some extension in your installation is committing the transaction during one of the hooks.

If you can log the DB queries (log channel "DBQuery") for such a request and post the relevant lines here, including the structured logging contexts, that would be helpful. Ideally you'd include only the parts between the relevant SAVEPOINT `wikimedia_rdbms_atomic1` and the RELEASE SAVEPOINT `wikimedia_rdbms_atomic1` resulting in the error, but posting the whole thing would be better than nothing if you're not sure.

Tomgle93 updated the task description. (Show Details)Oct 24 2019, 9:11 PM
Aklapper renamed this task from Error when moving page to Error when moving page: Error: 1305 SAVEPOINT wikimedia_rdbms_atomic1 does not exist (<dbname>.wikiname.ca).Oct 25 2019, 7:24 AM
Krinkle updated the task description. (Show Details)Jan 29 2020, 4:36 AM
Krinkle added a subscriber: Krinkle.

(On behalf of @Tomgle93)

Hi, can you please give extra instructions on what you are asking for Anomie? Also please note we are using both Semantic Mediawiki and Cargo. Really appreciate your help. Thanks, Tom

@Krinkle, @Tomgle93: See the pages I linked in my previous comment for additional instructions.

Krinkle changed the task status from Open to Stalled.Apr 8 2020, 4:38 PM
Krinkle removed a subscriber: Krinkle.

It sounds like this may be due to a problem in SMW or Cargo. If you can reproduce this without those that would help isolate the problem.

jmaebe added a subscriber: jmaebe.EditedApr 12 2020, 1:40 PM

We have this error as well on a Mediawiki 1.31.7 installation, when someone tries to upload a new version of an image. You can see the extensions we use on https://wiki.freepascal.org/Special:Version (SMW and Cargo are not in use).

Here is part of the generated log:

[DBQuery] lazaruswiki SELECT /* LocalFile::recordUpload2  */  img_timestamp,img_sha1  FROM `image`    WHERE img_name = 'blanktest.png'  LIMIT 1   LOCK IN SHARE MODE
[DBQuery] lazaruswiki SELECT /* LocalFile::recordUpload2  */  img_name AS `oi_name`,'20200412132256!blanktest.png' AS `oi_archive_name`,img_size AS `oi_size`,img_width AS `oi_width`,img_height AS `oi_height`,img_bits AS `oi_bits`,img_timestamp AS `oi_timestamp`,img_metadata AS `oi_metadata`,img_media_type AS `oi_media_type`,img_major_mime AS `oi_major_mime`,img_minor_mime AS `oi_minor_mime`,img_sha1 AS `oi_sha1`,img_description AS `oi_description`,img_user AS `oi_user`,img_user_text AS `oi_user_text`  FROM `image`    WHERE img_name = 'blanktest.png'   FOR UPDATE
[DBQuery] lazaruswiki SAVEPOINT /* LocalFile::recordUpload2  */ `wikimedia_rdbms_atomic1`
[DBQuery] lazaruswiki INSERT /* LocalFile::recordUpload2  */  INTO `oldimage` (oi_name,oi_archive_name,oi_size,oi_width,oi_height,oi_bits,oi_timestamp,oi_metadata,oi_media_type,oi_major_mime,oi_minor_mime,oi_sha1,oi_description,oi_user,oi_user_text) VALUES ('blanktest.png','20200412132256!blanktest.png','3439','36','30','8','20200412130443','a:6:{s:10:\"frameCount\";i:0;s:9:\"loopCount\";i:1;s:8:\"duration\";d:0;s:8:\"bitDepth\";i:8;s:9:\"colorType\";s:10:\"truecolour\";s:8:\"metadata\";a:6:{s:15:\"PixelYDimension\";s:2:\"30\";s:15:\"PixelXDimension\";s:2:\"36\";s:11:\"XResolution\";s:8:\"5669/100\";s:11:\"YResolution\";s:8:\"5669/100\";s:14:\"ResolutionUnit\";i:3;s:15:\"_MW_PNG_VERSION\";i:1;}}','BITMAP','image','png','ay7lyaeegs8txjai14f7fdqln8xq8ni','test','900','Jonas')
[DBQuery] lazaruswiki RELEASE /* LocalFile::recordUpload2  */ SAVEPOINT `wikimedia_rdbms_atomic1`
[DBQuery] SQL ERROR: SAVEPOINT wikimedia_rdbms_atomic1 does not exist (localhost)

[DBQuery] SQL ERROR: SAVEPOINT wikimedia_rdbms_atomic1 does not exist (localhost)

[DBQuery] lazaruswiki ROLLBACK /* MWExceptionHandler::rollbackMasterChangesAndLog  */ 
[exception] [8a91b15204c6afc4515593fa] /Special:Upload   Wikimedia\Rdbms\DBQueryError from line 1457 of /srv/www/lazaruswiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: RELEASE SAVEPOINT `wikimedia_rdbms_atomic1`
Function: LocalFile::recordUpload2
Error: 1305 SAVEPOINT wikimedia_rdbms_atomic1 does not exist (localhost)

#0 /srv/www/lazaruswiki/includes/libs/rdbms/database/Database.php(1427): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
#1 /srv/www/lazaruswiki/includes/libs/rdbms/database/Database.php(1200): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /srv/www/lazaruswiki/includes/libs/rdbms/database/Database.php(3498): Wikimedia\Rdbms\Database->query(string, string)
#3 /srv/www/lazaruswiki/includes/libs/rdbms/database/Database.php(3584): Wikimedia\Rdbms\Database->doReleaseSavepoint(string, string)
#4 /srv/www/lazaruswiki/includes/libs/rdbms/database/Database.php(2953): Wikimedia\Rdbms\Database->endAtomic(string)
#5 /srv/www/lazaruswiki/includes/libs/rdbms/database/Database.php(2880): Wikimedia\Rdbms\Database->nonNativeInsertSelect(string, array, array, array, string, array, array, array)
#6 /srv/www/lazaruswiki/includes/filerepo/file/LocalFile.php(1606): Wikimedia\Rdbms\Database->insertSelect(string, array, array, array, string, array, array, array)
#7 /srv/www/lazaruswiki/includes/filerepo/file/LocalFile.php(1364): LocalFile->recordUpload2(string, string, boolean, array, string, User, array)
#8 /srv/www/lazaruswiki/includes/upload/UploadBase.php(868): LocalFile->upload(string, string, boolean, integer, array, boolean, User, array)
#9 /srv/www/lazaruswiki/includes/specials/SpecialUpload.php(567): UploadBase->performUpload(string, boolean, boolean, User, array)
#10 /srv/www/lazaruswiki/includes/specials/SpecialUpload.php(207): SpecialUpload->processUpload()
#11 /srv/www/lazaruswiki/includes/specialpage/SpecialPage.php(565): SpecialUpload->execute(NULL)
#12 /srv/www/lazaruswiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#13 /srv/www/lazaruswiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#14 /srv/www/lazaruswiki/includes/MediaWiki.php(861): MediaWiki->performRequest()
#15 /srv/www/lazaruswiki/includes/MediaWiki.php(524): MediaWiki->main()
#16 /srv/www/lazaruswiki/index.php(42): MediaWiki->run()
#17 {main}
Aklapper removed a subscriber: Anomie.Oct 16 2020, 5:01 PM
Aklapper changed the task status from Stalled to Open.Nov 5 2020, 12:01 PM

Reopening per last two comments

daniel added a subscriber: daniel.Jan 14 2021, 10:20 AM

Since this doesn't appear to be happening on WMF sites, it's unclear what the priority of this ticket should be.

If that's an argument then probably low if it's still in scope of "Platform Team"?

BPirkle triaged this task as Low priority.Thu, Feb 18, 10:58 PM