man-group / dapr-sidekick-dotnet

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

Dapr Service not found. #31

Closed DexManx closed 2 years ago

DexManx commented 2 years ago

Service not found when using SideKick!

Added Sidekick

            services.AddDaprSidekick(Configuration, c =>
            {
                c.Sidecar = new Man.Dapr.Sidekick.DaprSidecarOptions
                {
                    AppId = "BoostQuestPipeline"
                };
            });

Ran application.

Actual Behavior

Service does not appear in Dapr Dashboard.

The following command fails to find service:

dapr invoke --app-id BoostQuestPipeline --method OnBoostJoined --data-file sample.json

Error message from command: error invoking app BoostQuestPipeline: app ID BoostQuestPipeline not found

Logs

Starting IIS Express ... Successfully registered URL "http://localhost:2417/" for site "LW.Gamification.BoostQuestPipeline" application "/" Registration completed for site "LW.Gamification.BoostQuestPipeline" IIS Express is running. [14:41:52 INF] Starting web host [14:41:53 INF] Dapr Process Status Change: Stopped -> Initializing [14:41:53 INF] Dapr expected process name set to daprd [14:41:53 INF] Dapr initial directory: C:\Users\David.dapr [14:41:53 INF] Dapr runtime directory: C:\Users\David.dapr [14:41:53 INF] Dapr process binary: C:\Users\David.dapr\bin\daprd.exe [14:41:53 INF] Dapr Process Status Change: Initializing -> Starting [14:41:53 INF] Environment variable DAPR_GRPC_PORT set to 50004 [14:41:53 INF] Environment variable DAPR_HTTP_PORT set to 3500 [14:41:53 INF] Starting Process C:\Users\David.dapr\bin\daprd.exe with arguments '--app-id BoostQuestPipeline --app-port 2417 --dapr-grpc-port 50004 --dapr-http-port 3500 --log-as-json --log-level debug --metrics-port 9090 --placement-host-address 127.0.0.1:6050 --config C:\Users\David.dapr\config.yaml --components-path C:\Users\David.dapr\components' [14:41:53 INF] Process daprd PID:45480 started successfully [14:41:54 INF] starting Dapr Runtime -- version 1.4.3 -- commit a8ee30180e1183e2a2e4d00c283448af6d73d0d0 [14:41:54 INF] log level set to: debug [14:41:54 INF] metrics server started on :9090/ [14:41:54 INF] standalone mode configured [14:41:54 INF] app id: BoostQuestPipeline [14:41:54 INF] mTLS is disabled. Skipping certificate request and tls validation [14:41:54 INF] local service entry announced: BoostQuestPipeline -> 192.168.1.12:1779 [14:41:54 INF] Initialized name resolution to mdns [14:41:55 INF] loading components [14:41:55 INF] component loaded. name: redis-pubsub, type: pubsub.redis/v1 [14:41:55 INF] waiting for all outstanding components to be processed [14:41:55 INF] component loaded. name: redis-statestore, type: state.redis/v1 [14:41:55 INF] all outstanding components processed [14:41:55 INF] enabled gRPC tracing middleware [14:41:55 INF] enabled gRPC metrics middleware [14:41:55 INF] API gRPC server is running on port 50004 [14:41:55 INF] enabled metrics http middleware [14:41:55 INF] enabled tracing http middleware [14:41:55 INF] http server is running on port 3500 [14:41:55 INF] The request body size parameter is: 4 [14:41:55 INF] enabled gRPC tracing middleware [14:41:55 INF] enabled gRPC metrics middleware [14:41:55 INF] internal gRPC server is running on port 1779 [14:41:55 INF] application protocol: http. waiting on port 2417. This will block until the app is listening on that port. [14:41:55 INF] application discovered on port 2417 [14:41:55 INF] application configuration loaded [14:41:55 INF] actor runtime started. actor idle timeout: 1h0m0s. actor scan interval: 30s [14:41:55 ERR] app returned http status code 400 from subscription endpoint [14:41:55 INF] dapr initialized. Status: Running. Init Elapsed 53.607299999999995ms [14:41:55 INF] Dapr Process Status Change: Starting -> Started [14:41:55 INF] Caching successful startup options for future restart attempts [14:41:55 INF] placement tables updated, version: 0

badgeratu commented 2 years ago

This is actually an issue with the way the Dapr Dashboard locates running Dapr instances - it looks for instances of the Dapr CLI (dapr.exe) not the actual sidecar (daprd.exe). As Sidekick launches and manages daprd.exe directly the instance does not show up in the dashboard.

This has been raised before in https://github.com/man-group/dapr-sidekick-dotnet/issues/20, please do though raise an issue on the official Dapr site if you would like them to change this behavior.