question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dapr.DaprApiException: the state store is not configured to use the actor runtime

See original GitHub issue

Ask your question here

While Running with dapr Actor in c#, below error is occurring

Dapr.DaprApiException: the state store is not configured to use the actor runtime. Have you set the - name: actorStateStore value: “true” in your state store component file? at Dapr.Actors.DaprHttpInteractor.SendAsyncHandleUnsuccessfulResponse(Func1 requestFunc, String relativeUri, CancellationToken cancellationToken) at Dapr.Actors.DaprHttpInteractor.SendAsync(Func1 requestFunc, String relativeUri, CancellationToken cancellationToken) at Dapr.Actors.DaprHttpInteractor.InvokeActorMethodWithRemotingAsync(ActorMessageSerializersManager serializersManager, IActorRequestMessage remotingRequestRequestMessage, CancellationToken cancellationToken) at Dapr.Actors.Communication.Client.ActorRemotingClient.InvokeAsync(IActorRequestMessage remotingRequestMessage, CancellationToken cancellationToken) at Dapr.Actors.Client.ActorProxy.InvokeMethodAsync(Int32 interfaceId, Int32 methodId, String methodName, IActorRequestMessageBody requestMsgBodyValue, CancellationToken cancellationToken) at DaprActorPOC.Controllers.WeatherForecastController.GetAsync() in C:\Users\namohar.m\source\repos\Ex-1\DaprActorPOC\DaprActorPOC\Controllers\WeatherForecastController.cs:line 60 at lambda_method5(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jsmith-kno2commented, Jan 11, 2023

I ran into this same issue. You’ll need to configure your docker-compose.yaml to include the following command arguments to your dapr sidecar:

"--placement-host-address", "host.docker.internal:6050"

Take a look at your placement instance running in Docker Desktop to confirm the port number there.

You’ll also need to update your pubsub and statestore components’ yaml files to point to host.docker.internal instead of localhost.

Example:

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: pubsub
spec:
  type: pubsub.redis
  version: v1
  metadata:
  - name: redisHost
    value: host.docker.internal:6379
  - name: redisPassword
    value: ""
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: statestore
spec:
  type: state.redis
  version: v1
  metadata:
  - name: redisHost
    value: host.docker.internal:6379
  - name: redisPassword
    value: ""
  - name: actorStateStore
    value: "true"

This will correctly configure your docker compose managed instances to connect to your default dapr placement and redis instances created using dapr init on your dev machine.

The alternative is to spin up a dapr placement and redis instance inside your docker compose stack. The error is a bit misleading. The real issue is daprd is not able to communicate with either service inside the docker compose stack because it’s a different network.

0reactions
halspangcommented, Oct 31, 2022

@Namohar - Are you sure that your component was scoped to the appropriate apps? And did you see the next log line that I asked for?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How-to: Interact with virtual actors using scripting
You can interact with Dapr via HTTP/gRPC endpoints to save state reliably using the Dapr actor state mangement capabaility. To use actors, your...
Read more >
Common issues when running Dapr
There are some known cases where this might not properly work: ... Search the Dapr runtime logs and look for any state store...
Read more >
How to: Run and use virtual actors in the .NET SDK
The Dapr actor package allows you to interact with Dapr virtual actors from a . ... state store implicitly after each method execution...
Read more >
Actor runtime configuration parameters
If not provided, all reminders are saved as a single record in actor's state store. 0. entitiesConfig, Configure each actor type individually with...
Read more >
How-to: Enable and use actor reentrancy in Dapr | Dapr Docs
Configure the actor runtime to enable reentrancy. The reentrant actor must provide the appropriate configuration. This is done by the actor's endpoint for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found