Bizarre issues using Slick 3.2.3 + HikariCP + CloudSQL

68 views
Skip to first unread message

Charles Batty-Capps

unread,
Sep 20, 2018, 10:44:14 AM9/20/18
to Google Cloud SQL discuss
Hi,
We are getting some very strange issues. We use Scala in App Engine Standard (Java8) with a 2nd generation Cloud SQL (MySQL).

It's like some result sets are getting parsed on the wrong thread or something. 
Some examples include:
java.lang.ClassCastException: java.lang.Integer cannot be cast to <our domain model>
java.sql.SQLException: ResultSet is from UPDATE. No Data.

The really bizarre thing is that this only happens once in a blue moon; say once a day for ~20 requests somewhat nearby in time, out of thousands and thousands of requests. 

We are using the correct Java8 connection string, like this from the Cloud SQL App Engine Standard docs.
jdbc:mysql://google/${CLOUD_SQL_DATABASE}?cloudSqlInstance=${CLOUD_SQL_INSTANCE}&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC

How does this relate to GAE & Cloud SQL?
Being in GAE seems to be preventing us from troubleshooting for these reasons:
(1) I cannot tell which version of mysql-connector-j is being used. The dependency is swapped out at runtime in some way; from the stacktraces it's clear that the ordinary MySQL connector 5.1.42 is not being used, and the documentation has comments that say "only used locally" for this dependency. If we were able to control the version of mysql-connector-j, then we would use a known good version that is tested with Slick + HikariCP.
(2) This seems to have started happening when we switched to correctly using the com.google.cloud.sql.mysql.SocketFactory . Could there be a bug with this socket factory, or some weird incompatibility with HikariCP or Slick?

I really appreciate any hints to point me in the right direction, this is a pretty brutal problem as the stacktraces are very deep in the MySQL connector code (which is some custom Google version) so I am basically helpless at troubleshooting in any useful way since the stacktraces don't line up with the code.


Charles Batty-Capps

unread,
Sep 20, 2018, 12:37:50 PM9/20/18
to Google Cloud SQL discuss
Some other errors we're seeing (which again happen seemingly randomly a very small fraction of the time). I have no idea what's causing this sort of data corruption.
  • java.sql.SQLException: Unknown character set index for field '11824' received from server.
  • Could not map transaction isolation '<random string from a database column for an unrelated query> to a valid JDBC level.

Ying Li

unread,
Sep 22, 2018, 10:53:46 PM9/22/18
to Google Cloud SQL discuss
Please report the issue on our issue tracker [1] so we can keep track of it. Google Groups is generally reserved for discussions and not troubleshooting, thanks.

Reply all
Reply to author
Forward
0 new messages