Open gui28347 opened 8 months ago
Can you provide a minimal repro? What version of the Durable functions extension are you using?
Also, I see in your code you are using an activity to raise an event on another orchestration. This can be performed directly from an orchestration via TaskOrchestrationContext.SendEvent
.
Microsoft.Azure.Functions.Worker.Extensions.DurableTask Version="1.1.0" Repro code attached: TEST99.zip
Also have a very simple and probably related example in https://github.com/microsoft/durabletask-dotnet/issues/143#issuecomment-1866278894
I think I am running into the same error as well.
Did anyone solved their issues?
Having the same issue when calling DurableTaskClient#RaiseEventAsync()
. @jviau Can you help on this?
I was able to solve it for me.
My issue was, that if no Orchestrator is waiting for the eventId we are raising here you are seeing this error
await client.RaiseEventAsync(context.InvocationId, "StatusUpdate", customStatus);
Probably, the error message should be updated a bit to reflect this case better.
Hi, I was having the same exception on durableTaskClient.ScheduleNewOrchestrationInstanceAsync
and the comment from jhueppauff pointed me to the solution. Due to another issue, the Orchestration functions did not register during startup. Therefore, if you encounter Grpc exceptions, make sure the orchestration function shows up on startup.
And I agree, the error should says something like "Could not call function xyz". This would have saved me a couple of hour searching in the wrong direction.
Trying to migrate a function running in-process to out-of-process dotnet-isolated 7.
Same code works perfectly in in-process mode. Causing this exception in dotnet-isolated 7 after migrating the required code to run as dotnet-isolatd.
Stack: [2023-11-18T04:13:01.793Z] Function 'MainActivityVM', Invocation id 'b81a7a79-437c-4d76-8ae2-64e48fbbb62e': An exception was thrown by the invocation. [2023-11-18T04:13:01.794Z] Result: Function 'MainActivityVM', Invocation id 'b81a7a79-437c-4d76-8ae2-64e48fbbb62e': An exception was thrown by the invocation. Exception: System.AggregateException: One or more errors occurred. (RunMain Exception: Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.") [2023-11-18T04:13:01.795Z] at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.RaiseEventAsync(String instanceId, String eventName, Object eventPayload, CancellationToken cancellation) [2023-11-18T04:13:01.795Z] at TEST99.SampleFunction.RunMain(FunctionContext context, DurableTaskClient dclient, String vmname, String vmtype) in C:\temp\investigate\AzureAutomation_PersonalDOTNET8\TEST99\SampleFunction.cs:line 82) [2023-11-18T04:13:01.796Z] ---> System.Exception: RunMain Exception: Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.") [2023-11-18T04:13:01.797Z] at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.RaiseEventAsync(String instanceId, String eventName, Object eventPayload, CancellationToken cancellation) [2023-11-18T04:13:01.797Z] at TEST99.SampleFunction.RunMain(FunctionContext context, DurableTaskClient dclient, String vmname, String vmtype) in C:\temp\investigate\AzureAutomation_PersonalDOTNET8\TEST99\SampleFunction.cs:line 82 [2023-11-18T04:13:01.798Z] at TEST99.SampleFunction.RunMain(FunctionContext context, DurableTaskClient dclient, String vmname, String vmtype) in C:\temp\investigate\AzureAutomation_PersonalDOTNET8\TEST99\SampleFunction.cs:line 93 [2023-11-18T04:13:01.799Z] --- End of inner exception stack trace ---
[Function("MainActivityVM")] public static async Task RunMain(
[ActivityTrigger] FunctionContext context,
[DurableClient] DurableTaskClient dclient, string vmname, string vmtype)
{
CustomStatusDurableFunction customStatus = new();
try
{
int i = 0;
while (true)
{
i++;
customStatus.progressBar = i;
await dclient.RaiseEventAsync(context.InvocationId, "StatusUpdate", customStatus); // line 82
System.Threading.Thread.Sleep(2000);
if (i == 100)
{
break;
}
}
return "OK";
}
catch (Exception ex)
{
throw new Exception($"RunMain Exception: {ex}"); // line 93
}
}