Page MenuHomePhabricator

Watchlist reset fails "Lock wait timeout exceeded: WatchedItemStore::setNotificationTimestampsForUser" (from API setnotificationtimestamp)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Request ID: W9tWQQpAMEAAAKXLgKIAAADJ

message
A database query error has occurred. [..]
Query: UPDATE  `watchlist` SET wl_notificationtimestamp = NULL WHERE wl_user = '#######'
Function: WatchedItemStore::setNotificationTimestampsForUser
Error: 1205 Lock wait timeout exceeded; try restarting transaction

channel: exception
exception.class: Wikimedia\Rdbms\DBQueryError
trace
#3 /srv/mediawiki/php-1.33.0-wmf.1/includes/libs/rdbms/database/DBConnRef.php(49): Wikimedia\Rdbms\Database->update(string, array, array, string)
#4 /srv/mediawiki/php-1.33.0-wmf.1/includes/libs/rdbms/database/DBConnRef.php(313): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#5 /srv/mediawiki/php-1.33.0-wmf.1/includes/watcheditem/WatchedItemStore.php(805): Wikimedia\Rdbms\DBConnRef->update(string, array, array, string)
#6 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiSetNotificationTimestamp.php(114): WatchedItemStore->setNotificationTimestampsForUser(User, NULL)
#7 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiMain.php(1570): ApiSetNotificationTimestamp->execute()
#8 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiMain.php(531): ApiMain->executeAction()
#9 /srv/mediawiki/php-1.33.0-wmf.1/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#10 /srv/mediawiki/php-1.33.0-wmf.1/api.php(87): ApiMain->execute()
#11 /srv/mediawiki/w/api.php(3): include(string)

Impact

The user action is aborted with a fatal exception.

In this case the "Reset" button on the user's Watchlist that is meant to mark all changes as "read", fails with a fatal error (not shown to the user when JavaScript is disabled). After which the user can try it again without JavaScript and may or may not fail again (this time with technical fatal exception shown to the user without further instructions or details).

Notes

The following errors are similar in nature (resultant from the same kind of code problem) but are in different code paths and triggered by different user actions, as such as separate task was created. It is likely that whatever approach is taken by the others might be applicable here as well:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM
kostajh subscribed.

I see four instances of this in the last 60 days, so I'm going to mark this as Triaged but Future on our board as I don't think Growth-Team would be able to prioritize it in the short-to-medium term.

Umherirrender subscribed.

With the fix of T207941 this should already gone, because the stack trace changed and now the reset for whole watchlist is done in batches