Not able to start rundeck with postgres. Exception - Facing unable to create initial connections of Pool

2,172 views
Skip to first unread message

Vivek Rodge

unread,
Jun 4, 2019, 11:11:39 AM6/4/19
to rundeck-discuss
2019-06-04 15:18:58.702 ERROR --- [           main] o.a.tomcat.jdbc.pool.ConnectionPool      : Unable to create initial connections of pool.

java.sql.SQLException: Driver:org.h2.Driver@14faa38c returned null for URL:jdbc:postgresql://localhost/postgres?autoReconnect=true
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:338)
        at org.apa

Reiner Acuña

unread,
Jun 4, 2019, 11:59:05 AM6/4/19
to rundeck-discuss
Hi Vivek,

Can you provide more information about your instance? Rundeck version, java version, install method (WAR or RPM/DEB).

Regards!!

Reiner Acuña

unread,
Jun 6, 2019, 12:29:54 PM6/6/19
to rundeck-discuss
Hi Vivek,

Check your DB configuration in rundeck-config.properties file and make sure that is well configured:

dataSource.driverClassName = org.postgresql.Driver
dataSource
.url = jdbc:postgresql://your-db-host:5432/rundeck
dataSource
.username=rundeckuser
dataSource
.password=password

More informaton here:


Hope it helps!

On Tuesday, June 4, 2019 at 11:11:39 AM UTC-4, Vivek Rodge wrote:

Vivek Rodge

unread,
Jun 8, 2019, 7:30:37 AM6/8/19
to rundeck...@googlegroups.com
Hi,

My rundeck version is 3.0.22 . Java installed is 1.8 . I tried giving localhost:5432 as well. But the exception is same. I have rpm rundeck installation. When I use command sudo service rundeckd start. In service.log I see below exception. Even I have followed the guide to change datasource to postgres and changed rubdeck-config.propertiea to have postgres driver and db url, exception shows that it is taking h2 db driver instead of postgres. On further investigation, it is found that when I do start service rundeckd, it loads boostrap application having rundeck.war present at \var\lib\rundeck\bootstrap. When I changed Datasource.groovy and application.groovy to point datasource to have postgres driver which was pointing to h2 db driver, the exception gone and able to see rundeck server is started without any errors. I don't want to change rundeck.war to change db from h2 to postgres. How to achieve this without changing rundeck.war. I already modfied rundeck-config.properties. But it is not picking postgres driver from rundeck-config.properties. Am I missing any configuration to change so that postgres db driver gets loaded instead of h2 driver during rundeck server startup.

Thanks in advance 

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To post to this group, send email to rundeck...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/7c599589-b426-4869-b2e2-a2dee5e10944%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reiner Acuña

unread,
Jun 8, 2019, 9:36:52 AM6/8/19
to rundeck...@googlegroups.com
Hi Vivek,

Can you post your rundeck-config.properties file (hidding sensible information) to take a look?

Thanks!


From: rundeck...@googlegroups.com <rundeck...@googlegroups.com> on behalf of Vivek Rodge <vivek...@gmail.com>
Sent: Saturday, June 8, 2019 7:30:20 AM
To: rundeck...@googlegroups.com
Subject: Re: [rundeck] Re: Not able to start rundeck with postgres. Exception - Facing unable to create initial connections of Pool
 

Vivek Rodge

unread,
Jun 13, 2019, 11:07:23 AM6/13/19
to rundeck...@googlegroups.com
Here is my rundeck-config.properties configured for postgres.

#loglevel.default is the default log level for jobs: ERROR,WARN,INFO,VERBOSE,DEBUG
loglevel.default=INFO
rdeck.base=/var/lib/rundeck

#rss.enabled if set to true enables RSS feeds that are public (non-authenticated)
rss.enabled=false
# change hostname here
grails.serverURL=http://10.76.56.96:4440
datasource.driverClassName=org.postgresql.Driver
dataSource.url = jdbc:postgresql://localhost/rundeck
datasource.username=rundeckuser
datasource.password=rundeckpassword
#dataSource.initialSize=10
#rundeck.v14.rdbsupport=true
rundeck.log4j.config.file = /etc/rundeck/log4j.properties

#Enables DB for Project configuration storage
rundeck.projectStorageType=db

#Enable DB for Key Storage
rundeck.storage.provider.1.type=db
rundeck.storage.provider.1.path=keys

Reiner Acuña

unread,
Jun 13, 2019, 11:31:31 AM6/13/19
to rundeck-discuss
Hi Vivek,

Ok test with this line in your rundeck-config.properties file and restart Rundeck service (note that I include the database port number):

dataSource.url = jdbc:postgresql://address-of-your-database:5432/rundeck

Instead:

dataSource.url = jdbc:postgresql://localhost/rundeck

Also check in PostgreSQL box the /var/lib/pgsql/data/pg_hba.conf file, i have this config that works:

local      all     all     trust
host       all     all    
0.0.0.0/0 trust # or your trust network

And /var/lib/pgsql/data/postgresql.conf file, and make sure that the database is listening with these lines (uncomment if have these lines commented)

listen_addresses = '*'
port
=5432 # or custom tcp port if you want

If you made these changes, remember to restart PostgreSQL service.

Hope it helps!

Sent: Saturday, June 8, 2019 7:30:20 AM

Subject: Re: [rundeck] Re: Not able to start rundeck with postgres. Exception - Facing unable to create initial connections of Pool
Hi,

My rundeck version is 3.0.22 . Java installed is 1.8 . I tried giving localhost:5432 as well. But the exception is same. I have rpm rundeck installation. When I use command sudo service rundeckd start. In service.log I see below exception. Even I have followed the guide to change datasource to postgres and changed rubdeck-config.propertiea to have postgres driver and db url, exception shows that it is taking h2 db driver instead of postgres. On further investigation, it is found that when I do start service rundeckd, it loads boostrap application having rundeck.war present at \var\lib\rundeck\bootstrap. When I changed Datasource.groovy and application.groovy to point datasource to have postgres driver which was pointing to h2 db driver, the exception gone and able to see rundeck server is started without any errors. I don't want to change rundeck.war to change db from h2 to postgres. How to achieve this without changing rundeck.war. I already modfied rundeck-config.properties. But it is not picking postgres driver from rundeck-config.properties. Am I missing any configuration to change so that postgres db driver gets loaded instead of h2 driver during rundeck server startup.

Thanks in advance 

On Thu, Jun 6, 2019, 9:59 PM Reiner Acuña <rac...@rundeck.com> wrote:
Hi Vivek,

Check your DB configuration in rundeck-config.properties file and make sure that is well configured:

dataSource.driverClassName = org.postgresql.Driver
dataSource
.url = jdbc:postgresql://your-db-host:5432/rundeck
dataSource
.username=rundeckuser
dataSource
.password=password

More informaton here:


Hope it helps!

On Tuesday, June 4, 2019 at 11:11:39 AM UTC-4, Vivek Rodge wrote:
2019-06-04 15:18:58.702 ERROR --- [           main] o.a.tomcat.jdbc.pool.ConnectionPool      : Unable to create initial connections of pool.

java.sql.SQLException: Driver:org.h2.Driver@14faa38c returned null for URL:jdbc:postgresql://localhost/postgres?autoReconnect=true
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:338)
        at org.apa

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to rundeck-discuss@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to rundeck-discuss@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to rundeck-discuss@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages