Expected proxy log output when running in docker-compose?


I am making my initial forays into AkkaServerless, based on the preview course at Lightbend academy
(Course | Akka-Serverless-for-JavaScript | Lightbend Academy)

I’ve been stuck trying to run the proxy locally on Ubuntu with docker-compose.

I have made some changes to the preview course docker-compose.yml file to use a newer version of the proxy image, and since I’m using linux, define “extra_hosts”. (My current yml file contents shown at the bottom).

But I now get these warnings: “Could not connect to user function not available for discovery”, as below. This persists even once I have started the service, so I imagine it is not because it is waiting for that to be available, rather something else is effecting the “discovery”.

What should I expect to see logged by the proxy to know that it is working as expected?


proxy log messages:

as-proxy_1  | {"timestamp":"2022-01-26T13:50:16.869Z","mdc":{"akkaAddress":"akka://akkaserverless-proxy@","akkaSource":"akka://akkaserverless-proxy/user/discovery-manager","sourceActorSystem":"akkaserverless-proxy"},"logger":"com.akkaserverless.proxy.DiscoveryManager","message":"**Connecting to host.docker.internal:8080 to discover the user function specification**","severity":"INFO","thread":"akkaserverless-proxy-akka.actor.default-dispatcher-8"}
as-proxy_1  | {"timestamp":"2022-01-26T13:50:17.058Z","mdc":{"akkaAddress":"akka://akkaserverless-proxy@","akkaSource":"akka://akkaserverless-proxy/user/discovery-manager","sourceActorSystem":"akkaserverless-proxy"},"logger":"com.akkaserverless.proxy.DiscoveryManager","message":"**Supervisor RestartSupervisor saw failure [1]: Could not connect to user function not available for discovery**","exception":"com.akkaserverless.proxy.DiscoveryManager$$anon$1: Could not connect to user function not available for discovery\n","severity":"WARN","thread":"akkaserverless-proxy-akka.actor.default-dispatcher-2"}

modified docker-compose.yml:

version: "3"
    # image: gcr.io/akkaserverless-public/akkaserverless-proxy:0.7.0-beta.9
    image: gcr.io/akkaserverless-public/akkaserverless-proxy:0.8.5
    command: -Dconfig.resource=dev-mode.conf -Dakkaserverless.proxy.protocol-compatibility-check=false
      - "9000:9000"
      - "host.docker.internal:host-gateway"
      USER_FUNCTION_HOST: ${USER_FUNCTION_HOST:-host.docker.internal}

After starting the service:

> hello-world@0.1.0 start /home/david/src/lightbend/AkkaServerlessForJavaScript/exercises/hello-world
> node index.js

gRPC server started on

Successful proxy startup should look something like this…

It seems like there is some network snafu happening. But I’m not a linux docker person so not sure. But the above should be close to what you see, upon successful start of the proxy.

1 Like

I wonder if it is that you bind the service to, at least if I look at our Java/Scala sample projects we do bind to, that could perhaps explain why the proxy docker container cannot access your user function.

With the JS/TS SDK it should be possible to do that by exporting HOST= before starting the user function.

1 Like

Ohh…that’s right! Great call @johanandren !

It has been a while since I’ve done something with JS/TS. If memory serves me well, that’s exactly it.

1 Like

Hello both, thank you very much.

After running with a HOST= npm run start I saw some new happy logs in the proxy, and my grpcurl command also produced an expected result.

I’ll proceed with my forays now, thank you!