Azure Function keeps restarting with gprc worker error

Dario Dalla Riva 30 Reputation points
2023-04-21T09:45:50.52+00:00

I have a very simple Azure Function like i've created a thousand, with an httptrigger. The function is a .net 7 isolated function. Intermittently i'm receiving 502 bad gateway errors when calling the function with no apparent reason. After investigating i found out that the function is constantly restarting. by clicking the new support request in the portal blade for the function the automated checks are saying that the error is this one:

Inner Exception Type: System.TimeoutException Total Occurrences: 3 Latest Exception Message: Initializing worker process failed The operation has timed out.
Full Exception : System.TimeoutException : The operation has timed out. at Microsoft.Azure.WebJobs.Script.Grpc.GrpcWorkerChannel.PendingItem.OnTimeout() at /_/src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs : 1455

Unfortunately this does not seem to depend on my code so i really don't know where to start. I tried restarting and redeploying the function as the automated suggestions told me to do but to no avail. i've tried downgrading the

Microsoft.Azure.Functions.Worker

Full Exception : System.TimeoutException : The operation has timed out. at Microsoft.Azure.WebJobs.Script.Grpc.GrpcWorkerChannel.PendingItem.OnTimeout() at /_/src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs : 1455 Unfortunately this does not seem to depend on my code so i really don't know where to start. I tried restarting and redeploying the function as the automated suggestions told me to do but to no avail. i've tried downgrading the Microsoft.Azure.Functions.Worker package to a version i'm using in other functions that are working correctly but nothing changed. I haven't found anything useful by googling and i don't have a paid support plan. Does anyone ever faced something like this? I'm also wondering why there's a grpc worken when i'm not using grpc?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,933 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Dario Dalla Riva 30 Reputation points
    2023-05-15T07:15:38.3966667+00:00

    So i've been in contact with Microsoft support, and they confirmed it to be an issue of a new version of the runtime.

    They had me mitigate the problem by pinning the runtime version to 4.16, and after a few days of testing i can confirm it works.

    However i did not get an answer till now about how and where to check when the issue will be resolved to pin back the runtime to the latest version.

    @Lohith Goudagere Nagaraj i've been using a consumption plan and deploying it using Azure pipelines, as i've done with every other Azure Function app i made in the last couple of years.

    3 people found this answer helpful.

  2. Hochgurtel, Brian D 20 Reputation points
    2024-06-04T17:36:19.7366667+00:00

    I was getting this error because my http_proxy / https_proxy environment variables were not set correctly. Once I removed those env values, my func start command started to work correctly.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.