Page MenuHomePhabricator

Special:NewPages - Exception caught inside exception handler when filtering using associated namespace
Closed, ResolvedPublic

Description

Error message
MediaWiki internal error.

Original exception: [XfhsPQpAADwAAJ22fjYAAAAN] 2019-12-17 05:48:45: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"

Exception caught inside exception handler.

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

Trying to use filtering of registered users following T238483: Special:NewPages - allow hiding pages created by users when non-users can create talk pages
Can be reproduced by following the same link - consistently returns an error
A bit of testing reveals that there is generally an error when attempting to use associated namespaces (eg https://en.wikipedia.org/wiki/Special:NewPages?namespace=2&invert=&associated=1&limit=100)

Details

Request ID
XfhsPQpAADwAAJ22fjYAAAAN
Request URL
https://en.wikipedia.org/wiki/Special:NewPages?namespace=2&invert=1&associated=1&tagfilter=&username=&size-mode=max&size=10&wpFormIdentifier=newpagesform&limit=100
Stack Trace
#0 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1159): Wikimedia\Rdbms\Database->assertQueryIsCurrentlyAllowed(string, string)
#1 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1828): Wikimedia\Rdbms\Database->query(string, string)
#2 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1920): Wikimedia\Rdbms\Database->select(string, array, array, string, array, array)
#3 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->selectRow(string, array, array, string)
#4 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(336): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#5 /srv/mediawiki/php-master/includes/cache/LinkCache.php(331): Wikimedia\Rdbms\DBConnRef->selectRow(string, array, array, string)
#6 /srv/mediawiki/php-master/includes/cache/LinkCache.php(280): LinkCache->fetchPageRow(Wikimedia\Rdbms\MaintainableDBConnRef, Title)
#7 /srv/mediawiki/php-master/includes/Title.php(3177): LinkCache->addLinkObj(Title)
#8 /srv/mediawiki/php-master/includes/Title.php(4133): Title->getArticleID(integer)
#9 /srv/mediawiki/php-master/extensions/GrowthExperiments/includes/HelpPanel.php(120): Title->exists()
#10 /srv/mediawiki/php-master/extensions/GrowthExperiments/includes/HelpPanelHooks.php(83): GrowthExperiments\HelpPanel::shouldShowHelpPanel(OutputPage)
#11 /srv/mediawiki/php-master/includes/Hooks.php(174): GrowthExperiments\HelpPanelHooks::onBeforePageDisplay(OutputPage, SkinVector)
#12 /srv/mediawiki/php-master/includes/Hooks.php(234): Hooks::callHook(string, array, array, NULL, string)
#13 /srv/mediawiki/php-master/includes/OutputPage.php(2623): Hooks::runWithoutAbort(string, array)
#14 /srv/mediawiki/php-master/includes/exception/MWExceptionRenderer.php(150): OutputPage->output()
#15 /srv/mediawiki/php-master/includes/exception/MWExceptionRenderer.php(64): MWExceptionRenderer::reportHTML(Wikimedia\Rdbms\DBQueryError)
#16 /srv/mediawiki/php-master/includes/exception/MWExceptionHandler.php(103): MWExceptionRenderer::output(Wikimedia\Rdbms\DBQueryError, integer)
#17 /srv/mediawiki/php-master/includes/exception/MWExceptionHandler.php(177): MWExceptionHandler::report(Wikimedia\Rdbms\DBQueryError)
#18 /srv/mediawiki/php-master/includes/MediaWiki.php(563): MWExceptionHandler::handleException(Wikimedia\Rdbms\DBQueryError)
#19 /srv/mediawiki/php-master/index.php(46): MediaWiki->run()
#20 /srv/mediawiki/w/index.php(3): require(string)
#21 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
DannyS712 renamed this task from Exception caught inside exception handler. to Special:NewPages - Exception caught inside exception handler.when filtering using associated namespace.Dec 17 2019, 5:54 AM
DannyS712 moved this task from Unsorted to Reports on the User-DannyS712 board.
DannyS712 updated the task description. (Show Details)
DannyS712 renamed this task from Special:NewPages - Exception caught inside exception handler.when filtering using associated namespace to Special:NewPages - Exception caught inside exception handler when filtering using associated namespace.Dec 17 2019, 5:57 AM

https://en.wikipedia.beta.wmflabs.org/wiki/Special:NewPages?namespace=0&invert=1&associated=1&tagfilter=&username=&size-mode=min&size=&wpFormIdentifier=newpagesform&limit=100 reveals:

MediaWiki internal error.

Original exception: [XfhulKwQBHcAAETGpvgAAABT] /wiki/Special:NewPages?namespace=0&invert=1&associated=1&tagfilter=&username=&size-mode=min&size=&wpFormIdentifier=newpagesform&limit=100 Wikimedia\Rdbms\DBQueryError from line 1626 of /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: 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,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`,actor_rc_user.actor_user AS `rc_user`,actor_rc_user.actor_name AS `rc_user_text`,rc_actor,page_len AS `length`,page_latest AS `rev_id`,page_namespace,page_title,fp_stable,fp_pending_since,(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` FROM `recentchanges` JOIN `comment` `comment_rc_comment` ON ((comment_rc_comment.comment_id = rc_comment_id)) JOIN `actor` `actor_rc_user` ON ((actor_rc_user.actor_id = rc_actor)) JOIN `page` ON ((page_id=rc_cur_id)) LEFT JOIN `flaggedpages` ON ((fp_page_id = rc_cur_id)) WHERE rc_new = 1 AND (rc_namespace != 0AND rc_namespace != 1) AND page_is_redirect = 0 ORDER BY rc_timestamp DESC LIMIT 101
Function: IndexPager::buildQueryInfo (NewPagesPager)
Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rc_namespace != 1) AND page_is_redirect = 0 ORDER BY rc_timestamp DESC LIMIT 10' at line 1 (172.16.4.147:3306)
Backtrace:
#0 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1610): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
#1 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1587): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#2 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1166): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#3 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1828): Wikimedia\Rdbms\Database->query(string, string)
#4 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#5 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(318): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6 /srv/mediawiki/php-master/includes/pager/IndexPager.php(425): Wikimedia\Rdbms\DBConnRef->select(array, array, array, string, array, array)
#7 /srv/mediawiki/php-master/includes/pager/IndexPager.php(270): IndexPager->reallyDoQuery(string, integer, boolean)
#8 /srv/mediawiki/php-master/includes/pager/IndexPager.php(616): IndexPager->doQuery()
#9 /srv/mediawiki/php-master/includes/specials/SpecialNewpages.php(162): IndexPager->getNumRows()
#10 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(575): SpecialNewpages->execute(NULL)
#11 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(611): SpecialPage->run(NULL)
#12 /srv/mediawiki/php-master/includes/MediaWiki.php(298): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#13 /srv/mediawiki/php-master/includes/MediaWiki.php(967): MediaWiki->performRequest()
#14 /srv/mediawiki/php-master/includes/MediaWiki.php(530): MediaWiki->main()
#15 /srv/mediawiki/php-master/index.php(46): MediaWiki->run()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}
Exception caught inside exception handler: [XfhulKwQBHcAAETGpvgAAABT] /wiki/Special:NewPages?namespace=0&invert=1&associated=1&tagfilter=&username=&size-mode=min&size=&wpFormIdentifier=newpagesform&limit=100 Wikimedia\Rdbms\DBTransactionStateError from line 1433 of /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php: Cannot execute query from LinkCache::fetchPageRow while transaction status is ERROR
Backtrace:
#0 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1159): Wikimedia\Rdbms\Database->assertQueryIsCurrentlyAllowed(string, string)
#1 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1828): Wikimedia\Rdbms\Database->query(string, string)
#2 /srv/mediawiki/php-master/includes/libs/rdbms/database/Database.php(1920): Wikimedia\Rdbms\Database->select(string, array, array, string, array, array)
#3 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->selectRow(string, array, array, string)
#4 /srv/mediawiki/php-master/includes/libs/rdbms/database/DBConnRef.php(336): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#5 /srv/mediawiki/php-master/includes/cache/LinkCache.php(331): Wikimedia\Rdbms\DBConnRef->selectRow(string, array, array, string)
#6 /srv/mediawiki/php-master/includes/cache/LinkCache.php(280): LinkCache->fetchPageRow(Wikimedia\Rdbms\MaintainableDBConnRef, Title)
#7 /srv/mediawiki/php-master/includes/Title.php(3177): LinkCache->addLinkObj(Title)
#8 /srv/mediawiki/php-master/includes/Title.php(4133): Title->getArticleID(integer)
#9 /srv/mediawiki/php-master/extensions/GrowthExperiments/includes/HelpPanel.php(120): Title->exists()
#10 /srv/mediawiki/php-master/extensions/GrowthExperiments/includes/HelpPanelHooks.php(83): GrowthExperiments\HelpPanel::shouldShowHelpPanel(OutputPage)
#11 /srv/mediawiki/php-master/includes/Hooks.php(174): GrowthExperiments\HelpPanelHooks::onBeforePageDisplay(OutputPage, SkinVector)
#12 /srv/mediawiki/php-master/includes/Hooks.php(234): Hooks::callHook(string, array, array, NULL, string)
#13 /srv/mediawiki/php-master/includes/OutputPage.php(2623): Hooks::runWithoutAbort(string, array)
#14 /srv/mediawiki/php-master/includes/exception/MWExceptionRenderer.php(150): OutputPage->output()
#15 /srv/mediawiki/php-master/includes/exception/MWExceptionRenderer.php(64): MWExceptionRenderer::reportHTML(Wikimedia\Rdbms\DBQueryError)
#16 /srv/mediawiki/php-master/includes/exception/MWExceptionHandler.php(103): MWExceptionRenderer::output(Wikimedia\Rdbms\DBQueryError, integer)
#17 /srv/mediawiki/php-master/includes/exception/MWExceptionHandler.php(177): MWExceptionHandler::report(Wikimedia\Rdbms\DBQueryError)
#18 /srv/mediawiki/php-master/includes/MediaWiki.php(563): MWExceptionHandler::handleException(Wikimedia\Rdbms\DBQueryError)
#19 /srv/mediawiki/php-master/index.php(46): MediaWiki->run()
#20 /srv/mediawiki/w/index.php(3): require(string)
#21 {main}

There appear to be two different issues here - the sql error, and the exception handler's failure to handle it

Change 558328 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] NewPagesPager: Fix namespace query conditions

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

Change 558328 merged by jenkins-bot:
[mediawiki/core@master] NewPagesPager: Fix namespace query conditions

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

Change 558519 had a related patch set uploaded (by Jforrester; owner: DannyS712):
[mediawiki/core@wmf/1.35.0-wmf.11] NewPagesPager: Fix namespace query conditions

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

Change 558559 had a related patch set uploaded (by Jforrester; owner: DannyS712):
[mediawiki/core@wmf/1.35.0-wmf.10] NewPagesPager: Fix namespace query conditions

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

Change 558562 had a related patch set uploaded (by Jforrester; owner: DannyS712):
[mediawiki/core@REL1_34] NewPagesPager: Fix namespace query conditions

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

Change 558562 merged by jenkins-bot:
[mediawiki/core@REL1_34] NewPagesPager: Fix namespace query conditions

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

Change 558519 merged by jenkins-bot:
[mediawiki/core@wmf/1.35.0-wmf.11] NewPagesPager: Fix namespace query conditions

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

Change 558559 merged by jenkins-bot:
[mediawiki/core@wmf/1.35.0-wmf.10] NewPagesPager: Fix namespace query conditions

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

Mentioned in SAL (#wikimedia-operations) [2019-12-17T16:07:24Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.11/includes/specials/pagers/NewPagesPager.php: T240924 NewPagesPager: Fix namespace query conditions (duration: 01m 02s)

Mentioned in SAL (#wikimedia-operations) [2019-12-17T16:14:10Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.10/includes/specials/pagers/NewPagesPager.php: T240924 NewPagesPager: Fix namespace query conditions (duration: 01m 03s)

Jdforrester-WMF closed this task as Resolved.Dec 17 2019, 4:15 PM
Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Thank you!

@Jdforrester-WMF should this be added to the release notes for 1.34 (https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/558562/) given that it was backported?

@Jdforrester-WMF should this be added to the release notes for 1.34 (https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/558562/) given that it was backported?

As we're about to do the release, I'll do a last-minute tune-up of the release notes, including this.

@Jdforrester-WMF should this be added to the release notes for 1.34 (https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/558562/) given that it was backported?

As we're about to do the release, I'll do a last-minute tune-up of the release notes, including this.

Never mind, @Reedy did it already in 3d47388b4faa7fcf4e96ba46acea7dac5c9afbf7.

DannyS712 moved this task from Reports to Merged on the User-DannyS712 board.Dec 26 2019, 6:05 AM