Sarah
Sarah

Reputation: 1293

Azure function-Timer unscheduledInvocationReason

I am trying to diagnose this error when my timer function runs. I have not found much help on this on google search

UnscheduledInvocationReason: IsPastDue, OriginalSchedule: 2019-06-13T15:13:00.0000000-07:00

It seems like the process just stops when this error comes.

Anyone have any insight on this?

Upvotes: 1

Views: 5087

Answers (2)

Ogglas
Ogglas

Reputation: 69968

Update:

For VS2022 I had to clear the folder %userprofile%\AppData\Local\.vstools\Azurite

Source:

https://stackoverflow.com/a/70157089/3850405

Original:

Got this error locally.

enter image description here

[2021-06-16T14:58:22.779Z] Executing 'Functions.TimerTrigger' (Reason='Timer fired at 2021-06-16T16:58:22.7688953+02:00', Id=adbaee54-8a3e-4983-a7e4-a73f69153e5e) [2021-06-16T14:58:22.780Z] Trigger Details: UnscheduledInvocationReason: IsPastDue, OriginalSchedule: 2021-06-16T16:37:00.0000000+02:00 [2021-06-16T14:59:22.614Z] Starting worker process failed [2021-06-16T14:59:22.615Z] The operation has timed out.

Solved by clearing Blob Emulator locally:

delete
  FROM [AzureStorageEmulatorDb510].[dbo].[Blob]

enter image description here

Upvotes: 1

Haitham Shaddad
Haitham Shaddad

Reputation: 4456

The IsPastDue flag is passed to your azure function to indicate if the timer was overdue or not. A timer function can run late in some scenarios like the app service was restarted, in this case it is still invoked but the IsPastDue flag will be set to true to give your function a chance to react.

These links are helpful

Timer trigger for Azure Functions

Also, it seems that it was an issue and it is submitted on github but that was on 2017

TimerTrigger can miss IsPastDue

Upvotes: 1

Related Questions