azure-webjobs-sdk: Function failed indexing and will be disabled

Since the update to version 2.0.12050.0 of Azure Functions Apps, two of my functions are not indexed anymore. Unfortunately, the logging is not verbose enough to understand why the functions are not indexed.

Investigative information

  • Function App version (1.0 or 2.0-beta): 2.0.12050.0
  • Invocation ID: a51831a8-50f3-4139-bdfe-7d770c3ea75e (a previous one since the function isn’t available because of an indexing error)
  • Region: France Central

Repro steps

Start my Function App

Expected behavior

My function app starts properly with all functions are indexed or I have enough information (startup logs) to understand why some functions are not indexed.

Actual behavior

My function app starts but two functions are not indexed and the logs are not providing enough information to understand why it’s not indexed:

2018-09-04T22:49:52.754 [Information] Starting Host (HostId=cpglane-ical, InstanceId=919b8d9d-834c-4717-9c4a-31465f335b87, Version=2.0.12050.0, ProcessId=8896, AppDomainId=1, Debug=True, FunctionsExtensionVersion=beta)
2018-09-04T22:49:52.757 [Information] Initializing Azure Function proxies
2018-09-04T22:49:50.267 [Information] Stopping JobHost
2018-09-04T22:49:53.797 [Information] Generating 4 job function(s)
2018-09-04T22:49:53.808 [Error] Error indexing method 'App.ManualUpdateCalendars'
2018-09-04T22:49:53.848 [Warning] Function 'App.ManualUpdateCalendars' failed indexing and will be disabled.
2018-09-04T22:49:53.848 [Error] Error indexing method 'App.ScheduledUpdateCalendars'
2018-09-04T22:49:53.865 [Warning] Function 'App.ScheduledUpdateCalendars' failed indexing and will be disabled.

Known workarounds

None

Related information

After looking at the source code responsible for logging the error, it’s clear that the FunctionIndexingException’s inner exception should also be logged for us to have a chance to understand the root cause of the indexing error.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 17 (1 by maintainers)

Most upvoted comments

We were using Boris Willhelms DI and solved the issue with following the solution in https://github.com/Azure/azure-functions-host/issues/3386#issuecomment-419565714

It has also been documented in the readme of Boris Willhelms DI repo.

I’m running a lot of functions using ~2 and my latest one has hit this. All the other functions have been fine. Everything I’ve tweaked hasn’t worked. It would certainly be nice to have more information to work with to get through this issue.

Edit: My issue was that particular function was failing to start because a startup extension was throwing an exception. I agree with the OP, this would have been far easier to debug if the exception was logged.

The problem might be because of your Connection String. Please Add the ConnectionString in LocalSetting to the key: AzureWebJobsStorage, And from the Actual Azure function params Connection ref to the above Key.

This resolved my Issue.

Im having the same issue, it does work in two projects with ServiceBusTriggers but for my HttpTrigger project it failes.

Im able to reproduse the problem using the nuget package from this article https://blog.wille-zone.de/post/dependency-injection-for-azure-functions/. In a clean project, and a new clean Azure function on server. Works localy, breaks when pushed to Azure.

namespace FunctionApp3
{
    public static class Function1
    {
        [FunctionName("Function1")]
        public static IActionResult Run(
            [HttpTrigger(AuthorizationLevel.Function, "get")]HttpRequest req,
            [Inject]ITransientGreeter transientGreeter1,
            [Inject]ITransientGreeter transientGreeter2,
            [Inject]IScopedGreeter scopedGreeter1,
            [Inject]IScopedGreeter scopedGreeter2,
            [Inject]ISingletonGreeter singletonGreeter1,
            [Inject]ISingletonGreeter singletonGreeter2,
            ILogger logger)

        {
            logger.LogInformation("C# HTTP trigger function processed a request.");

            var result = String.Join(Environment.NewLine, new[] {
                $"Transient: {transientGreeter1.Greet()}",
                $"Transient: {transientGreeter2.Greet()}",
                $"Scoped: {scopedGreeter1.Greet()}",
                $"Scoped: {scopedGreeter2.Greet()}",
                $"Singleton: {singletonGreeter1.Greet()}",
                $"Singleton: {singletonGreeter2.Greet()}"
            });
            return new OkObjectResult(result);
        }
    }
}

2018-10-03T13:47:46.443 [Error] Error indexing method 'Function1.Run' 2018-10-03T13:47:46.720 [Warning] Function 'Function1.Run' failed indexing and will be disabled.