Page MenuHomePhabricator

addWiki.php failed when run from enwiki in Beta Cluster, trying to run Flagged Revs code where none was enabled
Open, Needs TriagePublic

Description

jforrester@deployment-deploy01:/srv/mediawiki-staging$ mwscript extensions/WikimediaMaintenance/addWiki.php --wiki=enwiki en wikimedia wikifunctionswiki wikifunctions.beta.wmflabs.org
Creating database wikifunctionswiki for en.wikimedia (English)
Initialising tables
Initialising external storage cluster1...
Initialising external storage flow_cluster1...
Writing main page to Main_Page
Wikimedia\Rdbms\DBQueryError from line 1833 of /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php: Error 1146: Table 'wikifunctionswiki.flaggedpages' doesn't exist (deployment-db07)
Function: FlaggableWikiPage::pageData
Query: SELECT  page_id,page_namespace,page_title,page_restrictions,page_is_redirect,page_is_new,page_random,page_touched,page_links_updated,page_latest,page_len,page_content_model,fpc_override,fpc_level,fpc_expiry,fp_pending_since,fp_stable,fp_reviewed  FROM `page` LEFT JOIN `flaggedpages` ON ((fp_page_id = page_id)) LEFT JOIN `flaggedpage_config` ON ((fpc_page_id = page_id))   WHERE page_namespace = 0 AND page_title = 'Main_Page'  LIMIT 1

#0 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(1817): Wikimedia\Rdbms\Database->getQueryException('Table 'wikifunc...', 1146, 'SELECT  page_id...', 'FlaggableWikiPa...')
#1 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(1792): Wikimedia\Rdbms\Database->getQueryExceptionAndLog('Table 'wikifunc...', 1146, 'SELECT  page_id...', 'FlaggableWikiPa...')
#2 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(1327): Wikimedia\Rdbms\Database->reportQueryError('Table 'wikifunc...', 1146, 'SELECT  page_id...', 'FlaggableWikiPa...', false)
#3 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(2036): Wikimedia\Rdbms\Database->query('SELECT  page_id...', 'FlaggableWikiPa...', 32)
#4 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(2136): Wikimedia\Rdbms\Database->select(Array, Array, Array, 'FlaggableWikiPa...', Array, Array)
#5 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->selectRow(Array, Array, Array, 'FlaggableWikiPa...', Array, Array)
#6 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/DBConnRef.php(342): Wikimedia\Rdbms\DBConnRef->__call('selectRow', Array)
#7 /srv/mediawiki-staging/php-master/extensions/FlaggedRevs/backend/FlaggableWikiPage.php(376): Wikimedia\Rdbms\DBConnRef->selectRow(Array, Array, Array, 'FlaggableWikiPa...', Array, Array)
#8 /srv/mediawiki-staging/php-master/includes/page/WikiPage.php(439): FlaggableWikiPage->pageData(Object(Wikimedia\Rdbms\MaintainableDBConnRef), Array, Array)
#9 /srv/mediawiki-staging/php-master/extensions/FlaggedRevs/backend/FlaggableWikiPage.php(403): WikiPage->pageDataFromTitle(Object(Wikimedia\Rdbms\MaintainableDBConnRef), Object(Title))
#10 /srv/mediawiki-staging/php-master/extensions/FlaggedRevs/backend/FlaggedRevsHooks.php(415): FlaggableWikiPage->loadPageData(1)
#11 /srv/mediawiki-staging/php-master/includes/HookContainer/HookContainer.php(338): FlaggedRevsHooks::maybeMakeEditReviewed(Object(WikiPage), Object(MediaWiki\Revision\RevisionStoreRecord), false, Object(User), Array)
#12 /srv/mediawiki-staging/php-master/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook('RevisionFromEdi...', Array, Array, Array)
#13 /srv/mediawiki-staging/php-master/includes/HookContainer/HookRunner.php(3170): MediaWiki\HookContainer\HookContainer->run('RevisionFromEdi...', Array)
#14 /srv/mediawiki-staging/php-master/includes/Storage/PageUpdater.php(1411): MediaWiki\HookContainer\HookRunner->onRevisionFromEditComplete(Object(WikiPage), Object(MediaWiki\Revision\RevisionStoreRecord), false, Object(User), Array)
#15 /srv/mediawiki-staging/php-master/includes/Storage/PageUpdater.php(872): MediaWiki\Storage\PageUpdater->doCreate(Object(CommentStoreComment))
#16 /srv/mediawiki-staging/php-master/includes/page/WikiPage.php(1967): MediaWiki\Storage\PageUpdater->saveRevision(Object(CommentStoreComment), 65)
#17 /srv/mediawiki-staging/php-master/extensions/WikimediaMaintenance/addWiki.php(175): WikiPage->doUserEditContent(Object(WikitextContent), Object(User), Object(CommentStoreComment), 65)
#18 /srv/mediawiki-staging/php-master/maintenance/doMaintenance.php(108): AddWiki->execute()
#19 /srv/mediawiki-staging/php-master/extensions/WikimediaMaintenance/addWiki.php(467): require_once('/srv/mediawiki-...')
#20 /srv/mediawiki-staging/multiversion/MWScript.php(116): require_once('/srv/mediawiki-...')
#21 {main}
[960a0227aa21dcd844fdad9d] [no req]   Wikimedia\Rdbms\DBTransactionError: Explicit transaction still active. A caller may have caught an error. Open transactions: MediaWiki\Storage\PageUpdater::doCreate
Backtrace:
from /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(1640)
#0 /srv/mediawiki-staging/php-master/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1757): Wikimedia\Rdbms\Database->assertNoOpenTransactions()
#1 /srv/mediawiki-staging/php-master/includes/libs/rdbms/loadbalancer/LoadBalancer.php(2350): Wikimedia\Rdbms\LoadBalancer->Wikimedia\Rdbms\{closure}(Wikimedia\Rdbms\DatabaseMysqli)
#2 /srv/mediawiki-staging/php-master/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1787): Wikimedia\Rdbms\LoadBalancer->forEachOpenPrimaryConnection(Closure)
#3 /srv/mediawiki-staging/php-master/includes/libs/rdbms/lbfactory/LBFactory.php(249): Wikimedia\Rdbms\LoadBalancer->approvePrimaryChanges(array, string, integer)
#4 /srv/mediawiki-staging/php-master/includes/libs/rdbms/lbfactory/LBFactoryMulti.php(236): Wikimedia\Rdbms\LBFactory::Wikimedia\Rdbms\{closure}(Wikimedia\Rdbms\LoadBalancer, string, array)
#5 /srv/mediawiki-staging/php-master/includes/libs/rdbms/lbfactory/LBFactory.php(251): Wikimedia\Rdbms\LBFactoryMulti->forEachLB(Closure, array)
#6 /srv/mediawiki-staging/php-master/includes/libs/rdbms/lbfactory/LBFactory.php(315): Wikimedia\Rdbms\LBFactory->forEachLBCallMethod(string, array)
#7 /srv/mediawiki-staging/php-master/maintenance/includes/Maintenance.php(1248): Wikimedia\Rdbms\LBFactory->commitPrimaryChanges(string)
#8 /srv/mediawiki-staging/php-master/maintenance/doMaintenance.php(130): Maintenance->shutdown()
#9 /srv/mediawiki-staging/php-master/extensions/WikimediaMaintenance/addWiki.php(467): require_once(string)
#10 /srv/mediawiki-staging/multiversion/MWScript.php(116): require_once(string)
#11 {main}

Event Timeline

Tacsipacsi subscribed.

If FlaggedRevs code fails even though it shouldn’t be enabled in the first place, that’s not FlaggedRevs’ fault. By the way, I don’t know how this script works, but --wiki=enwiki looks suspicious to me, since the English Wikipedia does have FlaggedRevs.

Yeah, I forgot, thanks for reminding me, we usually choose aawiki for production and not setting aawiki has caused issues (e.g. to be created in the wrong section, lovely) in production. I'm not sure if it's the root cause here but I suggest running it using aawiki (I think we created aawiki in beta cluster exactly for this reason)

Hmm. But should the script really use the extensions of the host wiki for which extension tables to run? This seems conceptually wrong…

addWiki is one of the most terrible things we have (with stiff competition with FlaggedRevs). I wrote some of my experiences with it in T158730#5527658

Pppery subscribed.
This comment was removed by Pppery.
Pppery renamed this task from addWiki.php failed in Beta Cluster, trying to run Flagged Revs code where none was enabled to addWiki.php failed when run from enwiki in Beta Cluster, trying to run Flagged Revs code where none was enabled.Apr 5 2024, 2:38 AM
Pppery reopened this task as Open.
Pppery unsubscribed.