play.api.UnexpectedException

Unexpected exception[SQLTransientConnectionException: db - Connection is not available, request timed out after 2020ms.]

Samebug tips1

This might be cause due to an overload in your database accesses. Try to implement a queue or using an Executor to access the database server.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web282

  • via Google Groups by Nadav Samet, 6 months ago
    Unexpected exception[SQLTransientConnectionException: db - Connection is not available, request timed out after 2020ms.]
  • Unexpected exception[TimeoutException: Futures timed out after [1 second]]
  • Unexpected exception[MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=mongoplay:27017, type
  • Stack trace

    • play.api.UnexpectedException: Unexpected exception[SQLTransientConnectionException: db - Connection is not available, request timed out after 2020ms.] at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:261)[com.typesafe.play.play_2.11-2.4.6.jar:2.4.6] at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:191)[com.typesafe.play.play_2.11-2.4.6.jar:2.4.6] at modules.TrueAccordErrorHandler.onServerError(Modules.scala:65)[api.api-1.0-SNAPSHOT.jar:1.0-SNAPSHOT] at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$9$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:151)[com.typesafe.play.play-netty-server_2.11-2.4.6.jar:2.4.6] at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$9$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:148)[com.typesafe.play.play-netty-server_2.11-2.4.6.jar:2.4.6] at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:216)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.util.Try$.apply(Try.scala:192)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.util.Failure.recover(Try.scala:216)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:324)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:324)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.impl.CallbackRunnable.run_aroundBody0(Promise.scala:32)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.impl.CallbackRunnable$AjcClosure1.run(Promise.scala:1)[org.scala-lang.scala-library-2.11.7.jar:na] at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)[org.aspectj.aspectjrt-1.8.6.jar:na] at kamon.scala.instrumentation.FutureInstrumentation$$anonfun$aroundExecution$1.apply(FutureInstrumentation.scala:44)[io.kamon.kamon-scala_2.11-0.5.2.jar:0.5.2] at kamon.trace.Tracer$.withContext(TracerModule.scala:53)[io.kamon.kamon-core_2.11-0.5.2.jar:0.5.2] at kamon.scala.instrumentation.FutureInstrumentation.aroundExecution(FutureInstrumentation.scala:43)[io.kamon.kamon-scala_2.11-0.5.2.jar:0.5.2] at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:31)[org.scala-lang.scala-library-2.11.7.jar:na] at play.api.libs.iteratee.Execution$trampoline$.executeScheduled(Execution.scala:109)[com.typesafe.play.play-iteratees_2.11-2.4.6.jar:2.4.6] at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:71)[com.typesafe.play.play-iteratees_2.11-2.4.6.jar:2.4.6] at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.Promise$class.complete(Promise.scala:55)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.impl.Future$PromiseCompletingRunnable.run_aroundBody0(Future.scala:23)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.impl.Future$PromiseCompletingRunnable$AjcClosure1.run(Future.scala:1)[org.scala-lang.scala-library-2.11.7.jar:na] at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)[org.aspectj.aspectjrt-1.8.6.jar:na] at kamon.scala.instrumentation.FutureInstrumentation$$anonfun$aroundExecution$1.apply(FutureInstrumentation.scala:44)[io.kamon.kamon-scala_2.11-0.5.2.jar:0.5.2] at kamon.trace.Tracer$.withContext(TracerModule.scala:53)[io.kamon.kamon-core_2.11-0.5.2.jar:0.5.2] at kamon.scala.instrumentation.FutureInstrumentation.aroundExecution(FutureInstrumentation.scala:43)[io.kamon.kamon-scala_2.11-0.5.2.jar:0.5.2] at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:23)[org.scala-lang.scala-library-2.11.7.jar:na] at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39)[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na] at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:399)[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)[org.scala-lang.scala-library-2.11.7.jar:na] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)[org.scala-lang.scala-library-2.11.7.jar:na] Caused by: java.sql.SQLTransientConnectionException: db - Connection is not available, request timed out after 2020ms. at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:196)[com.zaxxer.HikariCP-2.4.5.jar:na] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:147)[com.zaxxer.HikariCP-2.4.5.jar:na] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:83)[com.zaxxer.HikariCP-2.4.5.jar:na] at slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:12)[com.typesafe.slick.slick-hikaricp_2.11-3.1.1.jar:na] at slick.jdbc.JdbcBackend$BaseSession.conn$lzycompute(JdbcBackend.scala:415)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.jdbc.JdbcBackend$BaseSession.conn(JdbcBackend.scala:414)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.jdbc.JdbcBackend$SessionDef$class.prepareStatement(JdbcBackend.scala:297)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.jdbc.JdbcBackend$BaseSession.prepareStatement(JdbcBackend.scala:407)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.jdbc.StatementInvoker.results(StatementInvoker.scala:33)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.jdbc.StatementInvoker.iteratorTo(StatementInvoker.scala:22)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.jdbc.Invoker$class.foreach(Invoker.scala:48)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.jdbc.StatementInvoker.foreach(StatementInvoker.scala:16)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.jdbc.StreamingInvokerAction$class.run(StreamingInvokerAction.scala:22)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.driver.JdbcActionComponent$QueryActionExtensionMethodsImpl$$anon$1.run(JdbcActionComponent.scala:218)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.driver.JdbcActionComponent$QueryActionExtensionMethodsImpl$$anon$1.run(JdbcActionComponent.scala:218)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.backend.DatabaseComponent$DatabaseDef$$anon$2.liftedTree1$1(DatabaseComponent.scala:237)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at slick.backend.DatabaseComponent$DatabaseDef$$anon$2.run(DatabaseComponent.scala:237)[com.typesafe.slick.slick_2.11-3.1.1.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_66-internal] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_66-internal] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_66-internal]

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    3 times, 1 year ago
    Once, 4 months ago
    3 times, 6 months ago
    Unknown user
    Once, 1 day ago
    Unknown user
    Once, 1 day ago
    31 more bugmates