Page MenuHomePhabricator

Update from 1_14 to 1_15(RC1) / 1_16 fails with postgresql
Closed, ResolvedPublic

Description

Author: pvizeli

Description:
I have update my wiki from 1_14 to 1_15_0RC1, 1_15 r48811 and 1_16 current over svn.
But all updates dosn't work now with postgresql.

When I open the pages 'Special:RecentChanges' and 'NameOfWiki:Current_Events' it
produce (throw) a querry access error in DatabasePostgres.php line 850.

the error message from 1_14 to 1_15_0RC1:

A database error has occurred Query: SELECT * FROM recentchanges LEFT JOIN watchlist ON ((wl_user=3 AND wl_title=rc_title AND wl_namespace=rc_namespace)) LEFT JOIN page ON ((rc_cur_id=page_id)) LEFT JOIN tag_summary ON ((ts_rc_id=rc_id)) WHERE (rc_timestamp >= '2009-06-01 00:00:00 GMT') AND rc_bot = '0' ORDER BY rc_timestamp DESC LIMIT 50

Function: SpecialRecentChanges::doMainQuery Error: 1 FEHLER: keine Berechtigung fr Relation tag_summary

Backtrace:
#0 /var/www/wiki/includes/db/Database.php(616): DatabasePostgres->reportQueryError('FEHLER: keine ...', 1, 'SELECT * FROM...', 'SpecialRecentCh...', false)
#1 /var/www/wiki/includes/db/Database.php(1026): Database->query('SELECT * FROM...', 'SpecialRecentCh...')
#2 /var/www/wiki/includes/specials/SpecialRecentchanges.php(313): Database->select(Array, '*', Array, 'SpecialRecentCh...', Array, Array)
#3 /var/www/wiki/includes/specials/SpecialRecentchanges.php(100): SpecialRecentChanges->doMainQuery(Array, Object(FormOptions))
#4 /var/www/wiki/includes/SpecialPage.php(559): SpecialRecentChanges->execute(NULL)
#5 /var/www/wiki/includes/Wiki.php(229): SpecialPage::executePath(Object(Title))
#6 /var/www/wiki/includes/Wiki.php(59): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
#7 /var/www/wiki/index.php(116): MediaWiki->initialize(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))
#8 {main}.

If I have delete the database an reinstall the wiki on database, it works!
(include dumpBackup and importDump!)


Version: unspecified
Severity: major
OS: Linux
Platform: Other

Details

Reference
bz19127

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:38 PM
bzimport set Reference to bz19127.
bzimport added a subscriber: Unknown Object (MLST).

Did you upgrade with the web installer, or with maintenance/update.php?

Reproduced. This will occur when you set $wgDBadminuser='postgres' in AdminSettings.php and then run update.php. It will work just fine if you set $wgDBadminuser='wikiuser' (or whatever your unprivileged user is called), and that's what you should do in the future. To repair a broken database, you can do:

ALTER TABLE change_tag OWNER TO wikiuser;
ALTER TABLE tag_summary OWNER TO wikiuser;
ALTER TABLE valid_tag OWNER TO wikiuser;

If you're upgrading from an earlier version, there may be more tables to fix. You can find them with the "\d" command in psql.

I think I'll do a documentation fix for 1.15 and a more aggressive fix in trunk/1.16.

Documentation fixes in r51646 and r51651, and r51650 removes the requirement for AdminSettings.php to exist in order to run update.php.

pvizeli wrote:

I understand what you mean. I've two users. A unprivileged user call wikiuser and a privileged user call wikimain. In my LocalSettings I use wikiuser and in AdminSettings I use wikimain. The problem is (in first version 1_12) that the wikiuser dosn't work with dumpBackup.php and I use this script for secure Backup if the database backup dosn't work. So I created the wikimain user as superuser for AdminSettings.

But the main problem was, I think so, that was a test database. I've dump the Original database (wikidb) and restore it to wikidb2. But I set as owner the wikiuser in all cases! Anyway...

The answer for your question is: with maintenance/update.php.

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.