Hello, I am trying to run the service on my local by following the steps from the documentation (Run a service locally :: Kalix Documentation) but getting an error after running the docker compose up.
One of the error logs is :
bank-operations-scala-kalix-proxy-1 | {"timestamp":"2022-08-21T14:15:16.761Z","mdc":{"akkaAddress":"akka://kalix-proxy@192.168.128.2:25520","akkaSource":"akka://kalix-proxy/user/discovery-manager","sourceActorSystem":"kalix-proxy"},"logger":"kalix.proxy.DiscoveryManager","message":"Supervisor RestartSupervisor saw failure [2]: Could not connect to user function not available for discovery at [host.docker.internal:8080]","exception":"kalix.proxy.DiscoveryManager$$anon$1: Could not connect to user function not available for discovery at [host.docker.internal:8080]\n","severity":"ERROR","thread":"kalix-proxy-akka.actor.default-dispatcher-10","version":"1.0.10"}
Also, I tried to run the sbt run in another terminal, but the service didn’t run successfully.
The Kalix proxy in the docker container will try to connect to your locally running service at host.docker.internal:8080, the error message you shared says it is not possible to reach any service running at that port, this could be because the service is not started yet (with sbt run for a Scala project) or possibly some problem with docker networking (check that you are on latest docker to start with).
Note that when running locally like this the proxy will try to reconnect with some interval if it didn’t see a service at first, each time it fails it will log an entry like this, even if it eventually suceeds.
I have the latest version of the docker(20.10.14), also after running the docker compose up command I ran the sbt run in a separate terminal and it ran the flow only once like first its bound the service, and then it unbinds it.
If your Kalix service exits immediately it could be related to a change in sbt 1.6 where it kills the service once main returns. Try setting fork := true in your build.sbt (this should be the default with our samples an g8 template already) .