Page MenuHomePhabricator

Access to Watchlist in Wikidata returns a Fatal exception of type "Wikimedia\Rdbms\DBQueryError" (due to too many objects?)
Closed, ResolvedPublicBUG REPORT

Description

Hello,

for some days, when i try to access to the URL

https://www.wikidata.org/wiki/Special:Watchlist

I get one of the following two error messages (either the one or the other):

Althoug, this message does not appear for every access to the watchlist.

Maybe 9 of 10 times, the access returns the error,
while every 10th time the result of the watchlist is returned,
which shows, that there are currently 346.663 objects in my watchlist.


MediaWiki internal error.

Original exception: [894813ea-7b49-436e-9691-314372f95db4] 2022-01-09 12:48:42: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"

Error 1969: Query execution was interrupted (max_statement_time exceeded) (db1099:3318)
Function: SpecialWatchlist::doMainQuery
Query: SET STATEMENT max_statement_time=30 FOR SELECT  rc_id,rc_timestamp,rc_namespace,rc_title,rc_minor,rc_bot,rc_new,rc_cur_id,rc_this_oldid,rc_last_oldid,rc_type,rc_source,rc_patrolled,rc_ip,rc_old_len,rc_new_len,rc_deleted,rc_logid,rc_log_type,rc_log_action,rc_params,rc_actor,recentchanges_actor.actor_user AS `rc_user`,recentchanges_actor.actor_name AS `rc_user_text`,comment_rc_comment.comment_text AS `rc_comment_text`,comment_rc_comment.comment_data AS `rc_comment_data`,comment_rc_comment.comment_id AS `rc_comment_cid`,we_expiry,page_latest,wl_notificationtimestamp,(SELECT  GROUP_CONCAT(ctd_name SEPARATOR ',')  FROM `change_tag` JOIN `change_tag_def` ON ((ct_tag_id=ctd_id))   WHERE ct_rc_id=rc_id  ) AS `ts_tags`,ores_damaging_cls.oresc_probability AS `ores_damaging_score`,ores_goodfaith_cls.oresc_probability AS `ores_goodfaith_score`  FROM `recentchanges` JOIN `actor` `recentchanges_actor` ON ((actor_id=rc_actor)) JOIN `comment` `comment_rc_comment` ON ((comment_rc_comment.comment_id = rc_comment_id)) JOIN `watchlist` ON (wl_user = 1895734 AND (wl_namespace=rc_namespace) AND (wl_title=rc_title)) LEFT JOIN `watchlist_expiry` ON ((wl_id = we_item)) LEFT JOIN `page` ON ((rc_cur_id=page_id)) LEFT JOIN `ores_classification` `ores_damaging_cls` ON (ores_damaging_cls.oresc_model = 11 AND (ores_damaging_cls.oresc_rev=rc_this_oldid) AND ores_damaging_cls.oresc_class = 1) LEFT JOIN `ores_classification` `ores_goodfaith_cls` ON (ores_goodfaith_cls.oresc_model = 12 AND (ores_goodfaith_cls.oresc_rev=rc_this_oldid) AND ores_goodfaith_cls.oresc_class = 1)   WHERE (actor_name<>'M2k~dewiki') AND rc_bot = 0 AND (rc_timestamp >= '20211210124812') AND (we_expiry IS NULL OR we_expiry > '20220109124812') AND ((rc_type != 3) OR ((rc_deleted & 1) != 1)) AND (rc_source != 'wb')  ORDER BY rc_timestamp DESC LIMIT 250

from /srv/mediawiki/php-1.38.0-wmf.16/includes/libs/rdbms/database/Database.php(1799)
#0 /srv/mediawiki/php-1.38.0-wmf.16/includes/libs/rdbms/database/Database.php(1783): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
#1 /srv/mediawiki/php-1.38.0-wmf.16/includes/libs/rdbms/database/Database.php(1758): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#2 /srv/mediawiki/php-1.38.0-wmf.16/includes/libs/rdbms/database/Database.php(1302): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#3 /srv/mediawiki/php-1.38.0-wmf.16/includes/libs/rdbms/database/Database.php(2002): Wikimedia\Rdbms\Database->query(string, string, integer)
#4 /srv/mediawiki/php-1.38.0-wmf.16/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#5 /srv/mediawiki/php-1.38.0-wmf.16/includes/libs/rdbms/database/DBConnRef.php(295): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6 /srv/mediawiki/php-1.38.0-wmf.16/includes/specials/SpecialWatchlist.php(470): Wikimedia\Rdbms\DBConnRef->select(array, array, array, string, array, array)
#7 /srv/mediawiki/php-1.38.0-wmf.16/includes/specialpage/ChangesListSpecialPage.php(1018): SpecialWatchlist->doMainQuery(array, array, array, array, array, FormOptions)
#8 /srv/mediawiki/php-1.38.0-wmf.16/includes/specialpage/ChangesListSpecialPage.php(617): ChangesListSpecialPage->getRows()
#9 /srv/mediawiki/php-1.38.0-wmf.16/includes/specials/SpecialWatchlist.php(125): ChangesListSpecialPage->execute(NULL)
#10 /srv/mediawiki/php-1.38.0-wmf.16/includes/specialpage/SpecialPage.php(671): SpecialWatchlist->execute(NULL)
#11 /srv/mediawiki/php-1.38.0-wmf.16/includes/specialpage/SpecialPageFactory.php(1378): SpecialPage->run(NULL)
#12 /srv/mediawiki/php-1.38.0-wmf.16/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#13 /srv/mediawiki/php-1.38.0-wmf.16/includes/MediaWiki.php(903): MediaWiki->performRequest()
#14 /srv/mediawiki/php-1.38.0-wmf.16/includes/MediaWiki.php(563): MediaWiki->main()
#15 /srv/mediawiki/php-1.38.0-wmf.16/index.php(53): MediaWiki->run()
#16 /srv/mediawiki/php-1.38.0-wmf.16/index.php(46): wfIndexMain()
#17 /srv/mediawiki/w/index.php(3): require(string)
#18 {main}

Exception caught inside exception handler.

Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information.


Es ist ein Datenbankabfragefehler aufgetreten. Dies könnte auf einen Fehler in der Software hindeuten.

[0c73f969-b853-4cb5-9904-9c201a76fc8e] 2022-01-09 12:51:02: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“


Thanks a lot!

Kind regards,
M2k~dewiki

Event Timeline

Like @RhinosF1, I would say this is occurring due to T297708 and yes, it is due to the very high number of items in your watchlist.

I just ran that query manually and it took 71 seconds. (this can change depending on the server load too).
Keep in mind that we have a query killer that kills queries after 60 seconds, so even without the work around done at T297708 (which is something we really need), the query would have never finished anyways, as the other query killer would have caught it.

The only way is either optimize this query (not sure if that can be done really) or split it into smaller but faster queries and then combine the result.

This is part of the bigger problem of recentchanges table in wikidata (= T239192). I try to write some notes there.