LoginSignup
3
5

More than 5 years have passed since last update.

GoogleAppEngineからCloudSQLにつながらなくなったのでメモ

Last updated at Posted at 2014-09-09

GAEからDBはCloudStrageサイトを作ってたんですが、
一部CloudSQLを使い始めました。

だがある日、deployも何もしていないのに突然以下のエラーが。

(2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 38")

現象

  • CloudSQLの接続がすべて失敗。
  • APIConsoleからsqlたたくぶんにはかえってくる(mysqlは起きてる)
  • CloudSQLをrestartしたが変化なし

原因

エラーの原因は多分これ
http://stackoverflow.com/questions/25139344/google-app-engine-and-cloud-sql-lost-connection-to-mysql-server-at-reading-ini

  • CloudSQLは接続を許可するGAEのアプリを設定している
  • Googleが何らかの理由でGAEアプリの場所を変更した結果、GAEアプリのIPアドレスがかわる
  • その連携がうまく行かず、CloudSQLが許可してたはずのGAEアプリをblock

というところなんでしょうか。

対策

これが正しいのか分かりませんが、

  • GoogleCloudConsoleでAuthorized App Engine Applicationsから一旦gaeのアプリをremove(どうせ繋がらないので)
  • 再度追加

これで接続ができるようになりました。

自分へのメモ

3
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5