Page MenuHomePhabricator

DB error in PageTriage: Unknown column 'actor_rev_user.actor_user' in 'on clause'
Closed, ResolvedPublic

Description

A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT  rev_page AS page_id,user_id,user_name,user_real_name,user_registration,user_editcount,ipb_id,COALESCE( actor_rev_user.actor_name, rev_user_text ) AS `rev_user_text`  FROM `revision` LEFT JOIN `user` ON ((COALESCE( actor_rev_user.actor_user, rev_user ) = user_id)) LEFT JOIN `ipblocks` ON ((COALESCE( actor_rev_user.actor_user, rev_user ) = ipb_user) AND (COALESCE( actor_rev_user.actor_name, rev_user_text ) = ipb_address) AND (ipb_expiry > '20180918201335')) LEFT JOIN `revision_actor_temp` `temp_rev_user` ON ((temp_rev_user.revactor_rev = rev_id)) LEFT JOIN `actor` `actor_rev_user` ON ((actor_rev_user.actor_id = temp_rev_user.revactor_actor))   WHERE rev_id = '362490'  
Function: MediaWiki\Extension\PageTriage\ArticleCompile\ArticleCompileUserData::compile
Error: 1054 Unknown column 'actor_rev_user.actor_user' in 'on clause' (10.192.32.7)

#0 /srv/mediawiki/php-1.32.0-wmf.22/includes/libs/rdbms/database/Database.php(1428): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
#1 /srv/mediawiki/php-1.32.0-wmf.22/includes/libs/rdbms/database/Database.php(1198): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /srv/mediawiki/php-1.32.0-wmf.22/includes/libs/rdbms/database/Database.php(1655): Wikimedia\Rdbms\Database->query(string, string)
#3 /srv/mediawiki/php-1.32.0-wmf.22/extensions/PageTriage/includes/ArticleCompile/ArticleCompileUserData.php(61): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#4 /srv/mediawiki/php-1.32.0-wmf.22/extensions/PageTriage/includes/ArticleCompile/ArticleCompileProcessor.php(235): MediaWiki\Extension\PageTriage\ArticleCompile\ArticleCompileUserData->compile()
#5 /srv/mediawiki/php-1.32.0-wmf.22/extensions/PageTriage/includes/ArticleCompile/ArticleCompileProcessor.php(166): MediaWiki\Extension\PageTriage\ArticleCompile\ArticleCompileProcessor->process()
#6 /srv/mediawiki/php-1.32.0-wmf.22/extensions/PageTriage/includes/ArticleMetadata.php(211): MediaWiki\Extension\PageTriage\ArticleCompile\ArticleCompileProcessor->compileMetadata(integer)
#7 /srv/mediawiki/php-1.32.0-wmf.22/extensions/PageTriage/includes/Api/ApiPageTriageList.php(86): MediaWiki\Extension\PageTriage\ArticleMetadata->getMetadata()
#8 /srv/mediawiki/php-1.32.0-wmf.22/includes/api/ApiMain.php(1587): MediaWiki\Extension\PageTriage\Api\ApiPageTriageList->execute()
#9 /srv/mediawiki/php-1.32.0-wmf.22/includes/api/ApiMain.php(531): ApiMain->executeAction()
#10 /srv/mediawiki/php-1.32.0-wmf.22/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#11 /srv/mediawiki/php-1.32.0-wmf.22/api.php(87): ApiMain->execute()
#12 /srv/mediawiki/w/api.php(3): include(string)
#13 {main}

URL: https://test.wikipedia.org/w/api.php?action=pagetriagelist&format=json&namespace=118&afc_state=all&showunreviewed=1&showreviewed=1&dir=newestfirst&limit=20

Event Timeline

Catrope created this task.Sep 18 2018, 8:17 PM
Restricted Application added a project: Growth-Team. · View Herald TranscriptSep 18 2018, 8:17 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Probably related to T204669 , the actor table is behind a feature flag enabled for group0 by rOMWC07a6db7605741baa8ca81d793a39a1a69a7edd7d

Catrope claimed this task.Sep 18 2018, 8:23 PM

The code is generating this query in the wrong order for some reason. The actor-related joins need to go first, because backwards references are not allowed in join conditions.

Change 461208 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/PageTriage@master] ArticleCompileUserData: Fix order of actor table queries

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

The error no more show up, ActorTableSchemaMigrationStage deployed on 09/17 has been rolledback:

Change 461209 merged by jenkins-bot:
[operations/mediawiki-config@master] Set ActorTableSchemaMigrationStage => OLD on test wikis, mw.org
https://gerrit.wikimedia.org/r/461209

Change 461208 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] ArticleCompileUserData: Fix order of actor table queries

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

SBisson moved this task from Incoming to QA on the Growth-Team (Current Sprint) board.
Etonkovidova closed this task as Resolved.Sep 21 2018, 9:38 PM

Change 479995 had a related patch set uploaded (by Paladox; owner: Catrope):
[mediawiki/extensions/PageTriage@REL1_31] ArticleCompileUserData: Fix order of actor table queries

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

Change 479995 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@REL1_31] ArticleCompileUserData: Fix order of actor table queries

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