Quartz.NET Job Scheduler Error: Failure occurred during job recovery
So, I was trying to hook up Quartz.NET with a Windows Service to provide a scheduled job that would execute on a daily trigger. I am using SQL Server as the persistence store for the jobs and triggers created by quartz.
I deployed and tested it on my local box and everything was working great until I moved it over to the QA box. I installed the service, no errors or warnings. But when I went to start the service, I got an error “The service did not respond in a timely fashion” and the service would not start. Fortuantely for me I had verbose logging turned on and noticed the following error in the log:
Failure occured during job recovery
Stack Trace: at Quartz.Impl.AdoJobStore.JobStoreSupport.SchedulerStarted()
I looked at the quartz source to see what was going on. The code that throws the error is below:
public virtual void SchedulerStarted()
clusterManagementThread = new ClusterManager(this);
catch (SchedulerException se)
throw new SchedulerConfigException(“Failure occured during job recovery.”, se);
misfireHandler = new MisfireHandler(this);
schedulerRunning = true;
That sent me down the path to see what was the difference between my local database and the one in the QA environment. Long story short, it was basically that the “QRTZ_LOCKS” table was missing data . Corrected that and everything works fine now.
INSERT INTO [dbo].[QRTZ_LOCKS] VALUES(‘TRIGGER_ACCESS’);
INSERT INTO [dbo].[QRTZ_LOCKS] VALUES(‘JOB_ACCESS’);
INSERT INTO [dbo].[QRTZ_LOCKS] VALUES(‘CALENDAR_ACCESS’);
INSERT INTO [dbo].[QRTZ_LOCKS] VALUES(‘STATE_ACCESS’);
INSERT INTO [dbo].[QRTZ_LOCKS] VALUES(‘MISFIRE_ACCESS’);
So, in case you come across this issue:
1. Look at the connection string and make sure that whether using SQL Server or Windows Authentication, the user has read/write access to the quartz tables
2. Second, make sure you have populated all the necessary data in the Quartz tables.