Scheduler job not running automatically

Vote:
 

Scheduler Job - When clicked [Start Manually] works fine based on the functionality. The same job throws exception [Exception has been thrown by the target of an invocation. [Object reference not set to an instance of an object.]] when it is invoked automatically based on the frequency settings. Moreover we are not able to attach the debug process on the automatic mode. Other EPIServer Scheduler Jobs are working fine on the automatic mode.

#23415
Sep 05, 2008 7:30
Vote:
 

A common misstake is the use of HttpContext in schduled jobs. Another is trying the fetch pages that the scheduler doen't have access to.

#23418
Sep 05, 2008 9:26
Vote:
 
Scheduler Job (automatic mode) throws exception, even when we run a simple code which returns a string, but works fine in [Start Manually] mode. Is there any specific configuration settings to be applied.
#23432
Sep 05, 2008 12:50
Vote:
 

We had issues with scheduler when run under the auto and manual modes.  In auto mode, it runs as an anonymous user, whereas when run manually, it runs as the person who started the process.  We found that even things like date formatting were going askew between the two and so any downstream processinng did not get valid data and threw exceptions.  

Only piece of advice I can give is step through the code. Sorry.

 

 

#23518
Sep 08, 2008 17:26
Vote:
 
Scheduler Job (automatic mode) throws exception, even when we run a simple code which returns a string, but works fine in [Start Manually] mode. As there is no page access, this should even work with anonymous user (automatic mode). Is there any specific configuration settings to be applied.
#23541
Sep 09, 2008 8:33
Vote:
 

Hi, as add on to the issue description. (Working same team as Santosh). We observe that sample job given by EPiServer (such as EPiServer.SubscriptionJob) is running normal and successful in the scheduler while our customize job will throw error "Object reference not set to an instance of an object" or "Exception been thrown by the target of invocation". Will that due to some environment setting that need to be done before running a job? Or is it any rights issue? Sort of can't figure it out since even in debugger mode the code is not being executed.

Thanks.

#23552
Sep 09, 2008 13:39
Vote:
 

Hi

There is no configuration that needs to be done to get the scheduled jobs to run. There must be something in the code that is causing the NullReferenceException.

Santosh, you said you had a simple job that caused the error. Could you perhaps post the code so we can take a look at it. Hopefully that can give us some clues as to why the error is occuring.

Regards

Per Gunsarfs
EPiServer CMS Development Team

#23553
Sep 09, 2008 14:23
Vote:
 

I too faced the same problem some time back to execute a simple job like just displaying a string. It was running mannually all the time , and for the scheduled time throwing error as above. But when I left the job running for a long time, surprisingly for some times I found it was sucess full when I checked in the history tab. I am not able to figure out the reasons why it was failed and why some times it was successfull. Some times I am able to debug also. Some times not at all coming in to the code. Running some where outside and throwing error as "Object reference not set to an instance of an object".

Can any body give me correct reason for this. So that it would be very much help ful for me.

#23678
Sep 12, 2008 14:26