Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot execute orchestration written in F# #99

Open
landy opened this issue Dec 19, 2022 · 3 comments
Open

Cannot execute orchestration written in F# #99

landy opened this issue Dec 19, 2022 · 3 comments
Labels
bug Something isn't working external This issue is external to our code/behavior. P3

Comments

@landy
Copy link

landy commented Dec 19, 2022

Hello, I'm trying to write durable azure functions using the isolated worker, and so far I had no luck with this. The orchestration throws an exception when triggered. The same solution written in C# works just fine. I created an example repository where the behavior can be observed https://github.com/landy/fsharp-isolated-durable-function.

The exception is

Executed 'Functions.HttpTestOrchestration' (Failed, Id=0660b3b4-f669-4b8c-ab3f-4a5066944186, Duration=163ms)
[2022-12-19T10:56:12.028Z] System.Private.CoreLib: Exception while executing function: Functions.HttpTestOrchestration. System.Private.CoreLib: Res
ult: Failure
Exception: System.InvalidOperationException: Unable to resolve service for type 'Microsoft.DurableTask.Client.IDurableTaskClientProvider' while att
empting to activate 'Microsoft.Azure.Functions.Worker.DefaultDurableClientContext+Converter'.
[2022-12-19T10:56:12.029Z]    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider pro
vider)
[2022-12-19T10:56:12.030Z]    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanc
eType, Object[] parameters)
[2022-12-19T10:56:12.031Z]    at Microsoft.Azure.Functions.Worker.Converters.DefaultInputConverterProvider.<GetOrCreateConverterInstance>b__7_0(Str
ing key, String converterTypeAssemblyQualifiedName) in D:\a\_work\1\s\src\DotNetWorker.Core\Converters\Converter\DefaultInputConverterProvider.cs:l
ine 85
[2022-12-19T10:56:12.032Z]    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd[TArg](TKey key, Func`3 valueFactory, TArg factoryArg
ument)
[2022-12-19T10:56:12.033Z]    at Microsoft.Azure.Functions.Worker.Converters.DefaultInputConverterProvider.GetOrCreateConverterInstance(String conv
erterTypeName) in D:\a\_work\1\s\src\DotNetWorker.Core\Converters\Converter\DefaultInputConverterProvider.cs:line 73
[2022-12-19T10:56:12.035Z]    at Microsoft.Azure.Functions.Worker.Context.Features.DefaultInputConversionFeature.GetConverterFromContext(ConverterC
ontext context) in D:\a\_work\1\s\src\DotNetWorker.Core\Context\Features\DefaultInputConversionFeature.cs:line 108
[2022-12-19T10:56:12.036Z]    at Microsoft.Azure.Functions.Worker.Context.Features.DefaultInputConversionFeature.ConvertAsync(ConverterContext conv
erterContext) in D:\a\_work\1\s\src\DotNetWorker.Core\Context\Features\DefaultInputConversionFeature.cs:line 38
[2022-12-19T10:56:12.037Z]    at Microsoft.Azure.Functions.Worker.Context.Features.DefaultModelBindingFeature.BindFunctionInputAsync(FunctionContex
t context) in D:\a\_work\1\s\src\DotNetWorker.Core\Context\Features\DefaultModelBindingFeature.cs:line 79
[2022-12-19T10:56:12.038Z]    at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a\
_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 41
[2022-12-19T10:56:12.039Z]    at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionE
xecutionDelegate next) in D:\a\_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13
[2022-12-19T10:56:12.040Z]    at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request, WorkerOptions w
orkerOptions) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 84
Stack:    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
[2022-12-19T10:56:12.041Z]    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanc
eType, Object[] parameters)
[2022-12-19T10:56:12.043Z]    at Microsoft.Azure.Functions.Worker.Converters.DefaultInputConverterProvider.<GetOrCreateConverterInstance>b__7_0(Str
ing key, String converterTypeAssemblyQualifiedName) in D:\a\_work\1\s\src\DotNetWorker.Core\Converters\Converter\DefaultInputConverterProvider.cs:l
ine 85
[2022-12-19T10:56:12.044Z]    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd[TArg](TKey key, Func`3 valueFactory, TArg factoryArg
ument)
[2022-12-19T10:56:12.045Z]    at Microsoft.Azure.Functions.Worker.Converters.DefaultInputConverterProvider.GetOrCreateConverterInstance(String conv
erterTypeName) in D:\a\_work\1\s\src\DotNetWorker.Core\Converters\Converter\DefaultInputConverterProvider.cs:line 73
[2022-12-19T10:56:12.046Z]    at Microsoft.Azure.Functions.Worker.Context.Features.DefaultInputConversionFeature.GetConverterFromContext(ConverterC
ontext context) in D:\a\_work\1\s\src\DotNetWorker.Core\Context\Features\DefaultInputConversionFeature.cs:line 108
[2022-12-19T10:56:12.047Z]    at Microsoft.Azure.Functions.Worker.Context.Features.DefaultInputConversionFeature.ConvertAsync(ConverterContext conv
erterContext) in D:\a\_work\1\s\src\DotNetWorker.Core\Context\Features\DefaultInputConversionFeature.cs:line 38
[2022-12-19T10:56:12.049Z]    at Microsoft.Azure.Functions.Worker.Context.Features.DefaultModelBindingFeature.BindFunctionInputAsync(FunctionContex
t context) in D:\a\_work\1\s\src\DotNetWorker.Core\Context\Features\DefaultModelBindingFeature.cs:line 79
[2022-12-19T10:56:12.051Z]    at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a\
_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 41
[2022-12-19T10:56:12.053Z]    at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionE
xecutionDelegate next) in D:\a\_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13
[2022-12-19T10:56:12.055Z]    at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request, WorkerOptions w
orkerOptions) in D:\a\_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 84.
@jviau jviau added the bug Something isn't working label Dec 19, 2022
@jviau
Copy link
Member

jviau commented Dec 19, 2022

I opened an issue on the dotnet worker repo with the root cause: Azure/azure-functions-dotnet-worker#1246

This appears to be an F# only issue. The extensibility point we rely on in Functions dotnet-isolated is not called in the F# scenario, meaning the durable extension is not ever configured, rendering it unusable in F#.

@jviau jviau added the external This issue is external to our code/behavior. label Dec 19, 2022
@landy
Copy link
Author

landy commented Dec 19, 2022

Thank you!

@jviau
Copy link
Member

jviau commented Dec 19, 2022

In the meantime, you can workaround this issue by including a manual call to this method as part of your ConfigureFunctionsWorkerDefaults callback.

@lilyjma lilyjma added the P3 label Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external This issue is external to our code/behavior. P3
Projects
None yet
Development

No branches or pull requests

3 participants