Exception while connecting to mysql over private IP

81 views
Skip to first unread message

Narasimha Prasad

unread,
Jul 30, 2020, 10:22:43 AM7/30/20
to Google Cloud SQL discuss
Hi,

I am getting the following error while connecting  to the MySql instance. 

The connection to the database is over a private IP. 

The same setup is working on a normal co-located server. 

I am able to use the mysql client to connect to the database over the private IP. 

The application being deployed is a Spring based application. 


2020-07-30 09:31:03,369 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (JCA PoolFiller) IJ000610: Unable to fill pool: java:jboss/datasources/ACADEMY: javax.resource.ResourceException: IJ031084: Unable to create connection
        at org.jboss.ironjac...@1.4.22.Final//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:345)
        at org.jboss.ironjac...@1.4.22.Final//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:352)
        at org.jboss.ironjac...@1.4.22.Final//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:287)
        at org.jboss.iro...@1.4.22.Final//org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1322)
        at org.jboss.iro...@1.4.22.Final//org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.fillTo(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1142)
        at org.jboss.iro...@1.4.22.Final//org.jboss.jca.core.connectionmanager.pool.mcp.PoolFiller.run(PoolFiller.java:97)
        at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at com....@8.0.20//com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
        at com....@8.0.20//com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
        at com....@8.0.20//com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
        at com....@8.0.20//com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
        at com....@8.0.20//com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
        at com....@8.0.20//com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
        at org.jboss.ironjac...@1.4.22.Final//org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:321)
        ... 6 more
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

Manpreet Sidhu (Google Cloud Support)

unread,
Jul 30, 2020, 11:11:10 PM7/30/20
to Google Cloud SQL discuss
Based on what you are suggesting, you are having issues with your code and not Cloud SQL itself as that works. I highly suggest that you consider using the Cloud SQL proxy over a simple Private IP as it provides secure access to your instances without the need for Authorized networks or for configuring SSL.

This issue isn't best suited for Google Groups. Although this is a valid issue, I suggest that you post it in the Public Issue Tracker where you can provide a reproducible sample which can be further analyzed as this Stack trace does provide much information. This is viable if you believe that this is an issue with the product. Alternativy, you can post this on Stack Overflow where members of the community can help you with your Spring Application. Google Groups is best suited for Product discussions, releases, service announcements and such. More details on our Community Support can be found here.
Reply all
Reply to author
Forward
0 new messages