Page MenuHomePhabricator

Wikimedia\Rdbms\DBQueryError: Error 1062: Duplicate entry moving a file; Function: LocalFileMoveBatch::doDBUpdates
Closed, ResolvedPublicPRODUCTION ERROR

Description

Steps to replicate the issue (include links if applicable):

What happens?:

[61cb2bf7-3abf-4fe5-a896-2d07c828a9b0] 2025-03-21 06:20:17: 类型“Wikimedia\Rdbms\DBQueryError”的致命异常

What should have happened instead?:
Move it normally

Error
normalized_message
[{reqId}] {exception_url}   Wikimedia\Rdbms\DBQueryError: Error 1062: Duplicate entry 'Flag_of_Aminoac.png' for key 'file_name'
Function: LocalFileMoveBatch::doDBUpdates
Query: UPDATE  `file` SET file_name = 'Flag_of_Aminoac.png' WHERE file_id = '69014'
FrameLocationCall
from/srv/mediawiki/php-1.44.0-wmf.21/includes/libs/rdbms/database/Database.php(1230)
#0/srv/mediawiki/php-1.44.0-wmf.21/includes/libs/rdbms/database/Database.php(1214)Wikimedia\Rdbms\Database->getQueryException(string, int, string, string)
#1/srv/mediawiki/php-1.44.0-wmf.21/includes/libs/rdbms/database/Database.php(1188)Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, int, string, string)
#2/srv/mediawiki/php-1.44.0-wmf.21/includes/libs/rdbms/database/Database.php(647)Wikimedia\Rdbms\Database->reportQueryError(string, int, string, string, bool)
#3/srv/mediawiki/php-1.44.0-wmf.21/includes/libs/rdbms/database/Database.php(1516)Wikimedia\Rdbms\Database->query(Wikimedia\Rdbms\Query, string)
#4/srv/mediawiki/php-1.44.0-wmf.21/includes/libs/rdbms/database/DBConnRef.php(127)Wikimedia\Rdbms\Database->update(string, array, array, string, array)
#5/srv/mediawiki/php-1.44.0-wmf.21/includes/libs/rdbms/database/DBConnRef.php(413)Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6/srv/mediawiki/php-1.44.0-wmf.21/includes/libs/rdbms/querybuilder/UpdateQueryBuilder.php(333)Wikimedia\Rdbms\DBConnRef->update(string, array, array, string, array)
#7/srv/mediawiki/php-1.44.0-wmf.21/includes/filerepo/file/LocalFileMoveBatch.php(384)Wikimedia\Rdbms\UpdateQueryBuilder->execute()
#8/srv/mediawiki/php-1.44.0-wmf.21/includes/filerepo/file/LocalFileMoveBatch.php(296)LocalFileMoveBatch->doDBUpdates()
#9/srv/mediawiki/php-1.44.0-wmf.21/includes/filerepo/file/LocalFile.php(2376)LocalFileMoveBatch->execute()
#10/srv/mediawiki/php-1.44.0-wmf.21/includes/page/MovePage.php(788)LocalFile->move(MediaWiki\Title\Title)
#11/srv/mediawiki/php-1.44.0-wmf.21/includes/page/MovePage.php(732)MediaWiki\Page\MovePage->moveFile(MediaWiki\Title\Title, MediaWiki\Title\Title)
#12/srv/mediawiki/php-1.44.0-wmf.21/includes/page/MovePage.php(496)MediaWiki\Page\MovePage->moveUnsafe(MediaWiki\User\User, string, bool, array)
#13/srv/mediawiki/php-1.44.0-wmf.21/includes/specials/SpecialMovePage.php(786)MediaWiki\Page\MovePage->moveIfAllowed(MediaWiki\User\User, string, bool)
#14/srv/mediawiki/php-1.44.0-wmf.21/includes/specials/SpecialMovePage.php(225)MediaWiki\Specials\SpecialMovePage->doSubmit()
#15/srv/mediawiki/php-1.44.0-wmf.21/includes/specialpage/SpecialPage.php(729)MediaWiki\Specials\SpecialMovePage->execute(null)
#16/srv/mediawiki/php-1.44.0-wmf.21/includes/specialpage/SpecialPageFactory.php(1737)MediaWiki\SpecialPage\SpecialPage->run(null)
#17/srv/mediawiki/php-1.44.0-wmf.21/includes/actions/ActionEntryPoint.php(501)MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#18/srv/mediawiki/php-1.44.0-wmf.21/includes/actions/ActionEntryPoint.php(145)MediaWiki\Actions\ActionEntryPoint->performRequest()
#19/srv/mediawiki/php-1.44.0-wmf.21/includes/MediaWikiEntryPoint.php(202)MediaWiki\Actions\ActionEntryPoint->execute()
#20/srv/mediawiki/php-1.44.0-wmf.21/index.php(58)MediaWiki\MediaWikiEntryPoint->run()
#21/srv/mediawiki/w/index.php(3)require(string)
#22{main}
Impact
Notes

Details

Request URL
https://zh.wikipedia.org/w/index.php?action=submit&title=*
Related Changes in Gerrit:

Event Timeline

Restricted Application changed the subtype of this task from "Bug Report" to "Production Error". · View Herald TranscriptMar 21 2025, 6:24 AM

Maybe related information: The target file name has been deleted in Commons.

Aklapper renamed this task from Wikimedia\Rdbms\DBQueryError when moving a file on zhwiki to Wikimedia\Rdbms\DBQueryError: Error 1062: Duplicate entry moving a file; Function: LocalFileMoveBatch::doDBUpdates.Apr 6 2025, 8:58 PM
Aklapper set Request URL to https://zh.wikipedia.org/w/index.php?action=submit&title=*.
Aklapper updated the task description. (Show Details)

Change #1136468 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] filerepo: Delete the file table entry if move target exists but deleted

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

Change #1136468 merged by jenkins-bot:

[mediawiki/core@master] filerepo: Delete the file table entry if move target exists but deleted

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

It seems unresolved till now...? I still meet the error when I try to move it.

It seems unresolved till now...? I still meet the error when I try to move it.

It still needs to be backported/deployed. It'll take a bit.

Yes.It is fixed now.

在T389586#10793913中,@Ladsgroup写道:

OK, thank you.

Is it fixed now?