Timer trigger intermittently skips firing: UnscheduledInvocationReason: IsPastDue

KevinFichter-7362 1 Reputation point
2022-12-27T18:51:52.83+00:00

I have an Azure Function with two timer triggers and one EventGrid trigger. Periodically, all triggers will just not fire until I go into the Azure Portal and navigate around (no need to manually trigger or click refresh/sync.) Once I view the function in the Portal, the triggers start to work again (timer and EventGrid).

Focusing on the timer trigger, which should run every 30 minutes, I see that it ran just fine up until 14:45 UTC. Then all triggers were skipped/missed for the next few hours until I went into the portal at approx 17:30. At that point, the timer trigger fires, and the logs show:

Trigger Details: UnscheduledInvocationReason: IsPastDue, OriginalSchedule: 2022-12-27T15:15:00.0000000+00:00  

The function will run fine for weeks, but then the above behavior happens. In the interim, the code is not changed, no deployments are happening; nothing is changing from a developer perspective to explain the sudden stoppage.

Details:

  • Consumption Plan on Linux, Runtime v4.14.0.0
  • WEBSITE_TIME_ZONE is not set (not supported on Linux anyway). I did have this set to etc/UTC, but it's ignored on Linux apps.
  • CRON expression: "0 15,45 13-21 * * 1-5"
  • I expected it to run at 15:15 on a Tuesday (prior successful execution was at 14:45 that day)
  • The first past-due invocation id: Timer fired at 2022-12-27T17:30:27.4798501+00:00', Id=e92aa0f6-4107-479f-86d1-a721b7a504b8
  • The preceding successful, regularly-scheduled, invocation: Timer fired at 2022-12-27T14:45:00.0013415+00:00', Id=b9e60523-b08a-42e7-84a4-60c11cd2057d
  • Missed invocations: 2022-12-27 @ 15:15, 15:45, 16:15, 16:45, 17:15

I've seen the answer from MSFT where another user had the same problem. But the guidance there is just to disable schedule monitoring (ie, ignore the problem?), which doesn't address the issue of the schedule intermittently not being followed.

I've also reviewed the troubleshooting guidance, and I am not seeing anything in the metrics to show heavy resource utilization. All use of async is non-blocking and is proper async end-to-end.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-12-28T04:04:09.233+00:00

    Hi @KevinFichter-7362 ,

    It appears that you have done quite some research before reaching out to this forum. You have already checked a lot of details, only step that is missing is to check if the Function host was down due to some reason between 14:45 and 17:30 UTC. I would suggest you check the Traces logs in the Application insights logs section to see if there are any issues related to function host. The timer trigger would be pastdue if the scheduled invocation was missed due to a reason which is mostly the function host being down or restarted. So please check the traces logs to get more insights.

    274483-image.png

    Feel free to reach out to me if you have any queries or concerns.

    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.