Last modified: 2013-10-23 18:16:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36280, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34280 - Oracle installer throw SET CONSTRAINTS ALL DEFERRED PL/SQL error
Oracle installer throw SET CONSTRAINTS ALL DEFERRED PL/SQL error
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.18.x
Other Solaris
: Normal blocker (vote)
: 1.19.0 release
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-08 21:32 UTC by Joe
Modified: 2013-10-23 18:16 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Joe 2012-02-08 21:32:40 UTC
This error appears on install.

Setting up database... done
Creating database user... done
Creating tables...A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
SET CONSTRAINTS ALL DEFERRED
from within function "DatabaseOracle::doQuery". Database returned error ": ".
Backtrace:
#0 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/db/DatabaseOracle.php(337): DatabaseOracle->reportQueryError(NULL, NULL, 'SET CONSTRAINTS...', 'DatabaseOracle:...')
#1 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/db/DatabaseOracle.php(944): DatabaseOracle->doQuery('SET CONSTRAINTS...')
#2 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/DatabaseInstaller.php(158): DatabaseOracle->begin('DatabaseInstall...')
#3 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/OracleInstaller.php(245): DatabaseInstaller->createTables()
#4 [internal function]: OracleInstaller->createTables(Object(OracleInstaller))
#5 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/Installer.php(1331): call_user_func(Array, Object(OracleInstaller))
#6 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/WebInstallerPage.php(1127): Installer->performInstallation(Array, Array)
#7 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/WebInstaller.php(254): WebInstaller_Install->execute()
#8 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/mw-config/index.php(50): WebInstaller->execute(Array)
#9 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/mw-config/index.php(18): wfInstallerMain()
#10 {main}
Comment 1 Antoine "hashar" Musso (WMF) 2012-02-08 21:36:02 UTC
Adding Jure in CC since he is the Oracle guru
Comment 2 Sam Reed (reedy) 2012-02-08 22:13:31 UTC
Can you tell us what php version and what version of Oracle you are using?
Comment 3 Joe 2012-02-10 15:18:39 UTC
(In reply to comment #2)
> Can you tell us what php version and what version of Oracle you are using?

Sure I know the oracle version should be oracle 10g.  The OS is a Solaris.  Running a PHP 5.  OCI8 configured to work with PHP.  MB-String module installed.
Comment 4 Antoine "hashar" Musso (WMF) 2012-02-10 15:24:16 UTC
Looks like that command is the Oracle way of starting a transaction. From includes/db/DatabaseOracle.php :

    function begin( $fname = 'DatabaseOracle::begin' ) {
        $this->mTrxLevel = 1;
        $this->doQuery( 'SET CONSTRAINTS ALL DEFERRED' );
    }

Your credentials might lack the user right to set constraints, or the DB might lack that support.
Comment 5 Joe 2012-02-10 15:31:49 UTC
(In reply to comment #4)
> Looks like that command is the Oracle way of starting a transaction. From
> includes/db/DatabaseOracle.php :
> 
>     function begin( $fname = 'DatabaseOracle::begin' ) {
>         $this->mTrxLevel = 1;
>         $this->doQuery( 'SET CONSTRAINTS ALL DEFERRED' );
>     }
> 
> Your credentials might lack the user right to set constraints, or the DB might
> lack that support.

Well that depends do you mean that the DB user may lack credentials or the Solaris user account.  My user account with the DB has DBA and create session capabilities.
Comment 6 Antoine "hashar" Musso (WMF) 2012-02-10 16:33:25 UTC
For some reason oci_execute() fails and then oci_error() does not return any error. I have no idea how we could track this issue further down :-(
Comment 7 Joe 2012-02-10 16:59:51 UTC
Line 337 changed to $this->reportQueryError( $e, $e['message'], $e['code'], $sql, __METHOD__ ); to print out some error.  I currently am unsure what the error means but the error message that is now printed is:
Setting up database... done
Creating database user... done
Creating tables...bool(false) bool(false) A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
from within function "DatabaseInstaller::createTables". Database returned error "0: Query "CREATE SEQUENCE user_user_id_seq MINVALUE 0 START WITH 0 " failed with error code "". ".
Backtrace:
#0 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/DatabaseInstaller.php(162): DatabaseOracle->reportQueryError('Query "CREATE S...', 0, '', 'DatabaseInstall...')
#1 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/OracleInstaller.php(245): DatabaseInstaller->createTables()
#2 [internal function]: OracleInstaller->createTables(Object(OracleInstaller))
#3 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/Installer.php(1331): call_user_func(Array, Object(OracleInstaller))
#4 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/WebInstallerPage.php(1127): Installer->performInstallation(Array, Array)
#5 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/WebInstaller.php(254): WebInstaller_Install->execute()
#6 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/mw-config/index.php(50): WebInstaller->execute(Array)
#7 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/mw-config/index.php(18): wfInstallerMain()
#8 {main}
Comment 8 Joe 2012-02-10 17:14:15 UTC
(In reply to comment #7)
> Line 337 changed to $this->reportQueryError( $e, $e['message'], $e['code'],
> $sql, __METHOD__ ); to print out some error.  I currently am unsure what the
> error means but the error message that is now printed is:
> Setting up database... done
> Creating database user... done
> Creating tables...bool(false) bool(false) A database query syntax error has
> occurred. This may indicate a bug in the software. The last attempted database
> query was:
> from within function "DatabaseInstaller::createTables". Database returned error
> "0: Query "CREATE SEQUENCE user_user_id_seq MINVALUE 0 START WITH 0 " failed
> with error code "". ".
> Backtrace:
> #0
> /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/DatabaseInstaller.php(162):
> DatabaseOracle->reportQueryError('Query "CREATE S...', 0, '',
> 'DatabaseInstall...')
> #1
> /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/OracleInstaller.php(245):
> DatabaseInstaller->createTables()
> #2 [internal function]: OracleInstaller->createTables(Object(OracleInstaller))
> #3
> /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/Installer.php(1331):
> call_user_func(Array, Object(OracleInstaller))
> #4
> /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/WebInstallerPage.php(1127):
> Installer->performInstallation(Array, Array)
> #5
> /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/WebInstaller.php(254):
> WebInstaller_Install->execute()
> #6
> /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/mw-config/index.php(50):
> WebInstaller->execute(Array)
> #7
> /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/mw-config/index.php(18):
> wfInstallerMain()
> #8 {main}

May have created that error by adding a parameter.  I don't know.
Comment 9 Jure Kajzer 2012-02-13 11:05:37 UTC
Are you creating a new user in the install process or using an existing one? 

There *should* be no difference, i'm just trying to replicate the bug.
Comment 10 Joe 2012-02-13 15:18:11 UTC
No I am not creating a new user.  The user exist in the DB.
Comment 11 Joe 2012-02-13 15:24:00 UTC
The DB user also has DBA permissions and create session permissions.
Comment 12 Joe 2012-02-15 15:06:07 UTC
Tried to set up an new DB in Oracle 11g on a different server and I had the same issue.
Comment 13 Joe 2012-02-15 17:41:01 UTC
<?php

$db = '*****';
$connect = oci_connect('user', 'password', $db);
$query = oci_parse($connect, 'CREATE TABLE t (a NUMBER, b VARCHAR2(10))');
oci_execute($query);

?>

This test php page was created to ensure that I was able to connect to the DB and create a table.  It was a success.
Comment 14 Jure Kajzer 2012-02-16 08:30:23 UTC
OK, Found it ... the problem occurs if you try to use a predefined account and there seems to be a bug when the installer tries to switch from install user to web access user.

Until this is fixed you can use a simple workaround by entering the same credentials into "User account for installation" and "Database account for web access" ... leave "Create the account if it does not already exist" unchecked

Oh and another thing ... for Christ's, Santa Clause's, Easter Bunny's or for that matter any other fictional character's sake ... DO NOT USE A USER WITH DBA ROLE for a web access account.
If you want to manually create the user, open the user.sql file in maintenance/oracle folder and take a look at the required privileges. Using a DBA role for a webpage backend is bad almost beyond words. #youhavebeenwarned
Comment 15 Joe 2012-02-16 18:54:07 UTC
(In reply to comment #14)
> OK, Found it ... the problem occurs if you try to use a predefined account and
> there seems to be a bug when the installer tries to switch from install user to
> web access user.
> 
> Until this is fixed you can use a simple workaround by entering the same
> credentials into "User account for installation" and "Database account for web
> access" ... leave "Create the account if it does not already exist" unchecked
> 
> Oh and another thing ... for Christ's, Santa Clause's, Easter Bunny's or for
> that matter any other fictional character's sake ... DO NOT USE A USER WITH DBA
> ROLE for a web access account.
> If you want to manually create the user, open the user.sql file in
> maintenance/oracle folder and take a look at the required privileges. Using a
> DBA role for a webpage backend is bad almost beyond words. #youhavebeenwarned

Jure thanks for the help.  It did not work as planned though.  It still is throwing the same error.  Plus I don't know if this is a JS error but the checkbox doesn't appear the first time through I had to go backwards in the installation for that checkbox.  (I use Chrome)  I will continue to try it but no luck so far.
Comment 16 Joe 2012-02-16 18:54:31 UTC
Oh yeah and this MW installation is not for production it is a proof of concept.
Comment 17 Jure Kajzer 2012-02-17 06:18:37 UTC
Have you tried instead of backing up, dropping the user in the database and clicking "restart installation" in the installer.
Comment 18 Joe 2012-02-17 13:19:33 UTC
Are you suggesting that I create a new user in the database for the install?  The user currently exist but I can try that.
Comment 19 Jure Kajzer 2012-02-20 06:10:19 UTC
I am suggesting you try this:
* if the current user you try to install MW with was manually created, drop id from database
* run the installer and click on "restart installation"
* for the installing user enter a superuser credentials like SYSTEM or SYS
* uncheck "Use the same account as for installation"
* enter a new username and password (if you dropped a user in the first step then enter those credentials)
* check "Create the account if it does not already exist"

try that and tell me how it goes ...
Comment 20 Joe 2012-02-22 17:24:40 UTC
Installation Settings Selected:
Langauge
-English
-English
Connect to Database:
-Database Type: Oracle
-Database TNS: ******2 <-in TNSnames.ora
-Database Prefix: MW1
-Default tablespace: USERS
-Temporary Tablespace: TEMP
-Database username: ***$wiki
-Database password: ********
-Do not use same account for installation
-Database username: ***$wiki
-Database password: *******
Name:
-Name of Wiki: MyWiki
-Project namespace: same as the wiki name: $1 ; MyWiki <-in textbox
-Your Name: admin
-Password: *****
-Password again: *****
-E-mail address: j******@****.com
-I'm bored already, just install the wiki (Nothing on the next page needs to be changed)
Comment 21 Joe 2012-02-22 17:26:34 UTC
(In reply to comment #19)
> I am suggesting you try this:
> * if the current user you try to install MW with was manually created, drop id
> from database
> * run the installer and click on "restart installation"
> * for the installing user enter a superuser credentials like SYSTEM or SYS
> * uncheck "Use the same account as for installation"
> * enter a new username and password (if you dropped a user in the first step
> then enter those credentials)
> * check "Create the account if it does not already exist"
> 
> try that and tell me how it goes ...

Creation of new account does not work.  Fails on creation.  Error says database connection issue.
Comment 22 Joe 2012-02-22 18:30:16 UTC
I placed print statements in OracleInstaller.php to see what functions the install script was calling and I discovered that it appears to be failing on getSchemaVars() because it is returning a bool false array.  Below is how the install script reads after the print statements were included.

OracleInstaller.php preInstall()
Setting up database...OracleInstaller.php setupDatabase() done
Creating database user...OracleInstaller.php setupUser() done
Creating tables...OracleInstaller.php createTables()OracleInstaller.php openConnection()OracleInstaller.php getSchemaVars()OracleInstaller.php getSchemaVars() return: Arraybool(false) A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
SET CONSTRAINTS ALL DEFERRED
from within function "DatabaseOracle::doQuery". Database returned error ": ".
Backtrace:
#0 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/db/DatabaseOracle.php(338): DatabaseOracle->reportQueryError(NULL, NULL, 'SET CONSTRAINTS...', 'DatabaseOracle:...')
#1 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/db/DatabaseOracle.php(945): DatabaseOracle->doQuery('SET CONSTRAINTS...')
#2 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/DatabaseInstaller.php(158): DatabaseOracle->begin('DatabaseInstall...')
#3 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/OracleInstaller.php(256): DatabaseInstaller->createTables()
#4 [internal function]: OracleInstaller->createTables(Object(OracleInstaller))
#5 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/Installer.php(1331): call_user_func(Array, Object(OracleInstaller))
#6 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/WebInstallerPage.php(1127): Installer->performInstallation(Array, Array)
#7 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/includes/installer/WebInstaller.php(254): WebInstaller_Install->execute()
#8 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/mw-config/index.php(50): WebInstaller->execute(Array)
#9 /appsrvr/wwwdd/apache_2.2.16/ddweb/mediawiki/mediawiki-1.18.1/mw-config/index.php(18): wfInstallerMain()
#10 {main}
Comment 23 Joe 2012-02-22 21:38:50 UTC
Tried making user sysdba.  Nothing changed.
Comment 24 Joe 2012-02-24 14:27:19 UTC
Attempted in two browsers to ensure that it was not a browser issue.  I.E. and Google Chrome. -Yes at this point I am trying everything.-
Comment 25 Joe 2012-02-24 17:33:53 UTC
Created user through MW scripts.  The final step of the install script is not creating an objects (no tables) for this user.  Upon removing the lines of code for SET CONSTRAINTS a different error was thrown.  So the SET CONSTRAINTS were placed back in and now the focus is on figuring out why tables are not being created.
Comment 26 Joe 2012-02-24 19:36:50 UTC
Currently upgrading to PHP 5.3.10 to see if the old PHP version could be contributing to the issue in some way.
Comment 27 Joe 2012-02-27 17:50:24 UTC
PHP 5.3.10 Confirmed to work.  It requires that the user puts the same account information in both user to create MW install and user to use in MW install.  (Not sure why some type of bug)  Thanks to Jure who spent hours and hours helping me resolve this issue, Hashar for pointing me in the right direction, and Reedy for helping point out an obvious need for the ticket.
Comment 28 Jure Kajzer 2012-02-27 19:05:33 UTC
Still trying to figure out why it didn't work with a superuser.

The workaround (using same pre-created DB user both as install and web-access account) is no longer needed after:
r112502 for trunk (1.20)
r112504 for REL1_19 (1.19)
r112505 for REL1_18 (1.18)
Comment 29 rptrus 2012-05-07 00:18:23 UTC
Hello,

I have dowloaded the latest version 1.19 (May2) and am receiving this same error 

"Creating tables...A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: 
SET CONSTRAINTS ALL DEFERRED
"

I am using PHP5.2.17 which is the version needed for Apache. I am using a seperate DB schema (ie username/password) for DB installation and have written a script to confirm that I can connect correctly to oracle using php. 
Any ideas?
Comment 30 Joe 2012-05-08 12:05:00 UTC
rptrus,
I sent you an email but I would update your version of PHP if at all possible.  I would also try and update Apache if that is the reason for not updating PHP.  This is what worked for me.  Let me know if you can not update for some reason.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links