Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
2.2.4, 2.2.5, 2.2.6
-
None
-
Amazon Linux
Java 8
Description
We are connecting to an AWS Aurora RDS datasource using a connection string that looks like this:
jdbc:mariadb:aurora://XXXXX.cluster-XXXXX.eu-west-1.rds.amazonaws.com:3306/XXXXX?socketTimeout=0&useSSL=true&connectTimeout=31000
When calling getConnection(), we see this error message. It looks like there is a NullPointerException occuring somewhere within the driver code:
java.lang.NullPointerException: null
|
at org.mariadb.jdbc.internal.failover.AbstractMastersListener.throwFailoverMessage(AbstractMastersListener.java:506)
|
at org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener.checkInitialConnection(MastersSlavesListener.java:300)
|
at org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener.initializeConnection(MastersSlavesListener.java:169)
|
at org.mariadb.jdbc.internal.failover.FailoverProxy.<init>(FailoverProxy.java:116)
|
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:485)
|
at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:155)
|
at org.mariadb.jdbc.MariaDbDataSource.getConnection(MariaDbDataSource.java:288)
|
We first saw this after upgrading to 2.2.5.
It turns out this wasn't related to the upgrade to 2.2.5, but 2.2.5 has a change that changed it from a meaningful exception to this NullPointerException.
If we downgrade to 2.2.4, we get a better stack trace.
java.sql.SQLException: Communications link failure with primary. No active connection found for master.
at org.mariadb.jdbc.internal.failover.AbstractMastersListener.throwFailoverMessage(AbstractMastersListener.java:487)
at org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener.checkInitialConnection(MastersSlavesListener.java:176)
at org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener.initializeConnection(MastersSlavesListener.java:162)
at org.mariadb.jdbc.internal.failover.FailoverProxy.<init>(FailoverProxy.java:101)
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:477)
at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:150)
at org.mariadb.jdbc.MariaDbDataSource.getConnection(MariaDbDataSource.java:288)
...
Despite the fact that the underlying issue is with our connection string and not a problem with the driver, I still think we wouldn't want an incorrect hostname in a connection string to lead to an NPE, so I'll leave this open, but lower the priority.