Azure / Azure/azure-functions-core-tools
function.json not found on durable function run on kubernetes
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 14
Description
my steps:
I have a docker-desktop k8s cluster working, with KEDA installed.
1) installed func tools v3
2) `func init --docker --working-runtime dotnet`
3) opened the .csproj with vs2019, added new durable function, Function1, with default demo content (Hello)
4) tested the app with F5, all in order
5) modified the Dockerfile produced by func to awiod missing webhooks error, added
` ENV WEBSITE_HOSTNAME=localhost:7071`
6) changed the connection string "AzureWebJobsStorage": to an existing webstorage
7) deployed the app with
` func kubernetes deploy --name fromscratch-df --registry {mygithubname}`
8) the service starts happily, but when I call the `http://localhost/api/Function1_HttpStart` method
I have this exception (through `kubectl log`)
### **`System.InvalidOperationException: Missing function.json for 'Function1'.`**
the full log is:
```
info: Host.General[316]
Host lock lease acquired by instance ID '000000000000000000000000506DD2B1'.
info: Function.Function1_HttpStart[1]
Executing 'Function1_HttpStart' (Reason='This function was programmatically called via the host APIs.', Id=eddc390c-09fd-4b62-b523-a500567792d3)
info: Host.Triggers.DurableTask[0]
6a2af093c7504fe6baea456e019630cc: Function 'Function1 (Orchestrator)' scheduled. Reason: NewInstance. IsReplay: False. State: Scheduled. HubName: TestHubName. AppName: . SlotName: . ExtensionVersion: 2.1.1. SequenceNumber: 2.
info: Function.Function1_HttpStart.User[0]
Started orchestration with ID = '6a2af093c7504fe6baea456e019630cc'.
info: Function.Function1_HttpStart[2]
Executed 'Function1_HttpStart' (Succeeded, Id=eddc390c-09fd-4b62-b523-a500567792d3, Duration=651ms)
fail: Function.Function1[3]
Executed 'Function1' (Failed, Id=a6ef9fde-8dc6-4146-b976-14ea12268dee, Duration=36ms)
System.InvalidOperationException: Missing function.json for 'Function1'.
at Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.FunctionInstanceLogger.AddAsync(FunctionInstanceLogEntry item, CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/Diagnostics/FunctionInstanceLogger.cs:line 113
at Microsoft.Azure.WebJobs.Host.Loggers.CompositeFunctionEventCollector.AddAsync(FunctionInstanceLogEntry item, CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Loggers\CompositeFunctionEventCollector.cs:line 21
at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.NotifyPreBindAsync(FunctionStartedMessage functionStartedMessage) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs:line 741
at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.TryExecuteAsyncCore(IFunctionInstanceEx functionInstance, CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs:line 121
info: Host.Triggers.DurableTask[0]
6a2af093c7504fe6baea456e019630cc: Function 'Function1 (Orchestrator)' awaited. IsReplay: False. State: Awaited. HubName: TestHubName. AppName: . SlotName: . ExtensionVersion: 2.1.1. SequenceNumber: 3.
```
versions:
```
kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:44:30Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:18:29Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
```
```
func version
3.0.2798
```
```
docker version
Client: Docker Engine - Community
Version: 19.03.12
API version: 1.40
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:43:18 2020
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.12
API version: 1.40 (minimum version 1.12)
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:49:27 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
```
```
dotnet --version
3.1.401
```
Contributor guide
Research direction
Start by reproducing the deployment with func kubernetes deploy, using the generated Dockerfile and the default durable-function project from the issue. Compare the local F5 run with kubectl logs from the deployed service, focusing on why Function1 lacks function.json. Done means the Kubernetes deployment runs the durable orchestration without the missing-function.json exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, docker, kubernetes
- Domain
- backend, cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100