markheath / globoticket-dapr

A simple Dapr demo microservices application
59 stars 38 forks source link

fail to invoke, id: catalog, err: couldn't find service: catalog #4

Open thoefkens opened 1 year ago

thoefkens commented 1 year ago

Hi Mark,

I am running into an issue with dapr and the sample code. I start the self-hosted catalog, works fine, I can access the catalog Swagger file over the http port of the application, but I cannot invoke the service using dapr. I have already upgraded dapr and the CLI to the latest version.

➜ curl http://localhost:3501/v1.0/invoke/catalog/method/Event
{"errorCode":"ERR_DIRECT_INVOKE","message":"fail to invoke, id: catalog, err: couldn't find service: catalog"}%

The port of the service is 3501 - and dapr list returns this:

➜ dapr list
  APP ID   HTTP PORT  GRPC PORT  APP PORT  COMMAND     AGE  CREATED              DAPRD PID  CLI PID  APP PID  RUN TEMPLATE PATH  
  catalog  3501       49904      5016      dotnet run  43s  2023-04-03 14:10.12  30203      30195    30204

To me that looks fine.. but I have no clue why the dapr invocation is failing. Any ideas?

Thank you! Thomas

markheath commented 1 year ago

You might be running into this issue: https://github.com/dapr/dapr/issues/3256 Do you have a corporate VPN running or something that might be interfering with mDNS? I blogged about a way to work around this problem here: https://markheath.net/post/dapr-consul-name-resolution

thoefkens commented 1 year ago

I have many VPN connections but none of them were enabled when I tested this. @markheath Thank you for the consul tip. With that it works. Amazing how much time I have lost due to that issue... Thanks!