Bug 1019809

Summary: Unable to install rhq server with oracle db
Product: [JBoss] JBoss Operations Network Reporter: Filip Brychta <fbrychta>
Component: InstallerAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: urgent Docs Contact:
Priority: urgent    
Version: JON 3.2CC: dlackey, jshaughn, skondkar, spinder
Target Milestone: ER03Keywords: Documentation
Target Release: JON 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-02 20:36:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1012435    
Attachments:
Description Flags
rhq server properties none

Description Filip Brychta 2013-10-16 12:50:13 UTC
Description of problem:
Installation of rhq server with oracle db fails probably because of incorrect validation of rhq-server.properties (properties are correct but installer throws validation error).

Version-Release number of selected component (if applicable):
jon-server-3.2.0.ER3

How reproducible:
Always

Steps to Reproduce:
1. have a clean environment (rm -rf ~/.java/.userPrefs/rhq-*), oracle db is configured and running
2. unzip jon-server-3.2.0.ER3.zip
3. open jon-server-3.2.0.ER3/bin/rhq-server.properties
4. comment out properties related to PostgreSQL database
5. uncomment and set up properties related to Oracle database
6. ./rhqctl install (fill in required jboss.bind.address)

Actual results:
Installer throws following exception and then endlessly waits for server to initialize.

Exception:
08:00:57,901 ERROR [org.rhq.enterprise.server.installer.Installer] An error occurred: java.lang.Exception: Validation errors:
[rhq.server.database.port] must exist and be set to a number : []
[rhq.server.database.db-name] must exist and be set to a valid string value
[rhq.server.database.server-name] must exist and be set to a valid string value

	at org.rhq.enterprise.server.installer.ServerProperties.validate(ServerProperties.java:316) [rhq-installer-util-4.9.0.JON320ER3.jar:4.9.0.JON320ER3]
	at org.rhq.enterprise.server.installer.ServerProperties.validate(ServerProperties.java:258) [rhq-installer-util-4.9.0.JON320ER3.jar:4.9.0.JON320ER3]
	at org.rhq.enterprise.server.installer.InstallerServiceImpl.saveServerProperties(InstallerServiceImpl.java:671) [rhq-installer-util-4.9.0.JON320ER3.jar:4.9.0.JON320ER3]
	at org.rhq.enterprise.server.installer.InstallerServiceImpl.prepareDatabase(InstallerServiceImpl.java:479) [rhq-installer-util-4.9.0.JON320ER3.jar:4.9.0.JON320ER3]
	at org.rhq.enterprise.server.installer.InstallerServiceImpl.install(InstallerServiceImpl.java:306) [rhq-installer-util-4.9.0.JON320ER3.jar:4.9.0.JON320ER3]
	at org.rhq.enterprise.server.installer.Installer.doInstall(Installer.java:116) [rhq-installer-util-4.9.0.JON320ER3.jar:4.9.0.JON320ER3]
	at org.rhq.enterprise.server.installer.Installer.main(Installer.java:57) [rhq-installer-util-4.9.0.JON320ER3.jar:4.9.0.JON320ER3]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
	at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
	at org.jboss.modules.Module.run(Module.java:270) [jboss-modules.jar:1.2.2.Final-redhat-1]
	at org.jboss.modules.Main.main(Main.java:411) [jboss-modules.jar:1.2.2.Final-redhat-1]


Expected results:
Installation works

Additional info:
This issue could be divided into following parts:
1- Oracle database section in rhq-server.properties has some of the properties set by default to unused (e.g. rhq.server.database.port=unused) but validator throws exception during installation.
2- Upgrade: these properties are not set in previous versions of jon as well so the upgrade process fails because of the validation.
3- Validation fails event though the properties are correct.

Comment 1 Filip Brychta 2013-10-16 13:05:15 UTC
Created attachment 812912 [details]
rhq server properties

Comment 4 Jay Shaughnessy 2013-10-16 20:00:17 UTC
fix has two commits...

release/jon3.2.x commit 5ab88813d7fb342ae08fd78d22a905867a6610bd
Author: Jay Shaughnessy <jshaughn>
Date:   Wed Oct 16 12:18:42 2013 -0400

    Handle the unused oracle database properties.  Note that the properties
    still require values, but the preset "unused" values are now OK.  Updated
    the comments in rhq-server.properties to hopefully be more clear for
    Oracle.
    
    cherry-pick master e90767fc90dd7e2ca77e9097f5d193479007c06d


release/jon3.2.x commit 136fc88af020482453bbfd2da4b84ec6fc472789
Author: Jay Shaughnessy <jshaughn>
Date:   Wed Oct 16 15:57:46 2013 -0400

    Bug 1019809 - Unable to install rhq server with oracle db
    Second commit for this bug.
    Handle the fact that we were clearing the three relevant properties during
    server install on oracle, which then failed a late-stage validation.
    
    Cherry-pick master: dd24e958a5b72fd49520faef8714d9713014b656

Comment 6 Simeon Pinder 2013-10-17 06:56:04 UTC
Moving to ON_QA as available for test in ER3 respin brew build: https://brewweb.devel.redhat.com//buildinfo?buildID=300341

Comment 7 Filip Brychta 2013-10-17 08:34:16 UTC
Verified on
Version: 3.2.0.ER3
Build Number: c0742ed:90dd474

Installation works for both, the oracle and postgres