Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

EPiServer Custom Scheduled Job is not triggering at the specified time

Hi , We have a custom scheduled Job, We are using this to Index content which is used for EPiServer Find. When We start the Job Manually it is running succesfully, if we Scheduled the Job, the Job is not running. And sometimes the Job is running but stopping abruptly after running about an hour. The Job needs to run for 1.30 hour to completly Indexing the Content used for EPiServer Find. I checked the Services,it says EPiServe Scheduler is started and type is automatic only. Please tell me what is the reason . Thanks in advance.
May 31, 2013 9:11

If you have your own scheduled job then you need to provide a lot more information about the error. Have you got any logs?

May 31, 2013 9:16

How is your IIS apppool configured for recycling? Could it be that you either hit a configured recycle time or that the application exceed a memory threshold for recycling?

May 31, 2013 9:25
Hi Johan I'm new to EpiServer , Can you please tell me how to check the Apppool Recycle time. And how to Increase it. Thanks
May 31, 2013 15:58

Recycling of app pool is an IIS feature and nothing special for EPiServer. You can configure it in IIS Manager if you select your app pool and choose Recycling from the Actions menu.

May 31, 2013 16:03
Hi Johan I checked the App pool and in App pool it specified as follows : Shut Down Worker Process after being idle for : 20 Minutes. My doubt is the Indexing Job is started with a seperate thread , when the indexing Job is running for 20 Mins . Is this is really stopping the Scheduled job . I have started the Scheduled Job by using a seperate thread , and I found that the Scheduled Job stopped after 20 Minutes. Please confirm me once. Thanks
May 31, 2013 16:34
Thanks alot Johan. I tried to increase the worker process idle time, now the Job is running without any problems when I start manually. But, the problem is If We scheduled the Job it is not triggered at the specefied time , it is giving an error message as "Object reference not set to an inctance of an object" .Not able to finds why this error is coming and I have enabled the EPiServer Log level to Error also and nothing is logged in EPiSrver Log file. Please help us why we are getting this error only when we scheduled the Job. Thanks.
Edited, Jun 02, 2013 13:17

You may get NullReferenceException if you are trying to use current HTTP context in the job code when the job is triggered automatically. In this case there is no HTTP context and things like HttpContext.Current.User or HttpContext.Current.Server.MapPath() will throw exception.

Jun 02, 2013 14:48
Thanks for your reply Dmytro. We are not using any code like HttpConetxt.Current.User or HttpContext.Current.Server.MapPath(). And just before I tried to Schedule the Job by logging in to EPiServer CMS and the Job is triggered and succefully completed, I gave another try immediately after 10 minutes and again the Job is running now. We have specified AppPool Configuration as : Shut down worker process after beingh Idle for : 120 Minutes. Is this is any way causing the problem ? And Is there any problem if I set this time limit for some more time like 5 hours or 0 ? Thanks.
Jun 02, 2013 15:25

The shutdown of the worker process of being idle can be a problem.

Since the job is running in a background thread IIS will not be able to detect that the site is actually working. So if there is no other "ordinary" request at the same time IIS may take down the process. Then the soultion is to remove the app cycle recycling for idle time.

Jun 03, 2013 9:54
Thanks a million Johan.I tried by changing the time limit ,and the scheduled Job istriggered and succesully completed the Job. One last doubt : Is there any performance issue if we remove the apppool reclying time limit ? Thanks again.
Jun 03, 2013 10:49

The typical reason for having recycling configured is to get a new "fresh" process and release all hold memory. For an EPiServer site memory allocation should typically not be a problem since most things that are stored are not "hard" rooted (like e.g. in static dictionary or similar) but instead the ASP.NET cache is used. The ASP.NET cache works so that if the process needs more memory if can evict items from the cache.

If you still want to have recycling configured you could instead configure it to run at a specific time (where you should choose a time that is not conflicting with where you have scheduled your job to run).

Jun 03, 2013 10:58
Thanks Johan for your quick reply and help.
Jun 03, 2013 11:14
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.