私の Play アプリは、clearDB を使用した Heroku でしばらくの間正常に動作していました。その後、エラーでクラッシュしました
has exceeded the 'max_user_connections' resource
この投稿の指示に従いました
playframework 2.0 - データベースの進化で max_user_connections を超えましたか?
ただし、問題は解決されませんでした。この構成をProfileに追加しようとさえしました。
MySQL ワークベンチを介してデータベースに接続できるので、アプリケーションがダウンしても問題は解決しないようです。
再起動しようとしたときのログ出力は次のとおりです。
State changed from crashed to starting
Starting process with command `target/universal/stage/bin/listbucket -Dhttp.port=${PORT} -Ddb.default.driver=com.mysql.jdbc.Driver -Ddb.default.url=${CLEARDB_DATABASE_URL} -Ddb.default.partitionCount=1 -Ddb.default.maxConnectionsPerPartition=5 -Ddb.default.minConnectionsPerPartition=5`
Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCodebaseOnly=true
Play server process ID is 2
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 10. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 9. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 8. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 7. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 6. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 5. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 4. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 3. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 2. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 1. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:92)
at play.api.Configuration.reportError(Configuration.scala:570)
Configuration error: Configuration error[Cannot connect to database [default]]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:318)
Oops, cannot start the server.
at scala.collection.immutable.List.foreach(List.scala:318)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
at play.core.StaticApplication.<init>(ApplicationProvider.scala:52)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:243)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:274)
at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:279)
at play.core.server.NettyServer$.main(NettyServer.scala:274)
at play.core.server.NettyServer$.createServer(NettyServer.scala:243)
at play.core.server.NettyServer.main(NettyServer.scala)
at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.Option.map(Option.scala:145)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at play.api.db.BoneCPPlugin.onStart(DB.scala:243)
at play.api.Play$.start(Play.scala:87)
State changed from starting to crashed
Process exited with status 255
State changed from crashed to starting
Starting process with command `target/universal/stage/bin/listbucket -Dhttp.port=${PORT} -Ddb.default.driver=com.mysql.jdbc.Driver -Ddb.default.url=${CLEARDB_DATABASE_URL} -Ddb.default.partitionCount=1 -Ddb.default.maxConnectionsPerPartition=5 -Ddb.default.minConnectionsPerPartition=5`
Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCodebaseOnly=true
Play server process ID is 2
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and t
rying again. Attempts left: 10. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 9. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 8. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 7. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 6. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 5. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 4. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 3. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 2. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection to jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_f176dd782ce596b?reconnect=true Sleeping for 1000ms and trying again. Attempts left: 1. Exception: null.Message:User 'b6cf16f10a7a77' has exceeded the 'max_user_connections' resource (current value: 10)
Heroku は次から次へと大きな頭痛の種でした。これが Heroku での私にとって最後のストローであるため、どんな助けも大歓迎です。