Page MenuHomePhabricator

Running update.php on freshly installed MW 1.31.5 with PostgreSQL fails: Error: 42703 ERROR: column "adsrc" does not exist
Closed, ResolvedPublic

Description

PHP 7.3.10-1+b1 is installed.
Warning: Could not find APCu or WinCache. Object caching is not enabled.
Could not find GD library or ImageMagick. Image thumbnailing will be disabled.
Git version control software not found.
Warning: No --scriptpath specified, using default: /wiki.
Using server URL "/wiki".
Warning: Your default directory for uploads (/usr/share/mediawiki/images/) is not checked for vulnerability to arbitrary script execution during the CLI install.
Warning: The PHP intl extension is not available to handle Unicode normalization, falling back to slow pure-PHP implementation. If you run a high-traffic site, you should read on Unicode normalization.
The environment has been checked. You can install MediaWiki.
Setting up database
done
Checking for language PL/pgSQL
done
Creating schema
done
Creating tables
done
Populating default interwiki table
done
Committing changes
done
Initializing statistics
done
Generating secret keys
done
Prevent running unneeded updates
done
Creating administrator user account
done
Creating main page with default content
done
MediaWiki has been successfully installed. You can now visit </wiki> to view your wiki. If you have questions, check out our frequently asked questions list: <https://www.mediawiki.org/wiki/Manual:FAQ> or use one of the support forums linked on that page.
<strong>MediaWiki has been installed.</strong>
MediaWiki 1.31.5 Updater

Your composer.lock file is up to date with current dependencies!
Going to run database updates for autopkgtestwiki
Depending on the size of your database this may take a while!
...index mwuser_pkey already set on mwuser table.
...index mwuser_user_name_key already set on mwuser table.
...index pagecontent_pkey already set on pagecontent table.
...sequence ipblocks_ipb_id_seq already exists.
...sequence revision_rev_id_seq already exists.
...sequence text_old_id_seq already exists.
...sequence recentchanges_rc_id_seq already exists.
...sequence logging_log_id_seq already exists.
...sequence page_restrictions_pr_id_seq already exists.
...sequence uploadstash_us_id_seq already exists.
...sequence category_cat_id_seq already exists.
...category table already exists.
...page table already exists.
...querycachetwo table already exists.
...page_props table already exists.
...page_restrictions table already exists.
...profiling table already exists.
...protected_titles table already exists.
...redirect table already exists.
...updatelog table already exists.
...change_tag table already exists.
...tag_summary table already exists.
...valid_tag table already exists.
...user_properties table already exists.
...log_search table already exists.
...l10n_cache table already exists.
...iwlinks table already exists.
...module_deps table already exists.
...uploadstash table already exists.
...user_former_groups table already exists.
...sites table already exists.
...bot_passwords table already exists.
...obsolete table 'archive2' does not exist
[c56d9b156f8349c54e6e1d70] [no req]   Wikimedia\Rdbms\DBQueryError from line 1457 of /usr/share/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT
 attnotnull, attlen, conname AS conname,
 atthasdef,
 adsrc,
 COALESCE(condeferred, 'f') AS deferred,
 COALESCE(condeferrable, 'f') AS deferrable,
 CASE WHEN typname = 'int2' THEN 'smallint'
  WHEN typname = 'int4' THEN 'integer'
  WHEN typname = 'int8' THEN 'bigint'
  WHEN typname = 'bpchar' THEN 'char'
 ELSE typname END AS typname
FROM pg_class c
JOIN pg_namespace n ON (n.oid = c.relnamespace)
JOIN pg_attribute a ON (a.attrelid = c.oid)
JOIN pg_type t ON (t.oid = a.atttypid)
LEFT JOIN pg_constraint o ON (o.conrelid = c.oid AND a.attnum = ANY(o.conkey) AND o.contype = 'f')
LEFT JOIN pg_attrdef d on c.oid=d.adrelid and a.attnum=d.adnum
WHERE relkind = 'r'
AND nspname='mediawiki'
AND relname='updatelog'
AND attname='ul_value';
Function: Wikimedia\Rdbms\Database::query
Error: 42703 ERROR:  column "adsrc" does not exist
LINE 3:  adsrc,
         ^


Backtrace:
#0 /usr/share/mediawiki/includes/libs/rdbms/database/Database.php(1427): Wikimedia\Rdbms\Database->makeQueryException(string, string, string, string)
#1 /usr/share/mediawiki/includes/libs/rdbms/database/Database.php(1200): Wikimedia\Rdbms\Database->reportQueryError(string, string, string, string, boolean)
#2 /usr/share/mediawiki/includes/libs/rdbms/field/PostgresField.php(46): Wikimedia\Rdbms\Database->query(string)
#3 /usr/share/mediawiki/includes/libs/rdbms/database/DatabasePostgres.php(1244): Wikimedia\Rdbms\PostgresField::fromText(Wikimedia\Rdbms\DatabasePostgres, string, string)
#4 /usr/share/mediawiki/includes/installer/PostgresUpdater.php(839): Wikimedia\Rdbms\DatabasePostgres->fieldInfo(string, string)
#5 /usr/share/mediawiki/includes/installer/DatabaseUpdater.php(482): PostgresUpdater->addPgField(string, string, string)
#6 /usr/share/mediawiki/includes/installer/DatabaseUpdater.php(446): DatabaseUpdater->runUpdates(array, boolean)
#7 /usr/share/mediawiki/maintenance/update.php(203): DatabaseUpdater->doUpdates(array)
#8 /usr/share/mediawiki/maintenance/doMaintenance.php(94): UpdateMediaWiki->execute()
#9 /usr/share/mediawiki/maintenance/update.php(248): require_once(string)
#10 {main}

Platform: Debian unstable
PHP: 7.3.10-1+b1
PostgreSQL: 12.0-1

This was caught by the MediaWiki-Debian autopkgtests.

Related Objects

Event Timeline

Change 550358 had a related patch set uploaded (by Zoranzoki21; owner: Jjanes):
[mediawiki/core@REL1_31] rdbms: Remove references to pg_attrdef.adsrc in Postgres code

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

@Legoktm Cherry-pick patch should be merged... We usually do it?

Change 550358 merged by jenkins-bot:
[mediawiki/core@REL1_31] rdbms: Remove references to pg_attrdef.adsrc in Postgres code

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

Reedy claimed this task.

REL1_32 done too and as per https://bugs.launchpad.net/bugs/1852408 I've backported the SSL fix too (which may or may not actually be needed) but for completeness seems reasonable

Means they don't have to maintain their own patches too when the releases are done and tagged/released