Page MenuHomePhabricator

Fatal error after 1.31.2 -> 1.33.0 - Unknown column 'pt_reason' in 'field list'
Closed, InvalidPublicBUG REPORT

Description

When upgrading from MediaWiki 1.31.2 to 1.33.0 I get this fatal bug:

[exception] [379e440be83554706287d90f] /wiki/Split:%D7%9E%D7%95%D7%A7%D7%A9%D7%99   Wikimedia\Rdbms\DBQueryError from line 1457 of /var/www/withoutvowels/web/w/includes/libs/rdb
ms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT  pt_user AS `user`,pt_expiry AS `expiry`,pt_create_perm AS `permission`,pt_reason AS `pt_reason_text`,NULL AS `pt_reason_data`,NULL AS `pt_reason_cid`  FROM `prote
cted_titles`    WHERE pt_namespace = '114' AND pt_title = '<D7><9E><D7><95><D7><A7><D7><A9><D7><99>'  
Function: Title::getTitleProtectionInternal
Error: 1054 Unknown column 'pt_reason' in 'field list' (localhost)

#0 /var/www/withoutvowels/web/w/includes/libs/rdbms/database/Database.php(1427): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
#1 /var/www/withoutvowels/web/w/includes/libs/rdbms/database/Database.php(1200): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /var/www/withoutvowels/web/w/includes/libs/rdbms/database/Database.php(1653): Wikimedia\Rdbms\Database->query(string, string)
#3 /var/www/withoutvowels/web/w/includes/Title.php(2843): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#4 /var/www/withoutvowels/web/w/includes/Title.php(3254): Title->getTitleProtectionInternal()
#5 /var/www/withoutvowels/web/w/includes/Title.php(3093): Title->loadRestrictions()
#6 /var/www/withoutvowels/web/w/includes/Title.php(2389): Title->getRestrictions(string)
#7 /var/www/withoutvowels/web/w/includes/Title.php(2737): Title->checkPageRestrictions(string, User, array, string, boolean)
#8 /var/www/withoutvowels/web/w/includes/Title.php(2114): Title->getUserPermissionsErrorsInternal(string, User, string, boolean)
#9 /var/www/withoutvowels/web/w/includes/Title.php(2096): Title->userCan(string, User, boolean)
#10 /var/www/withoutvowels/web/w/includes/page/Article.php(1250): Title->quickUserCan(string, User)
#11 /var/www/withoutvowels/web/w/includes/page/Article.php(530): Article->showMissingArticle()
#12 /var/www/withoutvowels/web/w/includes/actions/ViewAction.php(68): Article->view()
#13 /var/www/withoutvowels/web/w/includes/MediaWiki.php(500): ViewAction->show()
#14 /var/www/withoutvowels/web/w/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#15 /var/www/withoutvowels/web/w/includes/MediaWiki.php(861): MediaWiki->performRequest()
#16 /var/www/withoutvowels/web/w/includes/MediaWiki.php(524): MediaWiki->main()
#17 /var/www/withoutvowels/web/w/index.php(42): MediaWiki->run()
#18 {main}

maintenance/update.php does not help.

Event Timeline

Krinkle subscribed.

The getTitleProtectionInternal method uses CommentStore to create the pt_reason join. In the latest schema, protected_titles.pt_reason no longer exists. Instead, there is now protected_titles.pt_reason_id. This means a join for the legacy field should no longer be possible. Perhaps some bad combination of migration status and schema changes not applying as expected?

Anomie subscribed.

Thanks for reporting a bug.

#3 /var/www/withoutvowels/web/w/includes/Title.php(2843): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)

That trace looks like it comes from 1.31.2, not 1.33.0. In 1.33.0 the line number would have been 2338 instead. Other calls in the trace indicate the same.

Since this seems to be a misconfiguration on your end (running code from 1.31.2 with a database updated to 1.33.0), I'm going to close this as "Invalid".