VictorBLS
(Victor Vieira Barros Leal)
October 1, 2020, 3:01pm
1
I am running Lagom scala gRPC example (https://github.com/lagom/lagom-samples ) in a WSL-2 (Windows Subsystem Linux) and I am getting some errors on consuming the services.
the first curl example is fine:
but the second using the gRPC isn’t:
On Service:
Is the WSL the problem ? Any suggestions ?
Windows build version: 19041.508
ignasi35
(Ignasi Marimon-Clos)
October 1, 2020, 4:04pm
2
Hi @VictorBLS ,
I’m not familiar with WSL so I can’t tell if the problem is on that front. I would recommend you used this other samples instead: https://github.com/lagom/lagom-samples/tree/1.6.x/grpc-example/grpc-example-scala . The repository at https://github.com/lagom/lagom-scala-grpc-example was archived and that code was moved to a central repository with all the Lagom samples.
Also, because of changes in how the JVM handles protocol negotiation (which affects HTTP/2 and, therefore, gRPC), I would also recommend you use the latest JDK 8 (u252) or the latest JDK 11 (u8).
Cheers,
1 Like
VictorBLS
(Victor Vieira Barros Leal)
October 1, 2020, 4:36pm
3
Hi @ignasi35 , thanks for the reply.
Seems like I am already using the https://github.com/lagom/lagom-samples .
To enforce it I check the commit hash on the given repository.
The old link was wrong and I replace it.
Sory for the mistake
I am also using the JDK 8 (u261) and it seems to be the latest one
brabo-hi
(brabo-hi)
October 7, 2020, 6:26pm
4
Hi @VictorBLS @ignasi35
i am having the same issue when running on Ubuntu. However, the same code works on mac. Both have the same java version 1.8.0_261
How did you fix it ?
I am running the lagom grpc sample.
Request
curl http://localhost:9000/proxy/grpc-hello/Steve
Response
{"name":"io.grpc.StatusRuntimeException: UNAVAILABLE: io exception","detail":"io.grpc.StatusRuntimeException: UNAVAILABLE: io exception\n\tat io.grpc.Status.asRuntimeException(Status.java:533)\n\tat akka.grpc.internal.UnaryCallAdapter.onClose(UnaryCallAdapter.scala:40)\n\tat io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:413)\n\tat io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)\n\tat io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:742)\n\tat io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:721)\n\tat io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)\n\tat io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: ip-192-168-85-227/192.168.85.227:65499\nCaused by: java.net.ConnectException: finishConnect(..) failed: Connection refused\n\tat io.grpc.netty.shaded.io.netty.channel.unix.Errors.throwConnectException(Errors.java:124)\n\tat io.grpc.netty.shaded.io.netty.channel.unix.Socket.finishConnect(Socket.java:243)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:672)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:649)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:529)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:465)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)\n\tat io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)\n\tat io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.lang.Thread.run(Thread.java:748)\n"}
brabo-hi
(brabo-hi)
October 7, 2020, 6:27pm
5
As i said, the sample works on Mac
but not on ubuntu
VictorBLS
(Victor Vieira Barros Leal)
October 7, 2020, 9:39pm
6
I didn’t solve this yet. I’am using the http until I get any solution =/
brabo-hi
(brabo-hi)
October 7, 2020, 10:41pm
7
The http is giving me the same issue.
curl http://localhost:9000/proxy/grpc-hello/Steve
Is returning the error.
I am following this repo https://developer.lightbend.com/guides/lagom-scala-grpc-example/
What link did you use ?
VictorBLS
(Victor Vieira Barros Leal)
October 7, 2020, 11:34pm
8
The link that I share above.
This commnad:
curl http://localhost:9000/proxy/grpc-hello/Steve
uses the gRPC protocol, if you want to use the http , use
curl http://localhost:9000/proxy/rest-hello/Alice
brabo-hi
(brabo-hi)
October 8, 2020, 12:13am
9
Thanks answering back.
My point is I am using the same link curl http://localhost:9000/proxy/grpc-hello/Steve
and it is giving me this error on Ubuntu
{
"name": "io.grpc.StatusRuntimeException: UNAVAILABLE: io exception",
"detail": "io.grpc.StatusRuntimeException: UNAVAILABLE: io exception\n\tat io.grpc.Status.asRuntimeException(Status.java:533)\n\tat akka.grpc.internal.UnaryCallAdapter.onClose(UnaryCallAdapter.scala:40)\n\tat io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:413)\n\tat io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)\n\tat io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:742)\n\tat io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:721)\n\tat io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)\n\tat io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base/java.lang.Thread.run(Thread.java:834)\nCaused by: io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: ip-192-168-85-227/192.168.85.227:65499\nCaused by: java.net.ConnectException: finishConnect(..) failed: Connection refused\n\tat io.grpc.netty.shaded.io.netty.channel.unix.Errors.throwConnectException(Errors.java:124)\n\tat io.grpc.netty.shaded.io.netty.channel.unix.Socket.finishConnect(Socket.java:243)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:672)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:649)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:529)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:465)\n\tat io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)\n\tat io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)\n\tat io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.base/java.lang.Thread.run(Thread.java:834)\n"
}
Is it working for you ?
brabo-hi
(brabo-hi)
October 8, 2020, 1:22am
11
Did you try it on Linux or Mac ?
In my case, it is working on Mac, but not on Ubuntu
VictorBLS
(Victor Vieira Barros Leal)
October 8, 2020, 1:34am
13
I try in windows and wsl-2 with linux 18LTS, both got the same error on gRPC comunication
ignasi35
(Ignasi Marimon-Clos)
October 8, 2020, 10:53am
14
Thanks @VictorBLS and @brabo-hi !
I’ve raised https://github.com/lagom/lagom-samples/issues/191 to continue discussing there. I think what we need now is a detailed description of the environments where the execution fails and where the execution passes. Details could include:
commit SHA-1 in https://github.com/lagom/lagom-samples/
project run (is it grpc-example-java
or grpc-example-scala
or both?)
JDK version and vendor (Oracle, AdoptOpenJDK, Zulu, … 1.8_u262)
sbt
version
OS version
Other?
Thanks!
1 Like
brabo-hi
(brabo-hi)
October 8, 2020, 11:18am
15
@ignasi35 , thanks to @johanandren help, I found the issue
Since it’s in dev mod services are bound to localhost
[info] Service hello-impl listening for HTTP on 127.0.0.1:65499
[info] Service hello-impl listening for HTTPS on 127.0.0.1:11000
However when running the sample it is calling the service using its external IP 192.168.85.227:65499
. And as in my case I have a firewall, it rejected the connection.
As solution, I started the service by adding .settings(lagomServiceAddress := "0.0.0.0")
to make it available from the outside.
2 Likes
VictorBLS
(Victor Vieira Barros Leal)
October 8, 2020, 12:44pm
16
@brabo-hi did work for you ?
In run with disabled firewall and got the same error. I am also check ip that the service call and seems to be the localhost as we can see in the attached pictures it is calling the right ip in my case =/.
wwildsj
(weikdsj)
October 20, 2020, 11:41am
17
Good information thanks for sharing
vmware
brabo-hi
(brabo-hi)
October 20, 2020, 7:03pm
18
It is working for me, one solution I suggest you to try is to add to your service .settings(lagomServiceAddress := "0.0.0.0")
to make it available externally
1 Like