Why does Sitecron initialization sometimes fail?

2018-02-23 07:05:01

We are seeing an issue in multiple environments where Sitecron sometimes fails to initialize. In the log files, we see the following:

4072 16:16:03 INFO Initialize Sitecron

4072 16:16:10 ERROR Sitecron ERROR: Object reference not set to an instance of an object.

Unfortunately, Sitecron does not log a full stack trace, so it is difficult to know what is going wrong. Looking at the code, I can see that this must happen before it attempts to load job definition items from Sitecore. Otherwise, I would see additional messages in the log. Currently, it seems to me that either the call to StdSchedulerFactory.GetDefaultScheduler() is returning null or the exception is being thrown within that call.

What could be causing this intermittent error?