Page MenuHomePhabricator

Wikimedia\Rdbms\DBQueryError: Error 1066: Not unique table/alias: 'page'
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   Wikimedia\Rdbms\DBQueryError: Error 1066: Not unique table/alias: 'page' (db2127)
Function: SpecialWhatLinksHere::showIndirectLinks
Query: SELECT  page_id,page_namespace,page_title,rd_from,rd_fragment,page_is_redirect  FROM `re
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(1794)
#0 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(1778): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
#1 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(1753): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#2 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(1312): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#3 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/database/Database.php(1997): Wikimedia\Rdbms\Database->query(string, string, integer)
#4 /srv/mediawiki/php-1.37.0-wmf.18/includes/libs/rdbms/querybuilder/SelectQueryBuilder.php(620): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#5 /srv/mediawiki/php-1.37.0-wmf.18/includes/specials/SpecialWhatLinksHere.php(262): Wikimedia\Rdbms\SelectQueryBuilder->fetchResultSet()
#6 /srv/mediawiki/php-1.37.0-wmf.18/includes/specials/SpecialWhatLinksHere.php(146): SpecialWhatLinksHere->showIndirectLinks(integer, Title, integer, integer, string)
#7 /srv/mediawiki/php-1.37.0-wmf.18/includes/specialpage/SpecialPage.php(646): SpecialWhatLinksHere->execute(string)
#8 /srv/mediawiki/php-1.37.0-wmf.18/includes/specialpage/SpecialPageFactory.php(1365): SpecialPage->run(string)
#9 /srv/mediawiki/php-1.37.0-wmf.18/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#10 /srv/mediawiki/php-1.37.0-wmf.18/includes/MediaWiki.php(925): MediaWiki->performRequest()
#11 /srv/mediawiki/php-1.37.0-wmf.18/includes/MediaWiki.php(559): MediaWiki->main()
#12 /srv/mediawiki/php-1.37.0-wmf.18/index.php(53): MediaWiki->run()
#13 /srv/mediawiki/php-1.37.0-wmf.18/index.php(46): wfIndexMain()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}
Impact

3 errors in the last 30 min on group0

Notes

Event Timeline

jeena triaged this task as Unbreak Now! priority.Aug 10 2021, 9:15 PM

Full error:

Error 1066: Not unique table/alias: 'page' (db2127)
Function: SpecialWhatLinksHere::showIndirectLinks
Query: SELECT  page_id,page_namespace,page_title,rd_from,rd_fragment,page_is_redirect  FROM `redirect` JOIN `page` ON ((rd_from = page_id)) JOIN `page` ON ((rd_from = page_id))   WHERE rd_namespace = […] AND rd_title = '[…]'  ORDER BY rd_from ASC LIMIT 51

File touched by https://gerrit.wikimedia.org/r/c/mediawiki/core/+/675998 which landed this train. Presumably it's not happy about the secondary join on the same table, but it's not clear to me how this patch makes that happen?

Change 711373 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@master] Fix SelectQueryBuilder use in SpecialWhatLinksHere

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

I guess that might trip up a number of people (the tendency to use 'tables(...)' instead of relying on join() to add those other tables.

Change 711373 merged by jenkins-bot:

[mediawiki/core@master] Fix SelectQueryBuilder use in SpecialWhatLinksHere

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

Change 710719 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@wmf/1.37.0-wmf.18] Fix SelectQueryBuilder use in SpecialWhatLinksHere

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

Change 710719 merged by jenkins-bot:

[mediawiki/core@wmf/1.37.0-wmf.18] Fix SelectQueryBuilder use in SpecialWhatLinksHere

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

Mentioned in SAL (#wikimedia-operations) [2021-08-11T09:50:29Z] <lucaswerkmeister-wmde@deploy1002> Synchronized php-1.37.0-wmf.18/includes/specials/SpecialWhatLinksHere.php: Backport: [[gerrit:710719|Fix SelectQueryBuilder use in SpecialWhatLinksHere (T288565)]] (duration: 01m 08s)