gRPC errors (io.grpc.StatusRuntimeException) when using actions and components()...execute() but not when using effects().forward()

Hi all,

I can’t quite seem to get the value entity example from the samples working. Link here

I’m hitting the endpoints below. The following three endpoints all work:

  • POST com.example.actions.DoubleCounter/Increase
  • POST com.example.actions.DoubleCounter/IncreaseWithSideEffect

The following endpoints do not work:

  • POST com.example.actions.DoubleCounter/forwardWithGrpcApi
  • POST com.example.actions.DoubleCounter/sequentialComposition
  • POST com.example.actions.DoubleCounter/sumOfMy3FavouriteCounterValues

I think the only difference between them really is that the three that don’t work are using some form of components().api().method().execute() and are returning a CompletionStage like the following:

    CompletionStage<Empty> transformedResponse = components().counter().increase(increaseValueDoubled).execute()
        .thenApply(empty -> {
          // ridiculous but for now transforming by discarding and returning another empty will do
          return Empty.getDefaultInstance();
        });

Whereas the ones that work are simply doing:

return effects()
            .reply(Empty.getDefaultInstance()) // <2>
            .addSideEffect( // <3>
                SideEffect.of(components().counter().increase(increaseValueDoubled)));

I’ve added an exception.printStackTrace() to the functions and printed it out below. It seems to be trying to access something on localhost but can’t connect. Not sure what the problem could be as am unfamiliar with the internals.

at io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:529)
at io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:649
at io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:672
at io.grpc.netty.shaded.io.netty.channel.unix.Socket.finishConnect(Socket.java:251
at io.grpc.netty.shaded.io.netty.channel.unix.Errors.throwConnectException(Errors.java:124
Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refuse
Caused by: io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost/127.0.0.1:900
... 10 more
at io.grpc.Status.asRuntimeException(Status.java:535)
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception

// ...some more thread pool stuff here

I did have a little look around the forum but couldn’t find much that seemed like it would be related. here are some links 1, 2 and 3. No 1. makes me think I have done something wrong, but I can’t see why it would work using effects().forward() but then not work using components()...execute().

Hi, this was probably because of a bug in Akka Serverless that we found and fixed the last few days, your service should have automagically have been upgraded to the Akka Serverless Proxy 0.8.4 and it should now work (you can see the version in the discovery log entry if you want to verify it got upgraded).

Hi @johanandren.

Sorry for the late reply - I get limited time to have a play with stuff like this!

Just to confirm - it all seems to be working now!

Thanks!

Hi again @johanandren.

In one of my other services the proxy is still loading at 0.8.2. Is there anyway I can force that to upgrade so that I can use the components() stuff? (It is still erroring as I think it is version 0.8.4 that contains the fix?)

Picture below.

Thanks again.

It should have gotten a rolling upgrade of the proxy quite a while ago, please try a re-deploy of the service with the akkasls CLI and see if that gives you an upgraded proxy.

hi @johanandren

Sorry I’ve been so late in replying - the break and all.

Anyways, had some time to look into this again, and updated the service I am using several times, but it still seems to be using the 0.8.2 proxy:

I can DM you the project id if you’d like to take a look?

EDIT: To be clear this is not a big problem for me at the minute - I can just delete and create a new service and all that, but that’s only because I’m just testing things out for the time being. It might be a problem if this was a real world scenario, and instead of just starting over we had to do some data migration to move to a new service.

Cheers.

Please go ahead and DM me the project id so we can check why it wasn’t upgraded to the latest proxy version automatically, thanks!