Page MenuHomePhabricator

UnexpectedValueException: Wikimedia\Rdbms\InsertQueryBuilder::execute can't have empty $rows value (via WatchedItemStore::updateExpiries)
Closed, ResolvedPublicPRODUCTION ERROR

Description

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

  • Open a page on en.wikipedia.org
  • Enable the twinkle gadget
  • Click on TW gadget and click on Tag from the dropdown menu
  • Search and fill in the forms to add the {{merge to}} template
  • Click on add tag

What happens?:
Page should save successfully

What should have happened instead?:
The following error pops up sometimes (the UUID will be different): [1e935168-0b71-4982-b586-8736860e3da7] Caught exception of type UnexpectedValueException

Other information (browser name/version, screenshots, etc.):

Screenshot_from_2023-09-28_13-37-21.png (201×729 px, 28 KB)

Error
normalized_message
[{reqId}] {exception_url}   UnexpectedValueException: Wikimedia\Rdbms\InsertQueryBuilder::execute can't have empty $rows value
exception.trace
from /srv/mediawiki/php-1.41.0-wmf.27/includes/libs/rdbms/querybuilder/InsertQueryBuilder.php(318)
#0 /srv/mediawiki/php-1.41.0-wmf.27/includes/watcheditem/WatchedItemStore.php(1145): Wikimedia\Rdbms\InsertQueryBuilder->execute()
#1 /srv/mediawiki/php-1.41.0-wmf.27/includes/watcheditem/WatchedItemStore.php(1109): WatchedItemStore->updateExpiries(Wikimedia\Rdbms\DBConnRef, string, string)
#2 /srv/mediawiki/php-1.41.0-wmf.27/includes/watcheditem/WatchedItemStore.php(1050): WatchedItemStore->updateOrDeleteExpiries(Wikimedia\Rdbms\DBConnRef, integer, array, string)
#3 /srv/mediawiki/php-1.41.0-wmf.27/includes/watcheditem/WatchedItemStore.php(978): WatchedItemStore->addWatchBatchForUser(User, array, string)
#4 /srv/mediawiki/php-1.41.0-wmf.27/includes/watchlist/WatchlistManager.php(382): WatchedItemStore->addWatch(User, MediaWiki\Title\Title, string)
#5 /srv/mediawiki/php-1.41.0-wmf.27/includes/watchlist/WatchlistManager.php(512): MediaWiki\Watchlist\WatchlistManager->addWatchIgnoringRights(User, MediaWiki\Title\Title, string)
#6 /srv/mediawiki/php-1.41.0-wmf.27/includes/editpage/EditPage.php(2676): MediaWiki\Watchlist\WatchlistManager->setWatch(boolean, User, MediaWiki\Title\Title, string)
#7 /srv/mediawiki/php-1.41.0-wmf.27/includes/editpage/EditPage.php(2533): MediaWiki\EditPage\EditPage->updateWatchlist()
#8 /srv/mediawiki/php-1.41.0-wmf.27/includes/editpage/EditPage.php(1805): MediaWiki\EditPage\EditPage->internalAttemptSave(array, boolean, boolean)
#9 /srv/mediawiki/php-1.41.0-wmf.27/includes/api/ApiEditPage.php(532): MediaWiki\EditPage\EditPage->attemptSave(array)
#10 /srv/mediawiki/php-1.41.0-wmf.27/includes/api/ApiMain.php(1929): ApiEditPage->execute()
#11 /srv/mediawiki/php-1.41.0-wmf.27/includes/api/ApiMain.php(906): ApiMain->executeAction()
#12 /srv/mediawiki/php-1.41.0-wmf.27/includes/api/ApiMain.php(877): ApiMain->executeActionWithErrorHandling()
#13 /srv/mediawiki/php-1.41.0-wmf.27/api.php(95): ApiMain->execute()
#14 /srv/mediawiki/php-1.41.0-wmf.27/api.php(48): wfApiMain()
#15 /srv/mediawiki/w/api.php(3): require(string)
#16 {main}

Event Timeline

Noting that this does not seem like a Twinkle Gadget related issue, even though it does show up while using twinkle.

Ammarpad renamed this task from Error on using the {{merge to}} functionality on Twinkle to UnexpectedValueException: Wikimedia\Rdbms\InsertQueryBuilder::execute can't have empty $rows value.Sep 28 2023, 6:04 PM
Ammarpad updated the task description. (Show Details)

I have seen the error before (in different context) and was about to fix it.

Change 961874 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] WatchedItemStore::updateExpires: Return early when 0 pages to update

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

Aklapper changed the subtype of this task from "Bug Report" to "Production Error".

Looks like James was faster cooking up a patch :)

Umherirrender renamed this task from UnexpectedValueException: Wikimedia\Rdbms\InsertQueryBuilder::execute can't have empty $rows value to UnexpectedValueException: Wikimedia\Rdbms\InsertQueryBuilder::execute can't have empty $rows value (via WatchedItemStore::updateExpiries).Sep 28 2023, 6:49 PM

Looks like James was faster cooking up a patch :)

Hah, sorry about this; back from meeting and have tweaked my patch.

No issue, should have left it. But I think lowering the error level is also good.

Change 961874 merged by jenkins-bot:

[mediawiki/core@master] InsertQueryBuilder: When passed no rows, warn rather than die for now

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

Change 961896 had a related patch set uploaded (by Ammarpad; author: Ammarpad):

[mediawiki/core@master] WatchedItemStore: Avoid table insert with empty rows

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

Change 961896 merged by jenkins-bot:

[mediawiki/core@master] WatchedItemStore: Avoid table insert with empty rows

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