mysql - 在 Google Appengine 上接收 SQLNonTransientConnectionException

标签 mysql google-app-engine google-cloud-platform google-cloud-sql

我多年来一直在 Google 平台上使用 MySQL(“Cloud SQL”)。第一代。仅限 SSL 连接。我的所有证书已经准备好几个月了并且运行得很好。我的证书没有过期。在过去的一天半里我一直无法连接到数据库!尝试重新启动数据库。由于周五开始的拒绝服务攻击,谷歌是否改变了他们的环境?

Exception in thread "main" java.sql.SQLNonTransientConnectionException: SSL Connection required, but not supported by server.
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:550)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:537)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:527)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:512)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:480)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:498)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:494)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:72)
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1634)
    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:637)
    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:351)
    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:224)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at ... my code

发生什么事了?

最佳答案

经过一番调查,我发现我的服务器端证书丢失了。我通过使用开发者控制台重新启动我的 CloudSQL 实例发现了这一点。然后我调查了日志。

2016-10-22 12:42:47 0 [Note] (mysqld 5.6.31-log) starting as process 554455 ...
2016-10-22 12:42:47 554455 [Note] Semi-sync replication initialized for transactions.
2016-10-22 12:42:47 554455 [Note] Semi-sync replication enabled on the master.
2016-10-22 12:42:47 554455 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-10-22 12:42:47 554455 [Note] InnoDB: The InnoDB memory heap is disabled
2016-10-22 12:42:47 554455 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-10-22 12:42:47 554455 [Note] InnoDB: Memory barrier is not used
2016-10-22 12:42:47 554455 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-10-22 12:42:47 554455 [Note] InnoDB: Using CPU crc32 instructions
2016-10-22 12:42:47 554455 [Note] InnoDB: Initializing buffer pool, size = 96.0M
2016-10-22 12:42:47 554455 [Note] InnoDB: Completed initialization of buffer pool
2016-10-22 12:42:47 554455 [Note] InnoDB: Highest supported file format is Barracuda.
2016-10-22 12:42:51 554455 [Note] InnoDB: 128 rollback segment(s) are active.
2016-10-22 12:42:51 554455 [Note] InnoDB: 5.6.31 started; log sequence number 10094548402
2016-10-22 12:42:52 554455 [Note] RSA private key file not found: /sfs/project/database/data//private_key.pem. Some authentication plugins will not work.
2016-10-22 12:42:52 554455 [Note] RSA public key file not found: /sfs/project/database/data//public_key.pem. Some authentication plugins will not work.
2016-10-22 12:42:52 554455 [Note] Add the 'cloudsqladmin' user with the password hash '*ACE49C8814A8031C812FD739A573BDD4FFF8F7EE'
2016-10-22 12:42:53 554455 [Note] Event Scheduler: Loaded 0 events
2016-10-22 12:42:53 554455 [Note] : ready for connections.
Version: '5.6.31-log' socket: '' port: 0 (43, 47) (Google)

我仍然希望了解这是如何发生的,我会尽可能更新。考虑到这件事发生在谷歌这边,我不确定我是否可以直接修复它。我看到开发控制台中有一个“重置 SSL 配置”选项。我希望我不必这样做,因为这意味着向生产代码和所有开发者推出新的证书。我的问题也在这里跟踪:https://code.google.com/p/googlecloudsql/issues/detail?id=188

关于mysql - 在 Google Appengine 上接收 SQLNonTransientConnectionException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40192360/

相关文章:

php - 为什么我的 PHP 为 MySQL 准备的语句不起作用?

mysql - 使 INSERT ... SELECT 语句成为原子的

mysql - Cx-卡住 : Showwarning AttributeError: 'NoneType' object has no attribute 'write'

google-app-engine - Google Cloud SQL 上的 "Cloud SQL connection error 2"是什么?

google-app-engine - AppEngine cpm_usd 变化

Golang 和 gcloud API : how to get an auth token

go - GCP => 监听 TCP :443: bind: permission denied

php - 数据库连接错误 : Can't connect to local MySQL server through socket

java - 如何执行网络抓取以在 Google App Engine 上查找 Java 中的特定链接页面?

google-cloud-platform - 无法导入图像数据集 gcloud automl,错误 : label is already ground truth