With reference to #1685 on git.
I’m facing the same error in my unmanaged service, I have multiple endpoints defined in descriptor, all are working fine except one. Here’s some related information:
def setLimit: ServiceCall[SetLimitRequest, BaseResponse]
def depositAmount: ServiceCall[SampleRequest, BaseResponse]
override final def descriptor = {
import Service._
// @formatter:off
named("service")
.withCalls(
restCall(Method.POST, "/api/v1/sample/sampleRequest", depositAmount),
restCall(Method.POST, "/api/v1/sample/sampleEvent/event", setLimit)
).withAutoAcl(true)
// @formatter:on
}
Models:
case class SetLimitRequest(token: String, userName: String, Id: String, details: String)
case class BaseResponse(status: String, code: String, message: String)
case class SampleRequest(token: String, userName: String, sample1: Double, sample2: String, sample3: String)
object SampleRequest {
implicit val format: Format[SampleRequest] = Json.format[SampleRequest]
}
object BaseResponse {
implicit val format: Format[BaseResponse] = Json.format[BaseResponse]
}
object SetLimitRequest {
implicit val format: Format[SetLimitRequest] = Json.format[SetLimitRequest]
}
Requests:
service.setLimit.invoke(setLimitRequest).map { setLimitResponse =>
println(s"set limit response: $setLimitResponse")
setLimitResponse
} // working fine
val sampleRequest = SampleRequest( "ad3ef9a5-ccf9-43d3-976a-3271345ad3c6", "bd082e7c-5905-4570-9aff-0d33e5396439", "da9beer6-7eca-4fb8-95a5-064b457b0800", 100000, 14.5, 120, "Sample Description" )
val res = service.sampleRequest.invoke(sampleRequest)
res.map { response =>
println(s"4. Response: $response")
response
}.recover {
case ex: TransportException =>
val x = getErrorResponse(ex.errorCode.http.toString, ex.errorCode.description)
println(s"6. Cause: ${x}, \n\n\n\nMessage ${ex.exceptionMessage.name} \n\n\n ====>${ex.exceptionMessage.detail}")
x
}
The request is working fine in Postman or CURL, and the response is:
{
"status": "SUCCESS",
"code": "200",
"message": "Sample Message."
}
so, ideally it should serialize like it is doing for other requests but with microservice it’s giving this:
com.lightbend.lagom.scaladsl.api.transport.TransportException:
–HTML-- (500/1011 Unexpected Condition/Internal Server Error)
at com.lightbend.lagom.scaladsl.api.transport.TransportException$.$anonfun$fromCodeAndMessage$2(Exceptions.scala:223)
at scala.Option.fold(Option.scala:175)
at com.lightbend.lagom.scaladsl.api.transport.TransportException$.fromCodeAndMessage(Exceptions.scala:223)
at com.lightbend.lagom.scaladsl.api.deser.DefaultExceptionSerializer.fromCodeAndMessage(ExceptionSerializer.scala:114)
at com.lightbend.lagom.scaladsl.api.deser.DefaultExceptionSerializer.deserialize(ExceptionSerializer.scala:100)
at com.lightbend.lagom.internal.scaladsl.client.ScaladslServiceApiBridge.exceptionSerializerDeserializeHttpException(ScaladslServiceApiBridge.scala:82)
at com.lightbend.lagom.internal.scaladsl.client.ScaladslServiceApiBridge.exceptionSerializerDeserializeHttpException$(ScaladslServiceApiBridge.scala:80)
at com.lightbend.lagom.internal.scaladsl.client.ScaladslClientServiceCallInvoker.exceptionSerializerDeserializeHttpException(ScaladslServiceClientInvoker.scala:110)
at com.lightbend.lagom.internal.scaladsl.client.ScaladslClientServiceCallInvoker.exceptionSerializerDeserializeHttpException(ScaladslServiceClientInvoker.scala:110)
at com.lightbend.lagom.internal.client.ClientServiceCallInvoker.$anonfun$makeStrictCall$3(ClientServiceCallInvoker.scala:222)
at scala.util.Success.$anonfun$map$1(Try.scala:255)
at scala.util.Success.map(Try.scala:213)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Any guidances?
_Originally posted by @yash-lf in https://github.com/render_node/MDEyOklzc3VlQ29tbWVudDQ0OTM0NzM2Mw==/timeline/issue_comment#issuecomment-449347363