DB Timeout Exception

83 views
Skip to first unread message

a...@caravelo.com

unread,
Jul 9, 2021, 10:16:11 AM7/9/21
to Kill Bill users mailing-list
Hello all,

I'm trying to execute Kill Bill 0.22.23 +KAUI+MariaDB with docker-compose, for testing purposes.

I cannot get it working because of the inability of Kill Bill to get a database connection. The stacktrace in the logs is:

6544 [localhost-startStop-1] INFO  o.k.b.lifecycle.DefaultLifecycle - Killbill lifecycle calling handler init for service nodes-service 
16690 [localhost-startStop-1] WARN  o.k.b.lifecycle.DefaultLifecycle - Killbill lifecycle failed to invoke lifecycle handler 
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.killbill.billing.lifecycle.DefaultLifecycle.doFireStage(DefaultLifecycle.java:154)
at org.killbill.billing.lifecycle.DefaultLifecycle.fireSequence(DefaultLifecycle.java:141)
at org.killbill.billing.lifecycle.DefaultLifecycle.fireStartupSequencePriorEventRegistration(DefaultLifecycle.java:82)
at org.killbill.billing.server.listeners.KillbillPlatformGuiceListener.startLifecycle(KillbillPlatformGuiceListener.java:299)
at org.killbill.billing.server.listeners.KillbillPlatformGuiceListener.contextInitialized(KillbillPlatformGuiceListener.java:129)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4689)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5155)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1858)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.skife.jdbi.v2.exceptions.UnableToObtainConnectionException: java.sql.SQLTransientConnectionException: main - Connection is not available, request timed out after 10000ms.
at org.skife.jdbi.v2.DBI.open(DBI.java:251)
at org.skife.jdbi.v2.DBI.open(DBI.java:219)
at org.skife.jdbi.v2.DBI.withHandle(DBI.java:300)
at org.skife.jdbi.v2.DBI.inTransaction(DBI.java:328)
at org.killbill.billing.util.entity.dao.DBRouterUntyped.inTransaction(DBRouterUntyped.java:114)
at org.killbill.billing.util.nodes.dao.DefaultNodeInfoDao.create(DefaultNodeInfoDao.java:49)
at org.killbill.billing.util.nodes.DefaultKillbillNodesService.createBootNodeInfo(DefaultKillbillNodesService.java:121)
at org.killbill.billing.util.nodes.DefaultKillbillNodesService.init(DefaultKillbillNodesService.java:77)
... 22 common frames omitted
Caused by: java.sql.SQLTransientConnectionException: main - Connection is not available, request timed out after 10000ms.
at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:696)
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:197)
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:162)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:100)
at net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy.getConnection(DataSourceSpy.java:147)
at org.skife.jdbi.v2.DataSourceConnectionFactory.openConnection(DataSourceConnectionFactory.java:40)
at org.skife.jdbi.v2.DBI$4.execute(DBI.java:230)
at org.skife.jdbi.v2.DBI$4.execute(DBI.java:227)
at org.killbill.commons.profiling.Profiling.executeWithProfiling(Profiling.java:35)
at org.skife.jdbi.v2.DBI.open(DBI.java:227)
... 29 common frames omitted
Caused by: java.lang.NullPointerException: null
at org.mariadb.jdbc.MariaDbDataSource.getConnection(MariaDbDataSource.java:299)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
at com.zaxxer.hikari.pool.HikariPool.access$100(HikariPool.java:71)
at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:726)
at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:712)
... 4 common frames omitted

If I enter the container by executing a shell, I can connect to the DB, so it's not a networking problem (as expected as I'm using docker compose).

Any idea?

Thank you so much!
--
Alessio Gaeta

stephane brossier

unread,
Jul 9, 2021, 7:07:13 PM7/9/21
to a...@caravelo.com, Kill Bill users mailing-list
It seems like this is either a networking problem -- but you seem to have cleared that -- or a wrong jDBC URL for Kill Bill ? Have you checked what's in your killbill.properties file? Are you able to use the exact URL to connect to it from inside your container?


This message and the documents that may be attached to it are destined exclusively to its recipient(s) and can contain restricted or confidential information. Access to this information by people different from the recipients is not authorized. If your address does not match the recipient(s)'s, or you have received the message by error, we ask you to please communicate it to the sender immediately via email by Reply, and proceed to delete it. Do not use, distribute and/or copy the message or its attachments if you are not the intended recipient.

We further inform you that personal data contained in this document, including contact information, is protected by the European General Data Protection Regulation and other current legislation on the matter of data protection. Caravelo, ChangeYourFlight SL., will process it with the purpose of managing your relation to our business. Data will be kept for the duration necessary to carry out the purposes for which it was collected. In order to enforce your rectification, cancellation, objection or access rights, contact us at gd...@caravelo.com or through regular mail sent to Ronda de Sant Pere 19, 6-4, 08010 Barcelona, Spain.

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/0bab659c-bfb8-4e79-b3ac-2cdde754ceaan%40googlegroups.com.

a...@caravelo.com

unread,
Jul 16, 2021, 5:35:24 AM7/16/21
to Kill Bill users mailing-list
Hello Stéphane,

sorry for the late reply, and thanks for yours.

We eventually managed to solve the problem, although we still don't what was happening. Looking at the killbill.properties files, and at the logs, all values were fine. We ended up with by re-creating the DB, and things suddenly started working. Honestly, I'm not even sure that was the issue...

Indeed, the NullPointerException in the MariaDB connector (here: https://github.com/mariadb-corporation/mariadb-connector-j/blob/a5c414d35813c683fdbbb46e9d2ad6149315c88e/src/main/java/org/mariadb/jdbc/MariaDbDataSource.java#L299) was quite strange,  as all parameters were set.

BTW, not an issue anymore, and hopefully won't happen again. Thank you anyway!

--
Alessio Gaeta

Reply all
Reply to author
Forward
0 new messages