dapr / dotnet-sdk

Dapr SDK for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error actor instance is missing

tructran91 opened this issue · comments

Ask your question here

I'm using .NET 6 and Dapr.Actors.AspNetCore version 1.8.0. I have an error: "actor instance is missing" when trying to load state via this.StateManager.GetStateAsync(). This error is not always but often occurs. Below is some information. How can I fix it?

Dapr.DaprApiException: actor instance is missing at async Task<HttpResponseMessage> Dapr.Actors.DaprHttpInteractor.SendAsyncHandleUnsuccessfulResponse(Func<HttpRequestMessage> requestFunc, string relativeUri, CancellationToken cancellationToken) at async Task<HttpResponseMessage> Dapr.Actors.DaprHttpInteractor.SendAsync(Func<HttpRequestMessage> requestFunc, string relativeUri, CancellationToken cancellationToken) at async Task<string> Dapr.Actors.DaprHttpInteractor.GetStateAsync(string actorType, string actorId, string keyName, CancellationToken cancellationToken) at async Task<ConditionalValue<T>> Dapr.Actors.Runtime.DaprStateProvider.TryLoadStateAsync<T>(string actorType, string actorId, string stateName, CancellationToken cancellationToken) at async Task<ConditionalValue<T>> Dapr.Actors.Runtime.ActorStateManager.TryGetStateAsync<T>(string stateName, CancellationToken cancellationToken) at async Task<PlatformTradingAccount> Service.Actors.GetAccountFromStateManagerAsync(CancellationToken cancellationToken) in /src/Service/Actor.cs:line 127 at async void Service.Actors.OnOrderUpdateEvent(object sender, OrderUpdateEventArgs updateEvent) in /src/Actor.cs:line 236

dapper

@tructran91 Several questions:

  • What version of Dapr runtime are you using?
  • Do you see this only in production or does it also reproduce locally?
  • Have you tried using the 1.12 versions of both the Dapr runtime and Dapr .NET SDK?
  • Do you have any Dapr sidecar logs (preferably with --log-level set to debug) for the period in which the error occurs?

@tructran91 - This most likely means that the actor isn't hosted in your runtime. Is this the app that hosts the actor?

1.8 is quite old though, and no longer officially supported. I'd recommend updating to 1.12 and we can debug from there. Here is the list of supported version.

Thank you for your reply.

@philliphoff

  • We're using version 1.11.0 of Dapr runtime, in our source code, we use Dapr.Actors.AspNetCore version 1.8.0
  • It happen both production and locally, it very hard to reproduce. It not always occurs
  • We use ELK to log error and info happen in system

image

I would still recommend updating the Dapr.Actors.AspNetCore version.

Generally though, this error simply means there isn't a host available for that actor. Do you see any instances of your apps restarting? It could be that they are temporarily down and thus no longer receiving traffic. Without seeing more of your code and how you setup/register your actors though, we can't debug a whole lot more from here.