Exception encountered while listening to EventStream, Microsoft.Azure.WebJobs.Script.Grpc: Object reference not set to an instance of an object.

See original GitHub issue

A function I am upgrading to the new dotnet-isolated model is failing when I run it, and I have narrowed down the code to a service registration by the IdentityModel library.

I have pasted the full output of func host start --verbose below, but the main error seems to be:

Exception encountered while listening to EventStream Microsoft.Azure.WebJobs.Script.Grpc: Object reference not set to an instance of an object.

I appreciate it is difficult to know where the fault may lie, but I can tell you that we use this exact code in an ASP.NET Core applications, various Web Jobs and I have tested myself today by creating a very simple Generic Host Console app and can confirm it works in all cases, but not when I use it in the functions app.

If I comment just these lines, then the error goes away:

            services.AddAccessTokenManagement(options =>
            {
                options.Client.Clients.Add(MessagingClient.ClientId,
                                           new ClientCredentialsTokenRequest
                                           {
                                               Address = tokenUrl,
                                               ClientId = MessagingClient.ClientId,
                                               ClientSecret = clientSecret,
                                               Scope = "messaging"
                                           });
            });

The source code for the AddAccessTokenManagement method is here: https://github.com/IdentityModel/IdentityModel.AspNetCore/blob/3.0.0/src/AccessTokenManagement/TokenManagementServiceCollectionExtensions.cs

Is there anything here that could be conflicting with the Azure Functions service registrations or any obvious reasons this could cause the failure?

My other dependencies resolve fine, and as said, as soon as I comment this out, I no longer get the error. Just to be absolutely sure, I also made a fake implementation of IAccessTokenManagementService and when I register that with DI instead everything is fine, so it seems to be something in the IdentityModel assembly / registration method that is causing the issue.

Azure Functions Core Tools
Core Tools Version:       3.0.3388 Commit hash: fb42a4e0b7fdc85fbd0bcfc8d743ff7d509122ae
Function Runtime Version: 3.0.15371.0

[2021-03-23T19:50:57.401Z] Building host: startup suppressed: 'False', configuration suppressed: 'False', startup operation id: 'acdd21b7-726a-4045-b2a1-424b570fa1b2'
[2021-03-23T19:50:57.418Z] Reading host configuration file '/home/dan/projects/StudyTravel/Network/src/StudyTravel.Network.AzureFunctions/bin/output/host.json'
[2021-03-23T19:50:57.419Z] Host configuration file read:
[2021-03-23T19:50:57.419Z] {
[2021-03-23T19:50:57.419Z]   "version": "2.0",
[2021-03-23T19:50:57.419Z]   "logging": {
[2021-03-23T19:50:57.419Z]     "applicationInsights": {
[2021-03-23T19:50:57.419Z]       "samplingSettings": {
[2021-03-23T19:50:57.419Z]         "isEnabled": true,
[2021-03-23T19:50:57.419Z]         "excludedTypes": "Request"
[2021-03-23T19:50:57.419Z]       }
[2021-03-23T19:50:57.419Z]     }
[2021-03-23T19:50:57.419Z]   }
[2021-03-23T19:50:57.419Z] }
[2021-03-23T19:50:57.431Z] Loading functions metadata
[2021-03-23T19:50:57.444Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:java
[2021-03-23T19:50:57.445Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:powershell
[2021-03-23T19:50:57.446Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:python
[2021-03-23T19:50:57.446Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:node
[2021-03-23T19:50:57.447Z] Reading functions metadata
[2021-03-23T19:50:57.449Z] 0 functions found
[2021-03-23T19:50:57.455Z] 0 functions loaded
[2021-03-23T19:50:57.456Z] Loading extensions from /home/dan/projects/StudyTravel/Network/src/StudyTravel.Network.AzureFunctions/bin/output. BundleConfigured: False, PrecompiledFunctionApp: False, LegacyBundle: False
[2021-03-23T19:50:57.458Z] Loading startup extension 'ServiceBus'
[2021-03-23T19:50:57.513Z] Loaded extension 'ServiceBus' (4.2.1.0)
[2021-03-23T19:50:57.522Z] Loading startup extension 'Startup'
[2021-03-23T19:50:57.522Z] Loaded extension 'Startup' (1.0.0.0)
[2021-03-23T19:50:57.527Z] Reading host configuration file '/home/dan/projects/StudyTravel/Network/src/StudyTravel.Network.AzureFunctions/bin/output/host.json'
[2021-03-23T19:50:57.527Z] Host configuration file read:
[2021-03-23T19:50:57.527Z] {
[2021-03-23T19:50:57.527Z]   "version": "2.0",
[2021-03-23T19:50:57.527Z]   "logging": {
[2021-03-23T19:50:57.527Z]     "applicationInsights": {
[2021-03-23T19:50:57.527Z]       "samplingSettings": {
[2021-03-23T19:50:57.527Z]         "isEnabled": true,
[2021-03-23T19:50:57.527Z]         "excludedTypes": "Request"
[2021-03-23T19:50:57.527Z]       }
[2021-03-23T19:50:57.527Z]     }
[2021-03-23T19:50:57.527Z]   }
[2021-03-23T19:50:57.527Z] }
[2021-03-23T19:50:57.737Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:java
[2021-03-23T19:50:57.737Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:powershell
[2021-03-23T19:50:57.737Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:python
[2021-03-23T19:50:57.737Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:node
[2021-03-23T19:50:57.829Z] Initializing Warmup Extension.
[2021-03-23T19:50:57.863Z] Initializing Host. OperationId: 'acdd21b7-726a-4045-b2a1-424b570fa1b2'.
[2021-03-23T19:50:57.868Z] Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=acdd21b7-726a-4045-b2a1-424b570fa1b2
[2021-03-23T19:50:57.881Z] Loading functions metadata
[2021-03-23T19:50:57.881Z] Reading functions metadata
[2021-03-23T19:50:57.881Z] 0 functions found
[2021-03-23T19:50:57.962Z] 5 functions loaded
[2021-03-23T19:50:57.965Z] LoggerFilterOptions
[2021-03-23T19:50:57.965Z] {
[2021-03-23T19:50:57.965Z]   "MinLevel": "None",
[2021-03-23T19:50:57.965Z]   "Rules": [
[2021-03-23T19:50:57.965Z]     {
[2021-03-23T19:50:57.965Z]       "ProviderName": null,
[2021-03-23T19:50:57.965Z]       "CategoryName": null,
[2021-03-23T19:50:57.965Z]       "LogLevel": null,
[2021-03-23T19:50:57.965Z]       "Filter": "<AddFilter>b__0"
[2021-03-23T19:50:57.965Z]     },
[2021-03-23T19:50:57.965Z]     {
[2021-03-23T19:50:57.965Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-03-23T19:50:57.965Z]       "CategoryName": null,
[2021-03-23T19:50:57.965Z]       "LogLevel": "None",
[2021-03-23T19:50:57.965Z]       "Filter": null
[2021-03-23T19:50:57.965Z]     },
[2021-03-23T19:50:57.965Z]     {
[2021-03-23T19:50:57.965Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-03-23T19:50:57.965Z]       "CategoryName": null,
[2021-03-23T19:50:57.965Z]       "LogLevel": null,
[2021-03-23T19:50:57.965Z]       "Filter": "<AddFilter>b__0"
[2021-03-23T19:50:57.965Z]     },
[2021-03-23T19:50:57.965Z]     {
[2021-03-23T19:50:57.965Z]       "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2021-03-23T19:50:57.965Z]       "CategoryName": null,
[2021-03-23T19:50:57.965Z]       "LogLevel": null,
[2021-03-23T19:50:57.965Z]       "Filter": "<AddFilter>b__0"
[2021-03-23T19:50:57.965Z]     }
[2021-03-23T19:50:57.965Z]   ]
[2021-03-23T19:50:57.965Z] }
[2021-03-23T19:50:57.965Z] LoggerFilterOptions
[2021-03-23T19:50:57.965Z] {
[2021-03-23T19:50:57.965Z]   "MinLevel": "None",
[2021-03-23T19:50:57.965Z]   "Rules": [
[2021-03-23T19:50:57.965Z]     {
[2021-03-23T19:50:57.965Z]       "ProviderName": null,
[2021-03-23T19:50:57.965Z]       "CategoryName": null,
[2021-03-23T19:50:57.965Z]       "LogLevel": null,
[2021-03-23T19:50:57.965Z]       "Filter": "<AddFilter>b__0"
[2021-03-23T19:50:57.966Z]     },
[2021-03-23T19:50:57.966Z]     {
[2021-03-23T19:50:57.966Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-03-23T19:50:57.966Z]       "CategoryName": null,
[2021-03-23T19:50:57.966Z]       "LogLevel": "None",
[2021-03-23T19:50:57.966Z]       "Filter": null
[2021-03-23T19:50:57.966Z]     },
[2021-03-23T19:50:57.966Z]     {
[2021-03-23T19:50:57.966Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2021-03-23T19:50:57.966Z]       "CategoryName": null,
[2021-03-23T19:50:57.966Z]       "LogLevel": null,
[2021-03-23T19:50:57.966Z]       "Filter": "<AddFilter>b__0"
[2021-03-23T19:50:57.966Z]     },
[2021-03-23T19:50:57.966Z]     {
[2021-03-23T19:50:57.966Z]       "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2021-03-23T19:50:57.966Z]       "CategoryName": null,
[2021-03-23T19:50:57.966Z]       "LogLevel": null,
[2021-03-23T19:50:57.966Z]       "Filter": "<AddFilter>b__0"
[2021-03-23T19:50:57.966Z]     }
[2021-03-23T19:50:57.966Z]   ]
[2021-03-23T19:50:57.966Z] }
[2021-03-23T19:50:57.966Z] FunctionResultAggregatorOptions
[2021-03-23T19:50:57.966Z] {
[2021-03-23T19:50:57.966Z]   "BatchSize": 1000,
[2021-03-23T19:50:57.966Z]   "FlushTimeout": "00:00:30",
[2021-03-23T19:50:57.966Z]   "IsEnabled": true
[2021-03-23T19:50:57.966Z] }
[2021-03-23T19:50:57.966Z] SingletonOptions
[2021-03-23T19:50:57.966Z] {
[2021-03-23T19:50:57.966Z]   "LockPeriod": "00:00:15",
[2021-03-23T19:50:57.966Z]   "ListenerLockPeriod": "00:00:15",
[2021-03-23T19:50:57.966Z]   "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[2021-03-23T19:50:57.966Z]   "LockAcquisitionPollingInterval": "00:00:05",
[2021-03-23T19:50:57.966Z]   "ListenerLockRecoveryPollingInterval": "00:01:00"
[2021-03-23T19:50:57.966Z] }
[2021-03-23T19:50:57.966Z] ServiceBusOptions
[2021-03-23T19:50:57.966Z] {
[2021-03-23T19:50:57.966Z]   "PrefetchCount": 0,
[2021-03-23T19:50:57.966Z]   "MessageHandlerOptions": {
[2021-03-23T19:50:57.966Z]     "AutoComplete": true,
[2021-03-23T19:50:57.966Z]     "MaxAutoRenewDuration": "00:05:00",
[2021-03-23T19:50:57.966Z]     "MaxConcurrentCalls": 256
[2021-03-23T19:50:57.966Z]   },
[2021-03-23T19:50:57.966Z]   "SessionHandlerOptions": {
[2021-03-23T19:50:57.967Z]     "AutoComplete": true,
[2021-03-23T19:50:57.967Z]     "MaxAutoRenewDuration": "00:05:00",
[2021-03-23T19:50:57.967Z]     "MaxConcurrentSessions": 2000,
[2021-03-23T19:50:57.967Z]     "MessageWaitTimeout": "00:01:00"
[2021-03-23T19:50:57.967Z]   },
[2021-03-23T19:50:57.967Z]   "BatchOptions": {
[2021-03-23T19:50:57.967Z]     "MaxMessageCount": 1000,
[2021-03-23T19:50:57.967Z]     "OperationTimeout": "00:01:00",
[2021-03-23T19:50:57.967Z]     "AutoComplete": true
[2021-03-23T19:50:57.967Z]   }
[2021-03-23T19:50:57.967Z] }
[2021-03-23T19:50:57.967Z] HttpOptions
[2021-03-23T19:50:57.967Z] {
[2021-03-23T19:50:57.967Z]   "DynamicThrottlesEnabled": false,
[2021-03-23T19:50:57.967Z]   "MaxConcurrentRequests": -1,
[2021-03-23T19:50:57.967Z]   "MaxOutstandingRequests": -1,
[2021-03-23T19:50:57.967Z]   "RoutePrefix": "api"
[2021-03-23T19:50:57.967Z] }
[2021-03-23T19:50:57.968Z] Starting JobHost
[2021-03-23T19:50:57.969Z] Starting Host (HostId=danarchlinux-1335764010, InstanceId=5c325554-9496-4f70-b66e-16e799874eb3, Version=3.0.15371.0, ProcessId=236566, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2021-03-23T19:50:57.978Z] Loading functions metadata
[2021-03-23T19:50:57.979Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:java
[2021-03-23T19:50:57.979Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:powershell
[2021-03-23T19:50:57.979Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:python
[2021-03-23T19:50:57.979Z] FUNCTIONS_WORKER_RUNTIME set to dotnet-isolated. Skipping WorkerConfig for language:node
[2021-03-23T19:50:57.979Z] Reading functions metadata
[2021-03-23T19:50:57.980Z] 0 functions found
[2021-03-23T19:50:57.985Z] 5 functions loaded
[2021-03-23T19:50:58.023Z] Generating 5 job function(s)
[2021-03-23T19:50:58.070Z] Found the following functions:
[2021-03-23T19:50:58.070Z] Host.Functions.MyFunction
[2021-03-23T19:50:58.070Z] Host.Functions.SendDailySummaryNotificationEmail
[2021-03-23T19:50:58.070Z] Host.Functions.SendMonthlySummaryNotificationEmail
[2021-03-23T19:50:58.070Z] Host.Functions.SendSummaryNotificationEmail
[2021-03-23T19:50:58.070Z] Host.Functions.SendWeeklySummaryNotificationEmail
[2021-03-23T19:50:58.070Z]
[2021-03-23T19:50:58.091Z] Initializing function HTTP routes
[2021-03-23T19:50:58.091Z] No HTTP routes mapped
[2021-03-23T19:50:58.091Z]
[2021-03-23T19:50:58.096Z] Host initialized (121ms)

Functions:

        MyFunction: TimerTrigger

        SendDailySummaryNotificationEmail: TimerTrigger

        SendMonthlySummaryNotificationEmail: TimerTrigger

        SendSummaryNotificationEmail: ServiceBusTrigger

        SendWeeklySummaryNotificationEmail: TimerTrigger

[2021-03-23T19:50:58.189Z] Exception encountered while listening to EventStream
[2021-03-23T19:50:58.189Z] Microsoft.Azure.WebJobs.Script.Grpc: Object reference not set to an instance of an object.
[2021-03-23T19:50:58.716Z] The next 5 occurrences of the 'SendMonthlySummaryNotificationEmail' schedule (Cron: '0 0 0 1 * *') will be:
[2021-03-23T19:50:58.716Z] 04/01/2021 00:00:00+01:00 (03/31/2021 23:00:00Z)
[2021-03-23T19:50:58.716Z] 05/01/2021 00:00:00+01:00 (04/30/2021 23:00:00Z)
[2021-03-23T19:50:58.716Z] 06/01/2021 00:00:00+01:00 (05/31/2021 23:00:00Z)
[2021-03-23T19:50:58.716Z] 07/01/2021 00:00:00+01:00 (06/30/2021 23:00:00Z)
[2021-03-23T19:50:58.716Z] 08/01/2021 00:00:00+01:00 (07/31/2021 23:00:00Z)
[2021-03-23T19:50:58.716Z]
[2021-03-23T19:50:58.729Z] The next 5 occurrences of the 'MyFunction' schedule (Cron: '0 0,30 * * * *') will be:
[2021-03-23T19:50:58.729Z] 03/23/2021 20:00:00+00:00 (03/23/2021 20:00:00Z)
[2021-03-23T19:50:58.729Z] 03/23/2021 20:30:00+00:00 (03/23/2021 20:30:00Z)
[2021-03-23T19:50:58.729Z] 03/23/2021 21:00:00+00:00 (03/23/2021 21:00:00Z)
[2021-03-23T19:50:58.729Z] 03/23/2021 21:30:00+00:00 (03/23/2021 21:30:00Z)
[2021-03-23T19:50:58.729Z] 03/23/2021 22:00:00+00:00 (03/23/2021 22:00:00Z)
[2021-03-23T19:50:58.729Z]
[2021-03-23T19:50:58.757Z] Executing 'Functions.SendWeeklySummaryNotificationEmail' (Reason='Timer fired at 2021-03-23T19:50:58.7246640+00:00', Id=948a860e-aae2-4cec-a642-9dca729d5e1f)
[2021-03-23T19:50:58.757Z] Executing 'Functions.SendDailySummaryNotificationEmail' (Reason='Timer fired at 2021-03-23T19:50:58.7246619+00:00', Id=56f41691-7528-4533-9b58-955127b5eaf4)
[2021-03-23T19:50:58.757Z] Trigger Details: UnscheduledInvocationReason: RunOnStartup
[2021-03-23T19:50:58.757Z] Trigger Details: UnscheduledInvocationReason: RunOnStartup
[2021-03-23T19:51:58.025Z] Starting worker process failed
[2021-03-23T19:51:58.025Z] The operation has timed out.
[2021-03-23T19:51:58.656Z] Exception encountered while listening to EventStream
[2021-03-23T19:51:58.656Z] Microsoft.Azure.WebJobs.Script.Grpc: Object reference not set to an instance of an object.
[2021-03-23T19:51:58.940Z] Exceeded language worker restart retry count for runtime:dotnet-isolated. Shutting down and proactively recycling the Functions Host to recover
[2021-03-23T19:55:14.786Z] Final functionDispatcher state: WorkerProcessRestarting. Initialization timed out and host is shutting down
[2021-03-23T19:55:14.786Z] Final functionDispatcher state: WorkerProcessRestarting. Initialization timed out and host is shutting down
[2021-03-23T19:55:14.807Z] Executed 'Functions.SendDailySummaryNotificationEmail' (Failed, Id=56f41691-7528-4533-9b58-955127b5eaf4, Duration=256074ms)
[2021-03-23T19:55:14.807Z] System.Private.CoreLib: Exception while executing function: Functions.SendDailySummaryNotificationEmail. Microsoft.Azure.WebJobs.Script: Did not find any initialized language workers.
[2021-03-23T19:55:14.807Z] Executed 'Functions.SendWeeklySummaryNotificationEmail' (Failed, Id=948a860e-aae2-4cec-a642-9dca729d5e1f, Duration=256074ms)
[2021-03-23T19:55:14.807Z] System.Private.CoreLib: Exception while executing function: Functions.SendWeeklySummaryNotificationEmail. Microsoft.Azure.WebJobs.Script: Did not find any initialized language workers.
[2021-03-23T19:55:14.910Z] The next 5 occurrences of the 'SendDailySummaryNotificationEmail' schedule (Cron: '0 0 0 * * *') will be:
[2021-03-23T19:55:14.910Z] 03/24/2021 00:00:00+00:00 (03/24/2021 00:00:00Z)
[2021-03-23T19:55:14.910Z] 03/25/2021 00:00:00+00:00 (03/25/2021 00:00:00Z)
[2021-03-23T19:55:14.910Z] 03/26/2021 00:00:00+00:00 (03/26/2021 00:00:00Z)
[2021-03-23T19:55:14.910Z] 03/27/2021 00:00:00+00:00 (03/27/2021 00:00:00Z)
[2021-03-23T19:55:14.910Z] 03/28/2021 00:00:00+00:00 (03/28/2021 00:00:00Z)
[2021-03-23T19:55:14.910Z]
[2021-03-23T19:55:14.916Z] The next 5 occurrences of the 'SendWeeklySummaryNotificationEmail' schedule (Cron: '0 0 0 * * 0') will be:
[2021-03-23T19:55:14.916Z] 03/28/2021 00:00:00+00:00 (03/28/2021 00:00:00Z)
[2021-03-23T19:55:14.916Z] 04/04/2021 00:00:00+01:00 (04/03/2021 23:00:00Z)
[2021-03-23T19:55:14.916Z] 04/11/2021 00:00:00+01:00 (04/10/2021 23:00:00Z)
[2021-03-23T19:55:14.916Z] 04/18/2021 00:00:00+01:00 (04/17/2021 23:00:00Z)
[2021-03-23T19:55:14.916Z] 04/25/2021 00:00:00+01:00 (04/24/2021 23:00:00Z)
[2021-03-23T19:55:14.916Z]
[2021-03-23T19:55:14.919Z] Host started (256948ms)
[2021-03-23T19:55:14.919Z] Job host started
[2021-03-23T19:55:14.923Z] Unhandled exception. System.InvalidOperationException: Can't write the message because the previous write is in progress.
[2021-03-23T19:55:14.923Z]    at Microsoft.Azure.Functions.Worker.GrpcWorker.SendStartStreamMessageAsync(IClientStreamWriter`1 requestStream) in D:\a\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 86
[2021-03-23T19:55:14.923Z]    at Microsoft.Azure.Functions.Worker.WorkerHostedService.StartAsync(CancellationToken cancellationToken) in D:\a\1\s\src\DotNetWorker.Core\WorkerHostedService.cs:line 25
[2021-03-23T19:55:14.923Z]    at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
[2021-03-23T19:55:14.923Z]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
[2021-03-23T19:55:14.923Z]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
[2021-03-23T19:55:14.923Z]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
[2021-03-23T19:55:14.923Z]    at StudyTravel.Network.AzureFunctions.Program.Main() in /home/dan/projects/StudyTravel/Network/src/StudyTravel.Network.AzureFunctions/Program.cs:line 37
[2021-03-23T19:55:14.923Z] Unhandled exception. Grpc.Core.RpcException: Status(StatusCode="Cancelled", Detail="")
[2021-03-23T19:55:14.923Z]    at Grpc.Net.Client.Internal.HttpContentClientStreamWriter`2.WriteAsyncCore(TRequest message)
[2021-03-23T19:55:14.923Z]    at Microsoft.Azure.Functions.Worker.GrpcWorker.SendStartStreamMessageAsync(IClientStreamWriter`1 requestStream) in D:\a\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 86
[2021-03-23T19:55:14.923Z]    at Microsoft.Azure.Functions.Worker.WorkerHostedService.StartAsync(CancellationToken cancellationToken) in D:\a\1\s\src\DotNetWorker.Core\WorkerHostedService.cs:line 25
[2021-03-23T19:55:14.923Z]    at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
[2021-03-23T19:55:14.923Z]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
[2021-03-23T19:55:14.923Z]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
[2021-03-23T19:55:14.923Z]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
[2021-03-23T19:55:14.924Z]    at StudyTravel.Network.AzureFunctions.Program.Main() in /home/dan/projects/StudyTravel/Network/src/StudyTravel.Network.AzureFunctions/Program.cs:line 37
[2021-03-23T19:55:14.946Z] Stopping host...
[2021-03-23T19:55:14.952Z] Stopping JobHost
[2021-03-23T19:55:14.954Z] Stopping the listener 'Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener' for function 'MyFunction'
[2021-03-23T19:55:14.959Z] Stopping the listener 'Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener' for function 'SendDailySummaryNotificationEmail'
[2021-03-23T19:55:14.959Z] Stopping the listener 'Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener' for function 'SendMonthlySummaryNotificationEmail'
[2021-03-23T19:55:14.959Z] Stopping the listener 'Microsoft.Azure.WebJobs.ServiceBus.Listeners.ServiceBusListener' for function 'SendSummaryNotificationEmail'
[2021-03-23T19:55:14.962Z] Stopping the listener 'Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener' for function 'SendWeeklySummaryNotificationEmail'
[2021-03-23T19:55:15.033Z] Stopped the listener 'Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener' for function 'MyFunction'
[2021-03-23T19:55:15.033Z] Stopped the listener 'Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener' for function 'SendDailySummaryNotificationEmail'
[2021-03-23T19:55:15.033Z] Stopped the listener 'Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener' for function 'SendMonthlySummaryNotificationEmail'
[2021-03-23T19:55:15.034Z] Stopped the listener 'Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener' for function 'SendWeeklySummaryNotificationEmail'
[2021-03-23T19:55:19.940Z] Host did not shutdown within its allotted time.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
djjlewiscommented, May 17, 2021

I saw PR #445 come through which mentioned a fix to the ordering of GRPC steam registrations and thought that sounded promising for this isse! I cloned the latest main branch and pointed my project to the local version and sure enough it looks to have fixed the issue.

Any idea when the next official release will drop with that PR included @fabiocav? 🙏

0reactions
MarcAnnouscommented, Apr 18, 2021

Also happening to me when I configure authentication:

services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme);

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft.Azure.WebJobs.Script.Grpc: Object reference not ...
WebJobs.Script.Grpc: Object reference not set to an instance of an object #359 ... Exception encountered while listening to EventStream
Read more >
Object reference not set to an instance of an object at ...
I have several Azure functions running in a single Azure function app. Periodically, the function app suddenly stops and does not restart.
Read more >
`Object reference not set to an instance of an ...
Function running the queue trigger after passing message to the queue and getting exception while sending it to the Azure Table within the ......
Read more >
Microsoft.Azure.WebJobs.Extensions.EventGrid: Object ...
WebJobs.Extensions.EventGrid: Object reference not set to an instance of an object." Tried to restart the app service, republish the same code .
Read more >
Untitled
Web12 Aug 2020 · Connect and share knowledge within a single location that is ... Azure.WebJobs.Script.Grpc: Object reference not set to an instance...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found