Page MenuHomePhabricator

I can duplicate my files (identical revisions) on betacommons by (un)deleting them
Open, Needs TriagePublic

Description

https://commons.wikimedia.beta.wmflabs.org/wiki/File:6f2dbfewe.jpg

That was odd. 8 identical revisions and 1 of them is broken: "File not found: /v1/AUTH_mw/wikipedia-commons-local-public.0e/archive/0/0e/20200302174125%216f2dbfewe.jpg" Let's upload a new test file. Hey, I can reproduce it.

https://commons.wikimedia.beta.wmflabs.org/wiki/File:Eff3fb13.jpg

Screenshot: https://commons.wikimedia.beta.wmflabs.org/wiki/File:8_revisions_1_broken_betacommons.png

Not sure if it's my botched mass undeletion tool that doesn't quite work yet (it undeletes 1 file, then hangs) or just undeletion and redeletion in general, but no tool should be able to cause this.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
AlexisJazz renamed this task from I can duplicate my files (identitcal revisions) on betacommons to I can duplicate my files (identical revisions) on betacommons by (un)deleting them.Mar 2 2020, 6:25 PM

I suspect this was caused by my botched undeletion tool making undeletion requests for the same file in rapid succession. It was supposed to move on to the next file in line, but it didn't, with unexpected results.

I suspect something has changed, but have to test to verify, as I fixed my tool so it now actually moves to the next file (great improvement) but requests after the first one got discarded by database error. I implemented a delay of 250ms and now it works.

This was the database error:

{"JSON":{"error":{"code":"internal_api_error_DBQueryError","info":"[Xl4vC6wQBHcAABlZvmIAAABV] Exception caught: A database query error has occurred. This may indicate a bug in the software.","errorclass":"Wikimedia\\Rdbms\\DBQueryError","*":"Wikimedia\\Rdbms\\DBQueryError at /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1626)\n#0 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1610): Wikimedia\\Rdbms\\Database->getQueryException(string, integer, string, string)\n#1 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1587): Wikimedia\\Rdbms\\Database->getQueryExceptionAndLog(string, integer, string, string)\n#2 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1166): Wikimedia\\Rdbms\\Database->reportQueryError(string, integer, string, string, boolean)\n#3 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(2178): Wikimedia\\Rdbms\\Database->query(string, string)\n#4 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\\Rdbms\\Database->insert(string, array, string)\n#5 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(378): Wikimedia\\Rdbms\\DBConnRef->__call(string, array)\n#6 /srv/mediawiki/php-master/includes/filerepo/file/LocalFileRestoreBatch.php(307): Wikimedia\\Rdbms\\DBConnRef->insert(string, array, string)\n#7 /srv/mediawiki/php-master/includes/filerepo/file/LocalFile.php(2041): LocalFileRestoreBatch->execute()\n#8 /srv/mediawiki/php-master/includes/page/PageArchive.php(427): LocalFile->restore(NULL, boolean)\n#9 /srv/mediawiki/php-master/includes/api/ApiUndelete.php(74): PageArchive->undelete(array, string, NULL, boolean, User, NULL)\n#10 /srv/mediawiki/php-master/includes/api/ApiMain.php(1590): ApiUndelete->execute()\n#11 /srv/mediawiki/php-master/includes/api/ApiMain.php(522): ApiMain->executeAction()\n#12 /srv/mediawiki/php-master/includes/api/ApiMain.php(493): ApiMain->executeActionWithErrorHandling()\n#13 /srv/mediawiki/php-master/api.php(84): ApiMain->execute()\n#14 /srv/mediawiki/w/api.php(3): require(string)\n#15 {main}"},"servedby":"deployment-mediawiki-07"},"Response payload":{"EDITOR_CONFIG":{"text":"{\"error\":{\"code\":\"internal_api_error_DBQueryError\",\"info\":\"[Xl4vC6wQBHcAABlZvmIAAABV] Exception caught: A database query error has occurred. This may indicate a bug in the software.\",\"errorclass\":\"Wikimedia\\\\Rdbms\\\\DBQueryError\",\"*\":\"Wikimedia\\\\Rdbms\\\\DBQueryError at /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1626)\\n#0 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1610): Wikimedia\\\\Rdbms\\\\Database->getQueryException(string, integer, string, string)\\n#1 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1587): Wikimedia\\\\Rdbms\\\\Database->getQueryExceptionAndLog(string, integer, string, string)\\n#2 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1166): Wikimedia\\\\Rdbms\\\\Database->reportQueryError(string, integer, string, string, boolean)\\n#3 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(2178): Wikimedia\\\\Rdbms\\\\Database->query(string, string)\\n#4 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\\\\Rdbms\\\\Database->insert(string, array, string)\\n#5 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(378): Wikimedia\\\\Rdbms\\\\DBConnRef->__call(string, array)\\n#6 /srv/mediawiki/php-master/includes/filerepo/file/LocalFileRestoreBatch.php(307): Wikimedia\\\\Rdbms\\\\DBConnRef->insert(string, array, string)\\n#7 /srv/mediawiki/php-master/includes/filerepo/file/LocalFile.php(2041): LocalFileRestoreBatch->execute()\\n#8 /srv/mediawiki/php-master/includes/page/PageArchive.php(427): LocalFile->restore(NULL, boolean)\\n#9 /srv/mediawiki/php-master/includes/api/ApiUndelete.php(74): PageArchive->undelete(array, string, NULL, boolean, User, NULL)\\n#10 /srv/mediawiki/php-master/includes/api/ApiMain.php(1590): ApiUndelete->execute()\\n#11 /srv/mediawiki/php-master/includes/api/ApiMain.php(522): ApiMain->executeAction()\\n#12 /srv/mediawiki/php-master/includes/api/ApiMain.php(493): ApiMain->executeActionWithErrorHandling()\\n#13 /srv/mediawiki/php-master/api.php(84): ApiMain->execute()\\n#14 /srv/mediawiki/w/api.php(3): require(string)\\n#15 {main}\"},\"servedby\":\"deployment-mediawiki-07\"}","mode":"application/json"}}}

With 250ms delay still not reliable, undeletion of https://commons.wikimedia.beta.wmflabs.org/wiki/File:76f2dbef4cc9_4.jpg failed at 20:53, 4 March 2020:

{"JSON":{"error":{"code":"internal_api_error_DBQueryError","info":"[XmAVQKwQBHcAAGSmXhsAAABH] Exception caught: A database query error has occurred. This may indicate a bug in the software.","errorclass":"Wikimedia\\Rdbms\\DBQueryError","*":"Wikimedia\\Rdbms\\DBQueryError at /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1626)\n#0 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1610): Wikimedia\\Rdbms\\Database->getQueryException(string, integer, string, string)\n#1 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1587): Wikimedia\\Rdbms\\Database->getQueryExceptionAndLog(string, integer, string, string)\n#2 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1166): Wikimedia\\Rdbms\\Database->reportQueryError(string, integer, string, string, boolean)\n#3 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(2176): Wikimedia\\Rdbms\\Database->query(string, string)\n#4 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\\Rdbms\\Database->insert(string, array, string)\n#5 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(378): Wikimedia\\Rdbms\\DBConnRef->__call(string, array)\n#6 /srv/mediawiki/php-master/includes/filerepo/file/LocalFileRestoreBatch.php(307): Wikimedia\\Rdbms\\DBConnRef->insert(string, array, string)\n#7 /srv/mediawiki/php-master/includes/filerepo/file/LocalFile.php(2041): LocalFileRestoreBatch->execute()\n#8 /srv/mediawiki/php-master/includes/page/PageArchive.php(427): LocalFile->restore(NULL, boolean)\n#9 /srv/mediawiki/php-master/includes/api/ApiUndelete.php(74): PageArchive->undelete(array, string, NULL, boolean, User, NULL)\n#10 /srv/mediawiki/php-master/includes/api/ApiMain.php(1590): ApiUndelete->execute()\n#11 /srv/mediawiki/php-master/includes/api/ApiMain.php(522): ApiMain->executeAction()\n#12 /srv/mediawiki/php-master/includes/api/ApiMain.php(493): ApiMain->executeActionWithErrorHandling()\n#13 /srv/mediawiki/php-master/api.php(84): ApiMain->execute()\n#14 /srv/mediawiki/w/api.php(3): require(string)\n#15 {main}"},"servedby":"deployment-mediawiki-07"},"Response payload":{"EDITOR_CONFIG":{"text":"{\"error\":{\"code\":\"internal_api_error_DBQueryError\",\"info\":\"[XmAVQKwQBHcAAGSmXhsAAABH] Exception caught: A database query error has occurred. This may indicate a bug in the software.\",\"errorclass\":\"Wikimedia\\\\Rdbms\\\\DBQueryError\",\"*\":\"Wikimedia\\\\Rdbms\\\\DBQueryError at /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1626)\\n#0 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1610): Wikimedia\\\\Rdbms\\\\Database->getQueryException(string, integer, string, string)\\n#1 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1587): Wikimedia\\\\Rdbms\\\\Database->getQueryExceptionAndLog(string, integer, string, string)\\n#2 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1166): Wikimedia\\\\Rdbms\\\\Database->reportQueryError(string, integer, string, string, boolean)\\n#3 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(2176): Wikimedia\\\\Rdbms\\\\Database->query(string, string)\\n#4 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\\\\Rdbms\\\\Database->insert(string, array, string)\\n#5 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(378): Wikimedia\\\\Rdbms\\\\DBConnRef->__call(string, array)\\n#6 /srv/mediawiki/php-master/includes/filerepo/file/LocalFileRestoreBatch.php(307): Wikimedia\\\\Rdbms\\\\DBConnRef->insert(string, array, string)\\n#7 /srv/mediawiki/php-master/includes/filerepo/file/LocalFile.php(2041): LocalFileRestoreBatch->execute()\\n#8 /srv/mediawiki/php-master/includes/page/PageArchive.php(427): LocalFile->restore(NULL, boolean)\\n#9 /srv/mediawiki/php-master/includes/api/ApiUndelete.php(74): PageArchive->undelete(array, string, NULL, boolean, User, NULL)\\n#10 /srv/mediawiki/php-master/includes/api/ApiMain.php(1590): ApiUndelete->execute()\\n#11 /srv/mediawiki/php-master/includes/api/ApiMain.php(522): ApiMain->executeAction()\\n#12 /srv/mediawiki/php-master/includes/api/ApiMain.php(493): ApiMain->executeActionWithErrorHandling()\\n#13 /srv/mediawiki/php-master/api.php(84): ApiMain->execute()\\n#14 /srv/mediawiki/w/api.php(3): require(string)\\n#15 {main}\"},\"servedby\":\"deployment-mediawiki-07\"}","mode":"application/json"}}}