Cron Schedules not firing

Product: PowerShell Universal
Version: 1.5.16
IIS 10
Server 2016

I tried scheduling jobs daily, weekly, and monthly using cron expressions with no luck. Example “0 0 12 27 1/1 ? *”

Typically, this happens in IIS due to app pool recycling. Can you verify you’ve set these settings: IIS - PowerShell Universal

Yes the suggested settings are set. Scheduled jobs like continuous and one time work. It looks like it’s only happening when I use a cron expression.

When you schedule the jobs, does it show the next run time?

Also, can you check event viewer to see if the app pool is recycling for any reason? You can search for WAS events.

No it doesn’t.

Ah, ok. Then that’s an issue. Can you send a screenshot of the schedules page in your admin console?

I checked for any WAS events. None coming up.

1 Like

When I try to use that CRON expression, I see this error in the logs: Failed to schedule job. CRON expression is invalid. Please see the inner exception for details. (Parameter ‘cronExpression’) Wrong number of parts in the 0 0 12 27 1/1 ? * cron expression, you can only use 5 or 6 (with seconds) part-based expressions.

So is that a bug? I checked the expression on a couple of sites and it said it was valid.

We use hangfire for scheduling and I found a couple of open issues around this. There are some workarounds but it seems like hangfire doesn’t support this format directly. I’ll have to do some research into how to get what you are expecting to work since it doesn’t look like hangfire is going to fix this anytime soon. These issues have been open for some time.

1 Like

Ok. Thanks for the info. Will figure out how to dumb down the expression .