kubernetes-apim icon indicating copy to clipboard operation
kubernetes-apim copied to clipboard

Unable to connect to Data Source : Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Open yhilem opened this issue 7 years ago • 3 comments

Hi,

Without adding these &verifyServerCertificate=false&useSSL=false&requireSSL=false parameters to jdbc urls, example :

jdbc:mysql://apim-rdbms:3306/apimgtdb?autoReconnect=true&verifyServerCertificate=false&useSSL=false&requireSSL=false

the following exception is thrown:

[2017-08-14 06:29:31,065] ERROR - RegistryContext Unable to get instance of the registry context org.wso2.carbon.registry.core.exceptions.RegistryException: Unable to connect to Data Source at org.wso2.carbon.registry.core.config.RegistryConfigurationProcessor.populateRegistryConfig(RegistryConfigurationProcessor.java:165) [...] ... 60 more Caused by: java.net.SocketException: Broken pipe (Write failed) at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) at java.net.SocketOutputStream.write(SocketOutputStream.java:155) at sun.security.ssl.OutputRecord.writeBuffer(OutputRecord.java:431) at sun.security.ssl.OutputRecord.write(OutputRecord.java:417) at sun.security.ssl.SSLSocketImpl.writeRecordInternal(SSLSocketImpl.java:886) at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:857) at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:727) at sun.security.ssl.Handshaker.sendChangeCipherSpec(Handshaker.java:1124) at sun.security.ssl.ClientHandshaker.sendChangeCipherAndFinish(ClientHandshaker.java:1216) at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:1128) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:348) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026) at sun.security.ssl.Handshaker.process_record(Handshaker.java:961) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397) at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:163) ... 65 more

[2017-08-14 06:29:31,077] ERROR - RegistryCoreServiceComponent Failed to activate Registry Core bundle

.....................................................................................................

Best regards, Youcef HILEM

yhilem avatar Aug 14 '17 07:08 yhilem

We did not encounter this issue when using the mysql-connector-java-5.1.34-bin.jar connector. Probably this issue comes in latest mysql connectors. Thank you for reporting.

pubudu538 avatar Aug 15 '17 11:08 pubudu538

You are right. I used mysql-connector-java-5.1.43-bin.jar I just switched to mysql-connector-java-5.1.34.jar and the problem is gone.

yhilem avatar Aug 15 '17 13:08 yhilem

We may need to investigate this issue further and if it is not possible to resolve it from WSO2 side, at least mention the required MySQL JDBC driver version in the getting started guide. Thanks!

imesh avatar Nov 20 '17 11:11 imesh