0

I have a Java application running on GAE Flex but it's falling to connect on my private mysql instance with the error:

at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) at com.googlecode.flyway.core.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:50) ... 33 common frames omitted Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 2020-08-04 03:16:54 core-api[20200803t145941] The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

I've tried the following by Google recommendation:

https://cloud.google.com/appengine/docs/flexible/java/using-shared-vpc#setting_up_permissions

and also a lot of other ways without any luck:

Here are my app.yaml config:

service: core-api
runtime: java
env: flex
runtime_config:
  jdk: openjdk8
env_variables:
  DB_URL: jdbc:mysql://10.115.0.33:3306/database?useSSL=false&requireSSL=false&autoReconnect=true
  DB_USER: user
  DB_PASSWORD: password
network:
  instance_tag: java-app
  name: projects/java-app/global/networks/java-app-network
  subnetwork_name: java-app-subnet1
beta_settings:
  cloud_sql_instances: "java-app:southamerica-east1:java-app-mysql-database"
manual_scaling:
  instances: 3
resources:
  cpu: 4
  memory_gb: 8
  disk_size_gb: 100

I'm currently with no clue at all what may be causing suck headache and any help will be much appreciated, Thanks.

Harif Velarde
  • 733
  • 5
  • 10
  • could you share the complete error trace that you are getting? – Harif Velarde Aug 03 '20 at 21:43
  • sure, here it goes. – André Luis Aug 04 '20 at 03:16
  • at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) at com.googlecode.flyway.core.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:50) ... 33 common frames omitted Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 2020-08-04 03:16:54 core-api[20200803t145941] The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. – André Luis Aug 04 '20 at 03:21

1 Answers1

0

This kind of errors usually are related to that you are hitting the limit of concurrent connections described here. Maybe For some reason you might be not closing connections properly.

Harif Velarde
  • 733
  • 5
  • 10
  • I'm not supposed to be facing such an issue as I'm using age flex but I've checked just to be sure, Thanks. – André Luis Aug 04 '20 at 03:15
  • seems like this error is more related to jdbc than app engine, I found a similar question here and the answer is very detailed, https://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai Let me know if this helped to you – Harif Velarde Aug 04 '20 at 17:58