I'm using streamed service calls in Lagom. Once I upgraded to 1.4, error messages from the server are not being propagated to the client over websockets. This works in test using the lagomtestkit, but not when running a service using 'runAll' from SBT or in a live deployment.
Using 'runAll', all client calls that fail come back with "Peer closed connection with code 1011 'internal error'"
The issue here is fairly easy to diagnose. Lines 66-68 of akka-http 10.0.11 FrameOutHandler create the WebSocket closeFrame, throwing away the passed in exception and returning "internal error", even though they have the exception message.
My problem is that although I can see the error, I can't see any easy way to fix it without patching akka-http. Is this something that should be supported in Lagom? It used to work in 1.3 when we used the netty client.
Are you testing with another Lagom client connecting directly to the port that the service listens to, or using a web browser or some other client connecting through port 9000?
If it's the latter, you might also need to change the service gateway implementation back to Netty as described in the documentation on Default gateway implementation:
The Lagom development environment provides an implementation of a Service Gateway based on Akka HTTP and the (now legacy) implementation based on Netty.
You may opt in to use the old
netty
implementation.In the Maven root project pom:
<plugin> <groupId>com.lightbend.lagom</groupId> <artifactId>lagom-maven-plugin</artifactId> <version>${lagom.version}</version> <configuration> <serviceGatewayImpl>netty</serviceGatewayImpl> </configuration> </plugin>
In sbt:
// Implementation of the service gateway: "akka-http" (default) or "netty" lagomServiceGatewayImpl in ThisBuild := "netty"
In any case, please create an issue on GitHub and we can investigate a solution in the framework.