Page MenuHomePhabricator

Wikimedia\Rdbms\DBQueryError: Error 1146: Table 'mediawikiwiki.discussiontools_subscription' doesn't exist (10.64.16.7)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   Wikimedia\Rdbms\DBQueryError: Error 1146: Table 'mediawikiwiki.discussiontools_subscription' doesn't exist (10.64.16.7)
Function: MediaWiki\Extension\DiscussionTools\SubscriptionStore::fetchSubscriptions
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.1/includes/libs/rdbms/database/Database.php(1738)
#0 /srv/mediawiki/php-1.37.0-wmf.1/includes/libs/rdbms/database/Database.php(1722): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
#1 /srv/mediawiki/php-1.37.0-wmf.1/includes/libs/rdbms/database/Database.php(1697): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#2 /srv/mediawiki/php-1.37.0-wmf.1/includes/libs/rdbms/database/Database.php(1260): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#3 /srv/mediawiki/php-1.37.0-wmf.1/includes/libs/rdbms/database/Database.php(1948): Wikimedia\Rdbms\Database->query(string, string, integer)
#4 /srv/mediawiki/php-1.37.0-wmf.1/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->select(string, array, array, string)
#5 /srv/mediawiki/php-1.37.0-wmf.1/includes/libs/rdbms/database/DBConnRef.php(313): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#6 /srv/mediawiki/php-1.37.0-wmf.1/extensions/DiscussionTools/includes/SubscriptionStore.php(92): Wikimedia\Rdbms\DBConnRef->select(string, array, array, string)
#7 /srv/mediawiki/php-1.37.0-wmf.1/extensions/DiscussionTools/includes/SubscriptionStore.php(121): MediaWiki\Extension\DiscussionTools\SubscriptionStore->fetchSubscriptions(Wikimedia\Rdbms\DBConnRef, User, string, NULL)
#8 /srv/mediawiki/php-1.37.0-wmf.1/extensions/DiscussionTools/includes/Hooks/PageHooks.php(138): MediaWiki\Extension\DiscussionTools\SubscriptionStore->getSubscriptionItemsForUser(User, string)
#9 [internal function]: MediaWiki\Extension\DiscussionTools\Hooks\PageHooks->MediaWiki\Extension\DiscussionTools\Hooks\{closure}(array)
#10 /srv/mediawiki/php-1.37.0-wmf.1/extensions/DiscussionTools/includes/Hooks/PageHooks.php(150): preg_replace_callback(string, Closure, string)
#11 /srv/mediawiki/php-1.37.0-wmf.1/includes/HookContainer/HookContainer.php(160): MediaWiki\Extension\DiscussionTools\Hooks\PageHooks->onOutputPageBeforeHTML(OutputPage, string)
#12 /srv/mediawiki/php-1.37.0-wmf.1/includes/HookContainer/HookRunner.php(2762): MediaWiki\HookContainer\HookContainer->run(string, array)
#13 /srv/mediawiki/php-1.37.0-wmf.1/includes/OutputPage.php(2007): MediaWiki\HookContainer\HookRunner->onOutputPageBeforeHTML(OutputPage, string)
#14 /srv/mediawiki/php-1.37.0-wmf.1/includes/OutputPage.php(2019): OutputPage->addParserOutputText(ParserOutput, array)
#15 /srv/mediawiki/php-1.37.0-wmf.1/includes/page/Article.php(796): OutputPage->addParserOutput(ParserOutput, array)
#16 /srv/mediawiki/php-1.37.0-wmf.1/includes/page/Article.php(654): Article->doOutputFromParserCache(ParserOutput, OutputPage, array)
#17 /srv/mediawiki/php-1.37.0-wmf.1/includes/page/Article.php(561): Article->generateContentOutput(User, ParserOptions, integer, OutputPage, array)
#18 /srv/mediawiki/php-1.37.0-wmf.1/includes/actions/ViewAction.php(74): Article->view()
#19 /srv/mediawiki/php-1.37.0-wmf.1/includes/MediaWiki.php(535): ViewAction->show()
#20 /srv/mediawiki/php-1.37.0-wmf.1/includes/MediaWiki.php(319): MediaWiki->performAction(Article, Title)
#21 /srv/mediawiki/php-1.37.0-wmf.1/includes/MediaWiki.php(916): MediaWiki->performRequest()
#22 /srv/mediawiki/php-1.37.0-wmf.1/includes/MediaWiki.php(550): MediaWiki->main()
#23 /srv/mediawiki/php-1.37.0-wmf.1/index.php(53): MediaWiki->run()
#24 /srv/mediawiki/php-1.37.0-wmf.1/index.php(46): wfIndexMain()
#25 /srv/mediawiki/w/index.php(3): require(string)
#26 {main}
Impact

MediaWiki.org cannot be accessed by people with discussiontools enabled (try appending ?dtenable=1 to reproduce).

Notes

Event Timeline

Urbanecm renamed this task from Wikimedia\Rdbms\DBQueryError: Error 1146: Table 'mediawikiwiki.discussiontools_subscription' doesn't exist (10.64.16.7)Function: MediaWiki\Extension\DiscussionTools\SubscriptionStore::fetchSubscriptionsQuery: SELECT sub_user,sub_item,sub_namespace,sub_title,sub_section,sub_state,sub_created,sub_notified FROM `discussiontools_subscription` WHERE sub_user = 1967330 AND sub_item = 'h-' to Wikimedia\Rdbms\DBQueryError: Error 1146: Table 'mediawikiwiki.discussiontools_subscription' doesn't exist (10.64.16.7).Tue, Apr 13, 9:31 PM
Urbanecm triaged this task as Unbreak Now! priority.
Urbanecm updated the task description. (Show Details)
matmarex added a subscriber: matmarex.

The table is not supposed to exist yet, but there should not be any errors because of that.

The error only occurs if you use the 'dtenable' query parameter, or the 'discussiontools-tempenable' cookie, which can be used to enable otherwise unavailable DiscussionTools features. They should not allow enabling this one.

Change 678978 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Don't allow query and cookie hacks to enable topic subscriptions

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

Also, we have a task to remove the cookie hack: T277783. I think this bug is an argument to prioritize that. It probably would not have been a release blocker if the bug only occurred when using the query parameter (which you have to do on a case-by-case basis).

Change 678978 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Don't allow query and cookie hacks to enable topic subscriptions

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

Change 678994 had a related patch set uploaded (by Urbanecm; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@wmf/1.37.0-wmf.1] Don't allow query and cookie hacks to enable topic subscriptions

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

Change 678994 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@wmf/1.37.0-wmf.1] Don't allow query and cookie hacks to enable topic subscriptions

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

Mentioned in SAL (#wikimedia-operations) [2021-04-14T09:24:15Z] <urbanecm@deploy1002> Synchronized php-1.37.0-wmf.1/extensions/DiscussionTools/includes/Hooks/HookUtils.php: e4b2d93dcf86a336314ed09fd37844edb16f4f30: Dont allow query and cookie hacks to enable topic subscriptions (T280082) (duration: 01m 24s)

MediaWiki is back up for me again. This should no longer block the train. Thanks @matmarex for the patch :).

Thank you for backporting!

Any time :)