[CONJ-793] Receiving "No active connections found for master" while trying to connect Aurora read instance Created: 2020-05-29  Updated: 2020-05-29

Status: Open
Project: MariaDB Connector/J
Component/s: aurora
Affects Version/s: 2.6.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Hadi Tok Assignee: Diego Dupin
Resolution: Unresolved Votes: 0
Labels: None
Environment:

MacOs, AmazonLinux 2


Attachments: Java Source File ConnectionTestJava.java    

 Description   

Hi we were having trouble connecting to our read database with using the read cluster endpoint. The stacktrace is below. I have also attached the java code that I could reproduce the issue. I am suspecting that in the `AuroraListener` line 308 setUrlParserFromEndpoints method sets `hostAddresses` in the `AuroraListener` but at `AuroraProtocol` line 205 `listener.getUrlParser().getHostAddresses()` are checked not the `listener.getHostAddresses()` I will check if I can fix the issue and create a PR when I have time. A guidance on if this could be the issue or possible side effects of changing `listener.getUrlParser().getHostAddresses()` to `listener.getHostAddresses()` would be appreciated.

java.sql.SQLException: Communications link failure with primary. No active connection found for master. 
	at org.mariadb.jdbc.internal.failover.AbstractMastersListener.throwFailoverMessage(AbstractMastersListener.java:563)
	at org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener.checkInitialConnection(MastersSlavesListener.java:350)
	at org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener.initializeConnection(MastersSlavesListener.java:179)
	at org.mariadb.jdbc.internal.failover.FailoverProxy.<init>(FailoverProxy.java:120)
	at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:607)
	at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:150)
	at org.mariadb.jdbc.Driver.connect(Driver.java:89)
	at java.sql.DriverManager.getConnection(DriverManager.java:664)
	at java.sql.DriverManager.getConnection(DriverManager.java:208)
	at com.citizenme.shared.db.util.ConnectionTestJava.main(ConnectionTestJava.java:19)


Generated at Thu Feb 08 03:18:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.