Why my timer job is not running?

I have a server farm configuration with 2 web server, 1 app servers and 1 database server.

What i am trying to do from timer job is to loop through all web applications present in the server farm and perform some action against some web-applications.

I have timer job which is provisioned with Central admin web application and locktype as ContentDatabse passed as parameter, and i have scheduled this job to run every  2 minutes. This timer job is provisioned by a feature which has a farm scope.
Central admin site is hosted on web servers but not on app server.

My timer job never runs.

In Central admin, i see job is scheduled to be run from 2 web servers but not from app server.

In SharePoint app server log i see, one interesting log which says "Job definition TestJob, id 779b3ccf-df47-4c4d-aaea-7b3ae2f6502a has no online instance for service Microsoft.SharePoint.Administration.SPWebService, id db200214-6eb2-4696-bb3b-53cb12119650, ignoring"

If i stop the SharePoint timer service running in the app servers my timer job runs, after my job has run once, if i start the timer service in app server, my job runs every 2 minutes as expected. From this blog i have came to know that "So, the first thing is that for a particular server to be eligible to run the job, it must be provisioned with the service or web app associated with the job." And my app servers does not host the web applications.

My questions is.

1. Why is my timer job is trying to run from the app servers?

2. If i pass a web server while provisioning timer job is that correct? I think timer job becomes tied to particular server and removing/ taking it down may make the timer job not to run.

My questions is.

1. Why is my timer job is trying to run from the app servers?

2. If i pass a web server while provisioning timer job is that correct? I think timer job becomes tied to particular server and removing/ taking it down may make the timer job not to run.

December 30th, 2014 7:13am

 Try to deploy the Timer job from Web Front end not Application server. And try to Activate from there only . 
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2015 7:13am

Hi Pradipta,

As feature is farm scope feature and deployed as part of wsp package from central admin web application. i dont go to manually activate this feature.


May 15th, 2015 3:09am

Hi 

By default Timer Jobs will only execute on the server that they are called from (typically the Central Administration server)

https://www.martinhatch.com/2009/08/sharepoint-timer-jobs-and-multiple.html

http://nikpatel.net/2012/02/24/deactivate-sharepoint-foundation-web-application-service-on-central-admin-or-deploy-custom-solutions-from-central-admin/

and if possible can you share Timer job constructor code.

and make sure SharePoint Foundation Web Application Service  is running on app server when you are activating feature.

see if you are getting any error while activating feature in uls log.

Free Windows Admin Tool Kit Click here and download it now
May 15th, 2015 3:26am

Hi Rajendra,

I have verified that "SharePoint Foundation Web Application Service" and Sharepoint Timer service is running on app server as well.

Please see the constructor which i have used to create SPJob

 public TestJob(string jobName, SPWebApplication webApplication)
            : base(jobName, webApplication, null, SPJobLockType.ContentDatabase)
 {
 }

 Where webApplication passed is central admin web application.


May 15th, 2015 8:50am

Hi

If you want to run your timer job on all server you have to set the lock type as None.

http://blogs.msdn.com/b/besidethepoint/archive/2011/10/26/the-sharepoint-timer-service.aspx

see below link it will give good understanding.

http://www.shillier.com/archive/2010/01/18/where-is-my-timer-job.as

May 15th, 2015 9:29am

Hi Rajendra,

My requirement is not to run job on all servers in the farm. My requirement is to run job once in 2 minutes from any one web server. 

As i had Central admin hosted in web server(actually 2 web servers) i associated central admin web application and set lock type as contentdatabse, so that jobs scheduled on both web servers does not run same time.


May 15th, 2015 10:29am

Hi

Set your job lock type To job,it will run on only server.and schedule to It two minutes using SPMinuteSchedule.

You are getting  this error job definition TestJob, id 779b3ccf-df47-4c4d-aaea-7b3ae2f6502a has no online instance for service Microsoft.SharePoint.Administration.SPWebService, id db200214-6eb2-4696-bb3b-53cb12119650, ignoring"

because Sharepoint SharePoint Foundation Web Application Service  is running on app server and  there is no web application mapping on the server(you can see in IIS if any site is listed ).If you stop the service this error will be gone.

Timer Job not run on the central administration.It is just used for management.

so Set your job lock type To job,it will run on only s

Free Windows Admin Tool Kit Click here and download it now
May 15th, 2015 10:32am

Hi Rajendra,

Is there any msdn/technet documented material which says if parent of job is webapplication, timer job will run from all the servers where "SharePoint SharePoint Foundation Web Application Service" is running?

"SharePoint SharePoint Foundation Web Application Service  is running" on all servers, If timer job does not run app servers because mapping webapplication is not found there, then why not this timer job is not getting executed from the servers where Central Admin Web-application is present. Is that in my case timer service s trying to execute the job first from app server and it failed to execute and then skipped executing this job from remaining servers as well?



May 18th, 2015 12:26am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics