DurableFunctions.FSharp icon indicating copy to clipboard operation
DurableFunctions.FSharp copied to clipboard

Function will not start when using Paket for package management

Open jbeeko opened this issue 7 years ago • 4 comments

I've not been able to get DurableFunctions.FSharp to work correctly whenusing Paket.

I created two near identical Solutions, one using Paket and one using straight Nuget. These are based on your samples stripped down to just Hello. The Paket one fails on startup with:

[4/12/2019 9:12:57 PM] Microsoft.Azure.WebJobs.Host: Error indexing method 'HttpStart'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'starter' to type DurableOrchestrationClient. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

The complete trace of the the startup error followed by the runtime error when the functin is invoked is below. I've attached a zip of a repository with the two solutions included.

Any ideas?

samples.zip

[4/12/2019 9:12:56 PM] Generating 1 job function(s)
[4/12/2019 9:12:57 PM] Error indexing method 'HttpStart'
[4/12/2019 9:12:57 PM] Microsoft.Azure.WebJobs.Host: Error indexing method 'HttpStart'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'starter' to type DurableOrchestrationClient. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[4/12/2019 9:12:57 PM] Function 'HttpStart' failed indexing and will be disabled.
[4/12/2019 9:12:57 PM] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[4/12/2019 9:12:57 PM] Host initialized (1520ms)
[4/12/2019 9:12:57 PM] Host started (1536ms)
[4/12/2019 9:12:57 PM] Job host started
[4/12/2019 9:12:57 PM] The following 2 functions are in error:
[4/12/2019 9:12:57 PM] HelloSequence: The binding type(s) 'orchestrationTrigger' are not registered. Please ensure the type is correct and the binding extension is installed.
[4/12/2019 9:12:57 PM] SayHello: The binding type(s) 'activityTrigger' are not registered. Please ensure the type is correct and the binding extension is installed.
[4/12/2019 9:12:57 PM]
Hosting environment: Production
Content root path: C:\Users\jbeeko\Desktop\samples\samples-paket\bin\Debug\netcoreapp2.2
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.

Http Functions:

        HttpStart: [GET] http://localhost:7071/api/orchestrators/{functionName}

[4/12/2019 9:13:02 PM] Host lock lease acquired by instance ID '00000000000000000000000022492EBD'.
[4/12/2019 9:13:11 PM] Executing HTTP request: {
[4/12/2019 9:13:11 PM]   "requestId": "7fefab8d-90c9-43de-8c27-18f3aaf031be",
[4/12/2019 9:13:11 PM]   "method": "GET",
[4/12/2019 9:13:11 PM]   "uri": "/api/orchestrators/HelloSequence"
[4/12/2019 9:13:11 PM] }
[4/12/2019 9:13:12 PM] An unhandled host error has occurred.
[4/12/2019 9:13:12 PM] Microsoft.Azure.WebJobs.Host: 'HttpStart' can't be invoked from Azure WebJobs SDK. Is it missing Azure WebJobs SDK attributes?.
[4/12/2019 9:13:12 PM] Executed HTTP request: {
[4/12/2019 9:13:12 PM]   "requestId": "7fefab8d-90c9-43de-8c27-18f3aaf031be",
[4/12/2019 9:13:12 PM]   "method": "GET",
[4/12/2019 9:13:13 PM]   "uri": "/api/orchestrators/HelloSequence",
[4/12/2019 9:13:13 PM]   "identities": [
[4/12/2019 9:13:13 PM]     {
[4/12/2019 9:13:13 PM]       "type": "WebJobsAuthLevel",
[4/12/2019 9:13:13 PM]       "level": "Admin"
[4/12/2019 9:13:13 PM]     }
[4/12/2019 9:13:13 PM]   ],
[4/12/2019 9:13:13 PM]   "status": 500,
[4/12/2019 9:13:13 PM]   "duration": 1098
[4/12/2019 9:13:13 PM] }

jbeeko avatar Apr 12 '19 21:04 jbeeko

This above was when building and running use VS 2019 (16.0.1). I will try core cli tools next and report.

jbeeko avatar Apr 13 '19 14:04 jbeeko

The following works from the samples/samples-packet directory:

dotnet restore -> 
dotnet build -> 
 func host start --script-root bin/Debug/netcoreapp2.2

What does not work in the Paket case is selecting the project in VS 2019 and using menu item Debug->Start new instance

jbeeko avatar Apr 13 '19 14:04 jbeeko

This is not a DurableFunctions issue per-se but rather this issue: https://github.com/fsprojects/Paket/issues/3345#issuecomment-479896019 means the build process puts an empty extenstions.json file insamples-paket\bin\Debug\netcoreapp2.2 rather than the correct file in samples-paket\bin\Debug\netcoreapp2.2\bin. As a result the durable functions extension is not found.

Having the extensions file in the wrong place has not been an issue up to now because http bindings are build in.

Others don't seem to be encountering #3345 the way I am so my situation could just be something unique to my configuration. I'll build a clean VM with VS 2019 and report back.

jbeeko avatar Apr 13 '19 15:04 jbeeko

I can reproduce it in both VS 2017 and 2019 when I do a fresh build or rebuild from VS. If I'll do a fresh build (or clean/build or build --force) using dotnet cli then it runs fine, even when running from VS. It looks like it's related to the way VS builds the project.

bartsokol avatar Apr 15 '19 18:04 bartsokol