Azure / Azure/azure-functions-host

System.Private.CoreLib: Exception while executing function: Fn1. Microsoft.Extensions.Logging.Abstractions: Value cannot be null.

Open
#4,103 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

.NET Core 2.2
Azure Functions Core Tools (2.4.299)
Function Runtime Version: 2.0.12285.0

Microsoft.NET.Sdk.Functions 1.0.24
Microsoft.Azure.WebJobs.Extensions.DurableTask 1.7.1
Microsoft.Azure.WebJobs.Extensions.Storage 3.0.3
Microsoft.EntityFrameworkCore.SqlServer 2.2.2

When trying to run my durable function via HTTP Starter, I receive the following error:

`System.Private.CoreLib: Exception while executing function: Fn1. Microsoft.Extensions.Logging.Abstractions: Value cannot be null.`

```
public static class Fn1Fn
{
// https://social.msdn.microsoft.com/Forums/en-US/bfb91a1c-5b25-4873-90a3-46da05a97bc0/how-to-create-dynamically-schedule-azure-function-using-c-in-visual-studio?forum=AzureFunctions

// https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-eternal-orchestrations
[FunctionName("Fn1Fn")]
public static async Task Run([OrchestrationTrigger] DurableOrchestrationContext context)
{
await context.CallActivityAsync("Fn1", null);

// sleep for one hour between cleanups
var nextCleanup = context.CurrentUtcDateTime.AddHours(1);
await context.CreateTimer(nextCleanup, CancellationToken.None);

context.ContinueAsNew(null);
}

[FunctionName("Fn1")]
public static async Task Fn1([ActivityTrigger]ILogger log)
{
log.LogInformation($"C# Fn1 function executed at: {DateTime.Now}");

// do amazing long running work
}

[FunctionName("Fn1_HttpStart")]
public static async Task HttpStart(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")]HttpRequestMessage req,
[OrchestrationClient]DurableOrchestrationClient starter,
ILogger log)
{
// Function input comes from the request content.
var instanceId = await starter.StartNewAsync("Fn1Fn", null);

log.LogInformation($"Started orchestration with ID = '{instanceId}'.");

return starter.CreateCheckStatusResponse(req, instanceId);
}
}
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the HTTP-started orchestration using the listed Azure Functions and DurableTask versions. Start with Fn1Fn's CallActivityAsync("Fn1", null) and the Fn1 activity's [ActivityTrigger]ILogger log binding, then determine which input or binding causes the null-value exception. Done means the exception is explained and the reported orchestration path runs successfully or the issue is documented as version-specific.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.