Install script filas to create correct DB when installing over SSL

Description

Most of this bug identification is not with out the help of jeffg.

The install script fails to create the specified DB when the URL is setup to use SSL for communication to the DB server. The tables are instead created under the default postgres user.

./install -disU -i --password <PASSWORD> --database-name opennms13prd --username opennms13prd --admin-password <PASSWORD> --database-url 'jdbc:postgresql://juniper:5432?sslfactory=org.postgresql.ssl.NonValidatingFactory&ssl=on' --admin-username postgres -l /opt/jicmp_1.0.6/lib

If you specific the target DB in the URL the install script can not connect

./install -disU -i --password <PASSWORD> --database-name opennms13prd --username opennms13prd --admin-password <PASSWORD> --database-url 'jdbc:postgresql://juniper:5432/opennms13prd?sslfactory=org.postgresql.ssl.NonValidatingFactory&ssl=on' --admin-username postgres -l /opt/jicmp_1.0.6/lib

  • checking database version... Exception in thread "main" org.postgresql.util.PSQLException: FATAL: database "opennms13prd" does not exist
    at org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:443)

A work around is to create the db manually on the DB server, then run the install script with the targetDB specified in the url

I do not think it is even possible to create the standard opennms tables over SSL with out the initial creation of the "opennms" database either. I have not tested this.

Environment

Operating System: All Platform: All

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Jason Czerak April 24, 2008 at 9:16 AM

I have verified this works as expected as of 8910, assuming you have all the correct settings in opennms-datasources.xml

It does appear to ignore any command line options. But I didn't put to much effort into messing with these since the .xml file worked perfectly.

Benjamin Reed April 23, 2008 at 10:50 PM

technically this needed to be reopened since it was already marked as verified

please verify and merge r8682,8675,8734,8735 to re-verify the bug

Benjamin Reed March 20, 2008 at 5:45 PM

FYI, I also made a cosmetic change that indicates the initial connecting to the c3p0 pool, in the 1.6 testing branch in r8734 and 1.6 release in r8735

David Hustace March 20, 2008 at 12:29 PM

revision 8724

David Hustace March 20, 2008 at 11:53 AM

Verified against PostgreSQL 8.2.4 having hostssl connections only in pg_hba.conf

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created January 22, 2008 at 10:02 AM
Updated January 27, 2017 at 4:26 PM
Resolved August 31, 2010 at 4:17 PM