man-group / dapr-sidekick-dotnet

Dapr Sidekick for .NET - a lightweight lifetime management component for Dapr
Apache License 2.0
177 stars 21 forks source link

Can't find service when hosted in IIS #63

Open sclarke81 opened 5 months ago

sclarke81 commented 5 months ago

Expected Behavior

I should be able to invoke a service through the sidecar e.g.

curl http://localhost:3500/v1.0/invoke/myservice/method/api/products

Actual Behavior

After a reboot I get the following response:

{"errorCode":"ERR_DIRECT_INVOKE","message":"failed to invoke, id: myservice, err: couldn't find service: myservice"}

If I kill daprd sidekick restarts it automatically and then the invoke works. Restarting the site, app pool or IIS server does not cause this issue; it only seems to be on reboot.

The dapr-sidecar healthcheck reports healthy.

These are the only warnings in the log. I've not been able to see anything that indicates what's going on.

{"@t":"2024-05-23T15:26:13.9176318+01:00","@l":"Warning","@m":"Error flushing tracing provider: request to http://zipkin:9411/api/v2/spans failed: Post \"http://zipkin:9411/api/v2/spans\": dial tcp: lookup zipkin: no such host","properties":{"SourceContext":"Man.Dapr.Sidekick.DaprSidecarHost","DaprVersion":"1.13.2","DaprAppId":"myservice","DaprInstance":"xxx","DaprScope":"dapr.runtime","DaprTime":"2024-05-23T15:26:13.9171368+01:00","DaprType":"log"}}

{"@t":"2024-05-23T15:26:54.8268335+01:00","@l":"Warning","@m":"mTLS is disabled. Skipping certificate request and tls validation","properties":{"SourceContext":"Man.Dapr.Sidekick.DaprSidecarHost","DaprVersion":"1.13.2","DaprAppId":"myservice","DaprInstance":"xxx","DaprScope":"dapr.runtime.security","DaprTime":"2024-05-23T15:26:54.810182+01:00","DaprType":"log"}}

{"@t":"2024-05-23T15:26:54.8269715+01:00","@l":"Warning","@m":"The default value for 'spec.metric.http.increasedCardinality' will change to 'false' in Dapr 1.14","properties":{"SourceContext":"Man.Dapr.Sidekick.DaprSidecarHost","DaprVersion":"1.13.2","DaprAppId":"myservice","DaprInstance":"xxx","DaprScope":"dapr.runtime","DaprTime":"2024-05-23T15:26:54.8218184+01:00","DaprType":"log"}}

Steps to Reproduce the Problem

I'm publishing the service to IIS where I have set the app pool to be always running and the site to have preload enabled. This means the service is started automatically and the sidecar is also started automatically as expected. I create a localhost binding on the site with a unique port number and use this as the AppPort.

Release Note

RELEASE NOTE: