Open rob-baily opened 1 year ago
I have the same problem but in my case, the exception happen when iterating in the result of the instance query response:
var instancesQuery = client.GetAllInstancesAsync(new OrchestrationQuery(Statuses: _runningStatuses));
await foreach (var instance in instancesQuery){ ... }
The await
on the foreach
throws this:
I can't use the storage emulator as others implied since I'm on MacOS so I'm stuck with Azurite.
Any clue would be appreciated.
@galvesribeiro did you follow #148 for running on MacOS?
I did. It works only with the default Azure Tables backend. If I use Netherite or SQL backends, the error is back again.
When using either of those backends, have you added the corresponding worker package?
https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask.Netherite https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer
It is necessary to add those packages as it informs the host to add the corresponding host extension.
I realize this may not be documented just yet.
@jviau yep, I added the isolated packages. I see the data being written on either the storage and sql respectively and if I remove the call to client.GetAllInstancesAsync
everything else just works.
@galvesribeiro: just to make sure I understand your situation. Is the following summary accurate?
First, you were experiencing this error across all storage providers / backends. Then, you followed the guidance here (https://github.com/microsoft/durabletask-dotnet/issues/148) and that solved it for the Azure Storage backend. And now, you only experience this error in the MSSQL and Netherite backends. Is that correct?
Yep. The native gRPC issue with Apple Silicon was actually not the problem. It was masking the real problem.
Also getting the same grpc error when calling client.GetAllInstancesAsync()
using Netherite
backend. GetInstanceAsync()
works fine though.
We are encountering the same Grpc Error, and it happens on Windows, Unix, and Mac. We receive essentially the same stack trace, when calling WaitForCompletionAsync
, but also with PurgeInstancesAsync
.
I'm also experiencing the same issue when calling DurableTaskClient.GetAllInstancesAsync
.
Environment: MacBook M1 Pro, Azurite, Netherite storage provider
I've tried manipulating the OrchestrationQuery
parameters, but to no avail. Other operations, such as PurgeInstancesAsync
do succeed, but only when the createdFrom
and createdTo
parameters are specified - leaving these as default
, results in a similar error.
The exception is quite generic, presumably hiding the underlying failure, so it's hard to diagnose:
Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.")
at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.<>c__DisplayClass15_0.<<GetAllInstancesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.DurableTask.Pageable.FuncAsyncPageable`1.AsPagesCore(String continuationToken, Nullable`1 pageSizeHint, CancellationToken cancellation)+MoveNext()
at Microsoft.DurableTask.Pageable.FuncAsyncPageable`1.AsPagesCore(String continuationToken, Nullable`1 pageSizeHint, CancellationToken cancellation)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at Microsoft.DurableTask.AsyncPageable`1.GetAsyncEnumerator(CancellationToken cancellationToken)+MoveNext()
at Microsoft.DurableTask.AsyncPageable`1.GetAsyncEnumerator(CancellationToken cancellationToken)+MoveNext()
at Microsoft.DurableTask.AsyncPageable`1.GetAsyncEnumerator(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
I can't comment on the Netherite issue yet, but at least for the default Azure Storage backend, I believe this error was coming from a null-reference exception that we recently patched here: https://github.com/Azure/durabletask/pull/910. Note that this has not been released yet.
I'm taking a note to investigate the Netherite equivalent.
I had the same exception when trying to run it locally. It turned out that I did not have a local.settings.json file (I thought I did not need it because I had the same values in my launchsettings.json). After adding a file with the following content, it worked as expected.
{ "IsEncrypted": false, "Values": { "AzureWebJobsSecretStorageType": "files", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" } }
Maybe this helps.
Maybe this helps other people that encounter this error message. After solving this locally, I had the same error message when I deployed it to an Azure Function App. It took me a couple of days, but I finally figured out that the durable functions use table storage. My Azure Function App only had permission to blobs and queues, but not to Table Storage (The account that I used to locally test it, had those permissions).
Maybe the documentation can make it clearer that the function app requires these permissions.
Also, maybe the exception that is thrown can make it clearer that the app has insufficient permissions, because now I got the very generic message that does not give any clues.
Result: Failure Exception: System.AggregateException: One or more errors occurred. (Status(StatusCode="Unknown", Detail="Exception was thrown by handler.")) ---> Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.") at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.GetInstancesAsync(String instanceId, Boolean getInputsAndOutputs, CancellationToken cancellation) at Lias.Dataloader.FunctionApp.CsvZipFileUploadedTrigger.RunAsync(String myBlob, DurableTaskClient durableTaskClient, Guid tenant, String name) in /src/Lias.Dataloader.FunctionApp/CsvZipFileUploadedTrigger.cs:line 65 at Microsoft.Azure.Functions.Worker.Invocation.VoidTaskMethodInvoker2.InvokeAsync(TReflected instance, Object[] arguments) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\VoidTaskMethodInvoker.cs:line 22 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker2.<>c.<InvokeAsync>b__6_0(Task
1 t) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 32 at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45 at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13 at Microsoft.Azure.Functions.Worker.Extensions.DurableTask.DurableTaskFunctionsMiddleware.Invoke(FunctionContext functionContext, FunctionExecutionDelegate next) in /_/src/Worker.Extensions.DurableTask/DurableTaskFunctionsMiddleware.cs:line 22 at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77 at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 88 Stack: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker2.<>c.<InvokeAsync>b__6_0(Task
1 t) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 32 at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45 at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13 at Microsoft.Azure.Functions.Worker.Extensions.DurableTask.DurableTaskFunctionsMiddleware.Invoke(FunctionContext functionContext, FunctionExecutionDelegate next) in /_/src/Worker.Extensions.DurableTask/DurableTaskFunctionsMiddleware.cs:line 22 at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77 at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request) in D:\a_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 88
Maybe this helps other people that encounter this error message. After solving this locally, I had the same error message when I deployed it to an Azure Function App. It took me a couple of days, but I finally figured out that the durable functions use table storage. My Azure Function App only had permission to blobs and queues, but not to Table Storage (The account that I used to locally test it, had those permissions).
Maybe the documentation can make it clearer that the function app requires these permissions.
Also, maybe the exception that is thrown can make it clearer that the app has insufficient permissions, because now I got the very generic message that does not give any clues.
Result: Failure Exception: System.AggregateException: One or more errors occurred. (Status(StatusCode="Unknown", Detail="Exception was thrown by handler.")) ---> Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.") at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.GetInstancesAsync(String instanceId, Boolean getInputsAndOutputs, CancellationToken cancellation) at Lias.Dataloader.FunctionApp.CsvZipFileUploadedTrigger.RunAsync(String myBlob, DurableTaskClient durableTaskClient, Guid tenant, String name) in /src/Lias.Dataloader.FunctionApp/CsvZipFileUploadedTrigger.cs:line 65 at Microsoft.Azure.Functions.Worker.Invocation.VoidTaskMethodInvoker
2.InvokeAsync(TReflected instance, Object[] arguments) in D:\a\_work\1\s\src\DotNetWorker.Core\Invocation\VoidTaskMethodInvoker.cs:line 22 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker2.<>c.<InvokeAsync>b__6_0(Task
1 t) in D:\awork\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 32 at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45 at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13 at Microsoft.Azure.Functions.Worker.Extensions.DurableTask.DurableTaskFunctionsMiddleware.Invoke(FunctionContext functionContext, FunctionExecutionDelegate next) in //src/Worker.Extensions.DurableTask/DurableTaskFunctionsMiddleware.cs:line 22 at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77 at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request) in D:\a_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 88 Stack: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker
2.<>c.b__6_0(Task 1 t) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 32 at System.Threading.Tasks.ContinuationResultTaskFromResultTask
2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45 at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\awork\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13 at Microsoft.Azure.Functions.Worker.Extensions.DurableTask.DurableTaskFunctionsMiddleware.Invoke(FunctionContext functionContext, FunctionExecutionDelegate next) in //src/Worker.Extensions.DurableTask/DurableTaskFunctionsMiddleware.cs:line 22 at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77 at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request) in D:\a_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 88
I should say Thank You. We had the same problem, luckily I found your solution. It's Dec 2023 and the problem has not solved yet!
Also running into this issue. I created a clean .net 8 isolated function project upgrade to latest nuget versions and getting the exact same error locally. If anyone knows a workaround please share :)
[Function("HttpTriggerTest")]
public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequestData req, [DurableClient] DurableTaskClient client)
{
_logger.LogInformation("C# HTTP trigger function processed a request.");
try
{
var result = await client.PurgeAllInstancesAsync(new PurgeInstancesFilter(null, DateTime.Today.AddDays(-30),
new List<OrchestrationRuntimeStatus>
{
OrchestrationRuntimeStatus.Completed,
OrchestrationRuntimeStatus.Failed,
OrchestrationRuntimeStatus.Terminated
})
);
_logger.LogInformation(
"{FunctionName} result at {Date}: {PurgedInstanceCount} records were deleted.",
nameof(TimedTrigger), DateTime.Now, result.PurgedInstanceCount);
}
catch (Exception e)
{
_logger.LogError(e, "{FunctionName}: Failed to clean instance history data",
nameof(TimedTrigger));
}
var response = req.CreateResponse(HttpStatusCode.OK);
response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
response.WriteString("Welcome to Azure Functions!");
return response;
}
client.PurgeAllInstancesAsync is throwing: "Failed to clean instance history data Exception: Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.")"
We're also running into this same issue when using Netherite. We use WaitForInstanceCompletionAsync
to implement Singleton Orchestrators. We were hoping to switch from Azure Storage to Netherite but unfortunately this is a deal breaker.
Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.CreateMetadata(OrchestrationState state, Boolean includeInputsAndOutputs) at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.WaitForInstanceCompletionAsync(String instanceId, Boolean getInputsAndOutputs, CancellationToken cancellation)
Also running into this issue. I created a clean .net 8 isolated function project upgrade to latest nuget versions and getting the exact same error locally. If anyone knows a workaround please share :)
[Function("HttpTriggerTest")] public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequestData req, [DurableClient] DurableTaskClient client) { _logger.LogInformation("C# HTTP trigger function processed a request."); try { var result = await client.PurgeAllInstancesAsync(new PurgeInstancesFilter(null, DateTime.Today.AddDays(-30), new List<OrchestrationRuntimeStatus> { OrchestrationRuntimeStatus.Completed, OrchestrationRuntimeStatus.Failed, OrchestrationRuntimeStatus.Terminated }) ); _logger.LogInformation( "{FunctionName} result at {Date}: {PurgedInstanceCount} records were deleted.", nameof(TimedTrigger), DateTime.Now, result.PurgedInstanceCount); } catch (Exception e) { _logger.LogError(e, "{FunctionName}: Failed to clean instance history data", nameof(TimedTrigger)); } var response = req.CreateResponse(HttpStatusCode.OK); response.Headers.Add("Content-Type", "text/plain; charset=utf-8"); response.WriteString("Welcome to Azure Functions!"); return response; }
client.PurgeAllInstancesAsync is throwing: "Failed to clean instance history data Exception: Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.")"
Even I am facing the same issue, any workaround or solution for this problem?
It seems its actually not supported checking the code: https://github.com/microsoft/durabletask-dotnet/blob/4de17486f97ce4507ecbd496cf877faf7e4cf78a/src/Client/Core/DurableTaskClient.cs#L399
I am also interested in a work around.
Also running into this issue. I created a clean .net 8 isolated function project upgrade to latest nuget versions and getting the exact same error locally. If anyone knows a workaround please share :)
[Function("HttpTriggerTest")] public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequestData req, [DurableClient] DurableTaskClient client) { _logger.LogInformation("C# HTTP trigger function processed a request."); try { var result = await client.PurgeAllInstancesAsync(new PurgeInstancesFilter(null, DateTime.Today.AddDays(-30), new List<OrchestrationRuntimeStatus> { OrchestrationRuntimeStatus.Completed, OrchestrationRuntimeStatus.Failed, OrchestrationRuntimeStatus.Terminated }) ); _logger.LogInformation( "{FunctionName} result at {Date}: {PurgedInstanceCount} records were deleted.", nameof(TimedTrigger), DateTime.Now, result.PurgedInstanceCount); } catch (Exception e) { _logger.LogError(e, "{FunctionName}: Failed to clean instance history data", nameof(TimedTrigger)); } var response = req.CreateResponse(HttpStatusCode.OK); response.Headers.Add("Content-Type", "text/plain; charset=utf-8"); response.WriteString("Welcome to Azure Functions!"); return response; }
client.PurgeAllInstancesAsync is throwing: "Failed to clean instance history data Exception: Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.")"
Even I am facing the same issue, any workaround or solution for this problem?
workaround here is not passing null, but a from date like 30 days ago or so. It seems null / datetime.minvalue all don't work somehow.
Facing the same issue when I try to get all the instances
var instances = await client.GetAllInstancesAsync(new OrchestrationQuery
{
CreatedFrom = DateTimeOffset.Now.AddDays(-2),
CreatedTo = DateTimeOffset.Now,
Statuses = new List<OrchestrationRuntimeStatus>
{
OrchestrationRuntimeStatus.Running,
OrchestrationRuntimeStatus.Pending,
}
}).ToListAsync();
[2024-04-11T13:53:02.177Z] [15:53:02 ERR] Error in bong trigger: Status(StatusCode="Unknown", Detail="Exception was thrown by handler."), Message: Status(StatusCode="Unknown", Detail="Exception was thrown by handler."), InnerException: null
[2024-04-11T13:53:02.179Z] Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.")
[2024-04-11T13:53:02.180Z] at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.<>c__DisplayClass18_0.<<GetAllInstancesAsync>b__0>d.MoveNext()
[2024-04-11T13:53:02.181Z] --- End of stack trace from previous location ---
[2024-04-11T13:53:02.183Z] at Microsoft.DurableTask.Pageable.FuncAsyncPageable`1.AsPagesCore(String continuationToken, Nullable`1 pageSizeHint, CancellationToken cancellation)+MoveNext()
[2024-04-11T13:53:02.183Z] at Microsoft.DurableTask.Pageable.FuncAsyncPageable`1.AsPagesCore(String continuationToken, Nullable`1 pageSizeHint, CancellationToken cancellation)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
[2024-04-11T13:53:02.185Z] at Microsoft.DurableTask.AsyncPageable`1.GetAsyncEnumerator(CancellationToken cancellationToken)+MoveNext()
[2024-04-11T13:53:02.186Z] at Microsoft.DurableTask.AsyncPageable`1.GetAsyncEnumerator(CancellationToken cancellationToken)+MoveNext()
[2024-04-11T13:53:02.187Z] at Microsoft.DurableTask.AsyncPageable`1.GetAsyncEnumerator(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
[2024-04-11T13:53:02.188Z] at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|424_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
[2024-04-11T13:53:02.189Z] at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|424_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
[2024-04-11T13:53:02.191Z] at CoopNorge.Bongs.Trigger.Functions.BongTrigger.Run(TimerInfo myTimer, DurableTaskClient client) in C:\Dev\Projects\BongsIkano\solutions\CoopNorge.Bongs\CoopNorge.Bongs\CoopNorge.Bongs.Trigger\Functions\BongTrigger.cs:line 30
Temporary solution...
Experienced exactly the same issue. Because this was working for me earlier, I was able to determine that this started happening after updating package "Microsoft.Azure.Functions.Worker.Extensions.DurableTask" from 1.1.1 to 1.1.2 (latest). After backing this off and going back to 1.1.1 the issue went away.
Facing the same issue when I try to get all the instances
var instances = await client.GetAllInstancesAsync(new OrchestrationQuery { CreatedFrom = DateTimeOffset.Now.AddDays(-2), CreatedTo = DateTimeOffset.Now, Statuses = new List<OrchestrationRuntimeStatus> { OrchestrationRuntimeStatus.Running, OrchestrationRuntimeStatus.Pending, } }).ToListAsync();
[2024-04-11T13:53:02.177Z] [15:53:02 ERR] Error in bong trigger: Status(StatusCode="Unknown", Detail="Exception was thrown by handler."), Message: Status(StatusCode="Unknown", Detail="Exception was thrown by handler."), InnerException: null [2024-04-11T13:53:02.179Z] Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Exception was thrown by handler.") [2024-04-11T13:53:02.180Z] at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.<>c__DisplayClass18_0.<<GetAllInstancesAsync>b__0>d.MoveNext() [2024-04-11T13:53:02.181Z] --- End of stack trace from previous location --- [2024-04-11T13:53:02.183Z] at Microsoft.DurableTask.Pageable.FuncAsyncPageable`1.AsPagesCore(String continuationToken, Nullable`1 pageSizeHint, CancellationToken cancellation)+MoveNext() [2024-04-11T13:53:02.183Z] at Microsoft.DurableTask.Pageable.FuncAsyncPageable`1.AsPagesCore(String continuationToken, Nullable`1 pageSizeHint, CancellationToken cancellation)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult() [2024-04-11T13:53:02.185Z] at Microsoft.DurableTask.AsyncPageable`1.GetAsyncEnumerator(CancellationToken cancellationToken)+MoveNext() [2024-04-11T13:53:02.186Z] at Microsoft.DurableTask.AsyncPageable`1.GetAsyncEnumerator(CancellationToken cancellationToken)+MoveNext() [2024-04-11T13:53:02.187Z] at Microsoft.DurableTask.AsyncPageable`1.GetAsyncEnumerator(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult() [2024-04-11T13:53:02.188Z] at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|424_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36 [2024-04-11T13:53:02.189Z] at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|424_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36 [2024-04-11T13:53:02.191Z] at CoopNorge.Bongs.Trigger.Functions.BongTrigger.Run(TimerInfo myTimer, DurableTaskClient client) in C:\Dev\Projects\BongsIkano\solutions\CoopNorge.Bongs\CoopNorge.Bongs\CoopNorge.Bongs.Trigger\Functions\BongTrigger.cs:line 30
Is there any plans to fix this issue in the near future?
I see this issue now using "Microsoft.Azure.Functions.Worker.Extensions.DurableTask" version 1.1.2 and I'm hoping changing to use 1.1.1 works.
I actually submitted this first at https://github.com/Azure/azure-functions-core-tools/issues/3227 but some other research indicated this might be the correct place.
The code below is taken from the MS provided template and I added the
await client.WaitForInstanceCompletionAsync
call which is where the error is triggered. It is should be easy to reproduce since it is basically the MS template with one line added. This is using .NET 7.0 in an isolated process. I upgraded to the latest packages so here are my versions:I have also seen the same behavior is .NET 6.0 isolated as well as noted in the other issue.
The full stack is: