play.api.UnexpectedException: Unexpected exception[RuntimeException: java.util.concurrent.TimeoutException]


#1

2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] [ERROR] from application -
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] ! @77nopihie - Internal server error, for (GET) [/api/getUserTeams] ->
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT]
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] play.api.UnexpectedException: Unexpected exception[RuntimeException: java.util.concurrent.TimeoutException]
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:289)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:220)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at play.api.GlobalSettings$class.onError(GlobalSettings.scala:160)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at play.api.DefaultGlobal$.onError(GlobalSettings.scala:188)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at play.api.http.GlobalSettingsHttpErrorHandler.onServerError(HttpErrorHandler.scala:100)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:100)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:99)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:344)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:343)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)
2018-05-04T11:38:11.878+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.impl.Promise$DefaultPromise.link(Promise.scala:304)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.impl.Promise$DefaultPromise.linkRootOf(Promise.scala:289)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:253)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:415)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] Caused by: java.lang.RuntimeException: java.util.concurrent.TimeoutException
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at com.couchbase.client.java.util.Blocking.blockForSingle(Blocking.java:73)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at com.couchbase.client.java.CouchbaseBucket.query(CouchbaseBucket.java:656)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at com.couchbase.client.java.CouchbaseBucket.query(CouchbaseBucket.java:578)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at com.telstra.secat.dao.impl.db.couchbase.CouchbaseDbDao.getUserTeams(CouchbaseDbDao.java:94)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at com.telstra.secat.controllers.ApiController.getUserTeams(ApiController.java:25)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$11$$anonfun$apply$11.apply(Routes.scala:1523)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.core.routing.HandlerInvokerFactory$$anon$4.resultCall(HandlerInvoker.scala:157)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.core.routing.HandlerInvokerFactory$$anon$4.resultCall(HandlerInvoker.scala:156)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.core.routing.HandlerInvokerFactory$JavaActionInvokerFactory$$anon$14$$anon$3$$anon$1.invocation(HandlerInvoker.scala:136)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:73)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.http.HttpRequestHandler$1.call(HttpRequestHandler.java:54)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.core.j.JavaAction$$anonfun$7.apply(JavaAction.scala:108)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:56)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.core.j.HttpExecutionContext.execute(HttpExecutionContext.scala:48)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.impl.Future$.apply(Future.scala:31)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.Future$.apply(Future.scala:492)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.core.j.JavaAction.apply(JavaAction.scala:108)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5$$anonfun$apply$6.apply(Action.scala:112)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:111)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:110)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.Option.map(Option.scala:146)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.api.mvc.Action$$anonfun$apply$2.apply(Action.scala:110)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at play.api.mvc.Action$$anonfun$apply$2.apply(Action.scala:103)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] … 14 common frames omitted
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] Caused by: java.util.concurrent.TimeoutException: null
2018-05-04T11:38:11.879+05:30 [APP/PROC/WEB/1] [OUT] … 45 common frames omitted

I am getting this error when i tried hittting the api /api/getUserTeams which basically fetches the list of teams. Some times api gives the response and some times it fails. I suspect it to be a Couchbase node server issue. But if any one can help me in figuring this out that will be really helpful

CouchbaseEnvironment env = DefaultCouchbaseEnvironment
.builder()
.connectTimeout(10000)
.sslEnabled(true)
.bootstrapHttpSslPort(18091)
.sslKeystoreFile(sslKeyPath)
.sslKeystorePassword(sslKeyPassword)
.build();

        cluster = CouchbaseCluster.create(env, hostname);

#2

The TimeoutException itself isn’t the cause, but rather the effect. You may want to check the logs for more information. For instance, was the connection disrupted? Was there other resource contention (which is logged in metrics). Also, if you want to, you can try out 2.6.0-beta which gives some further information about the state of the system at the time of a timeout.


#4

You are asking to use java-client version ?