Page MenuHomePhabricator

Oracle: installer fails to create the main page; external links cause database error
Closed, ResolvedPublic

Description

The installer can't create the main page on Oracle, as it includes external links, and the external links code calls DatabaseOracle->insert which uses DatabaseOracle->insertOneRow, but inserts into the external links table needs to use the external links sequence 'externallinks_el_id_seq', which is only handled correctly in DatabaseOracle->insertSelect.

Error:

Could not insert main page: A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script Query: INSERT INTO /*Q*/WD_EXTERNALLINKS (el_from,el_to,el_index) VALUES (:el_from, :el_to, :el_index) Function: DatabaseOracle::insertOneRow Error: 1400 ORA-01400: cannot insert NULL into ("<SCHEMA>"."WD_EXTERNALLINKS"."EL_ID")

The backtrace:

#0 /usr/share/mediawiki/includes/db/DatabaseOracle.php(611): DatabaseOracle->reportQueryError('ORA-01400: cann...', 1400, 'INSERT INTO /*Q...', 'DatabaseOracle:...')
#1 /usr/share/mediawiki/includes/db/DatabaseOracle.php(493): DatabaseOracle->insertOneRow('externallinks', Array, 'LinksUpdate::in...')
#2 /usr/share/mediawiki/includes/LinksUpdate.php(308): DatabaseOracle->insert('externallinks', Array, 'LinksUpdate::in...', 'IGNORE')
#3 /usr/share/mediawiki/includes/LinksUpdate.php(153): LinksUpdate->incrTableUpdate('externallinks', 'el', Array, Array)
#4 /usr/share/mediawiki/includes/LinksUpdate.php(126): LinksUpdate->doIncrementalUpdate()
#5 /usr/share/mediawiki/includes/DataUpdate.php(102): LinksUpdate->doUpdate()
#6 /usr/share/mediawiki/includes/WikiPage.php(2094): DataUpdate::runUpdates(Array)
#7 /usr/share/mediawiki/includes/WikiPage.php(1926): WikiPage->doEditUpdates(Object(Revision), Object(User), Array)
#8 /usr/share/mediawiki/includes/installer/Installer.php(1732): WikiPage->doEditContent(Object(WikitextContent), '', 1, false, Object(User))
#9 [internal function]: Installer->createMainpage(Object(OracleInstaller))
#10 /usr/share/mediawiki/includes/installer/Installer.php(1577): call_user_func(Array, Object(OracleInstaller))
#11 /usr/share/mediawiki/includes/installer/WebInstallerPage.php(1246): Installer->performInstallation(Array, Array)
#12 /usr/share/mediawiki/includes/installer/WebInstaller.php(275): WebInstaller_Install->execute()
#13 /var/www/html/oracle-wiki/mw-config/index.php(61): WebInstaller->execute(Array)
#14 /var/www/html/oracle-wiki/mw-config/index.php(29): wfInstallerMain()
#15 {main}


Version: 1.22.0
Severity: major
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=53710

Details

Reference
bz58435

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:19 AM
bzimport set Reference to bz58435.
bzimport added a subscriber: Unknown Object (MLST).

Change 105243 had a related patch set uploaded by Umherirrender:
Add sequence support for externallinks table

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

Just for reference: I have no oracle to test this, so I assume that this will help on oracle, but cannot confirm. Tested with mysql.

Change 105243 merged by jenkins-bot:
Add sequence support for externallinks table

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

successfully merged

Listed as known issue for 1.22, so marking for possible backport

(In reply to comment #5)

successfully merged

Listed as known issue for 1.22, so marking for possible backport

Yes, needs backport. Please cherry-pick.

(In reply to comment #6)

Yes, needs backport. Please cherry-pick.

I have no git branch installed/pulled, so I cannot cherry-pick myself.

(In reply to comment #3)

Just for reference: I have no oracle to test this, so I assume that this will
help on oracle, but cannot confirm. Tested with mysql.

I've verified it on an Oracle install.

Straight cherry-pick isn't possible since post-1.22 the directory structure changed. I'll do something, but I hope to get it reviewed ASAP.

Change 107111 had a related patch set uploaded by MarkAHershberger:
Add sequence support for externallinks table

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

Change 107111 merged by jenkins-bot:
Add sequence support for externallinks table

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

The change was reverted due to breakage on Wikimedia wikis.

As Reedy said on the change:
This shouldn't have been merged. Wikimedia hasn't finished schema migration for external links id addition (it takes a while)

Causes the following on a few wikis

Tue Jan 14 19:16:26 UTC 2014 mw1054 commonswiki LinksUpdate::incrTableUpdate 10.64.32.29 1054 Unknown column 'el_id' in 'field list' (10.64.32.29)

The bug tracking that schema change is bug 49189. Marking as a blocker for this bug (unless you implement this in a more robust fashion, not sure if it's worth it).

Btw, to see the status of all schema changes, see the tracking bug, bug 49188.

Why not revert on wmf-branch and schedule the addition in the next week, if possible?

When reverted, please set the release to 1.23, because it is now bundled with release 1.22.1 and needs to be in 1.23 to avoid breakage again. Thanks.

(In reply to comment #12)

The change was reverted due to breakage on Wikimedia wikis.

Schema change on Wikimedia wikis completed (bug 49189). Revert no longer needed. Back to FIXED