I am also getting this error. It started happening after daylight saving time Sunday morning. The log files are reporting the following error (The max retry attempts is worrisome):
2016-03-14 17:00:00,490 ERROR Hangfire.Server.RecurringJobScheduler Error occurred during execution of ‘Recurring Job Scheduler’ component. Execution will be retried (attempt 12 of 2147483647) in 00:02:18 seconds.
System.ArgumentException: Only DateTime values in UTC should be passed.
Parameter name: lastInstant
As you can see in image, the job is scheduled to be run between 8 PM to 8 AM (customer requirement is run the jobs only during night time). But still it ran 11 mins ago and next execution is in 19 mins.
Cron expression used for configuration: */30 20-8 * * *
Note: I have considered UTC timing and this snapshot is taken accordingly.
My recurring job has the cron 0 9 * * *. When I hover this expression in the Recurring jobs list it pops up with At 09:00 AM.
The Next execution column says in 17 hours and if I hover that I get Sat, Dec 24, 2016 3:00 AM.
Here are the exact property settings from the HangFire.Hash table for the job in question:
Job {“Type”:"dqsn.ETL.PartMaterialEtl, Dqsn, …}
Cron 0 9 * * *
TimeZoneId UTC
Queue default
CreatedAt 2016-12-23T16:01:26.2706144Z
NextExecution 2016-12-24T09:00:00.0000000Z
My expectation is that the Next execution time will match the cron.
Is this a bug in the Recurring jobs view or do I misunderstand how it is intended to work?
I found the answer to my own question since posting this. The job was created with the default time zone of UTC. I changed it to TimeZone.Local and now the Next execution shows the expected time of day.