【问题标题】:Receiving SQLNonTransientConnectionException on Google Appengine在 Google Appengine 上接收 SQLNonTransientConnectionException
【发布时间】:2017-03-04 16:37:24
【问题描述】:

多年来,我一直在 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

发生了什么事?

【问题讨论】:

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


    【解决方案1】:

    所以经过一番调查,我发现我的服务器端证书丢失了。我通过使用开发人员控制台重新启动我的 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

    【讨论】:

    • 我最终还是帮了自己。我确实使用了开发控制台中的“重置 SSL 配置”选项。也许这篇文章会在需要的时候帮助别人。我知道不是每个人都有白金支持。
    猜你喜欢
    • 1970-01-01
    • 2018-12-06
    • 2018-12-31
    • 1970-01-01
    • 2013-06-10
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多