SharePoint 2016 / 2019 – Timer jobs with Job lock type do not run

This is going to be very similar to another recent post: https://joshroark.com/sharepoint-2016-2019-timer-jobs-with-contentdatabase-lock-type-do-not-run/. In that case, timer jobs with lock type “ContentDatabase” would not run because no server in the farm has its AllowContentDatabaseJobs property set to “true”.

In this case, Timer jobs with LockType = “Job” and IsServiceJob = “True” will not run because no server in the farm has the “AllowServiceJobs” property set to “True”.

So it’s the same concept: certain types of timer jobs will not run because there is no server in the farm that is allowed to run them.

Symptoms:

You notice that certain timer jobs are not running. They are enabled and scheduled, but there is no trace of them in timer job history, and the ULS logs say something like this:

OWSTIMER.EXE (0x3470) 0x2E7C SharePoint Foundation Timer 7f9q Medium Job definition Microsoft.SharePoint.Administration.<someTimerJobHere>, id <SomeGUID> not applicable, ignoring

For example, you notice that no user profiles are getting imported even though the AD Import timer job is running. You use PowerShell to output the properties of the timer job, and you see something like this:

Get-SPTimerJob | ?{$_.name -match "UserProfileADImportJob"} | fl 
JobDisplayName                : User Profile ActiveDirectory Import Job
JobDescription                : Imports objects from Active Directory into Profile Database.
DefaultSchedule               : every 5 minutes between 0 and 0
MaximumFailuresPerDirSyncScan : 5000000
MaximumPayloadsPerBatch       : 2000
MaximumTermsPerLdapFilter     : 100
LdapTimeoutSeconds            : 300
DaysBetweenFullImports        : 0
DisplayName                   : UPA-ADImport - User Profile ActiveDirectory Import Job
Description                   : Imports objects from Active Directory into Profile Database.
EnableBackup                  : True
Service                       : UserProfileService
IsServiceJob                  : True
WebApplication                : 
Server                        : 
LockType                      : Job
Schedule                      : daily between 03:00:00 and 03:00:00
Title                         : UPA-ADImport - User Profile ActiveDirectory Import Job
LastRunTime                   : 1/1/0001 12:00:00 AM
Retry                         : False
IsDisabled                    : False
VerboseTracingEnabled         : False
HistoryEntries                : {}
DiskSizeRequired              : 0
CanSelectForBackup            : False
CanRenameOnRestore            : False
CanSelectForRestore           : False
Name                          : UPA-ADImport_UserProfileADImportJob
TypeName                      : Microsoft.Office.Server.UserProfiles.ADImport.UserProfileADImportJob
Id                            : ae5e6648-2a09-4747-88b5-553ca06df2f7
Status                        : Online
Parent                        : UserProfileService
Version                       : 4479529
DeploymentLocked              : False

Notice that although the timer job is enabled and has a schedule, it’s “LastRunTime” is 1/1/0001 12:00:00 AM, and it has no History entries. You may also notice that IsServiceJob is set to “True” and LockType is set to “Job” for this timer job.

Cause:

There is no server in the farm with the “Application” server role, and / or there is no server in the farm with its “AllowServiceJobs” property set to “true”.

For example, you may have servers with the Web-Front-End, Search, and Distributed Cache roles, but no Application role. In a multi-server farm, at least one server is required to hold the Application role. Reference: https://docs.microsoft.com/en-us/sharepoint/install/planning-for-a-minrole-server-deployment-in-sharepoint-server#minrole-topologies

The AD Import timer job (and a bunch of other timer jobs, see list below) has its “IsServiceJob” property set to “True”, which means it can only run on a server where the “AllowServiceJobs” property is set to “True”.

You can check on the value of “AllowServiceJobs” along with the value of “AllowContentDatabaseJobs”, and check the status of the Timer and Administration services by running the “CheckTimerAndAdminServices.ps1” PowerShell script from my other post here: https://joshroark.com/sharepoint-all-about-one-time-timer-jobs/ In fact, if you have any kind of Timer job problem, I’d start with that script. It will detect and correct a pretty common (instance is offline) Timer service problem.

Resolution:

In a multi-server farm, either add a new server to the farm with the “Application” role, or change the role of an existing server to include “Application”.

Reference: https://docs.microsoft.com/en-us/sharepoint/administration/role-conversion-using-minrole-in-sharepoint-server-2016#how-to-change-a-server-role

In a one-server farm, the server should have the “Single-Server farm” role. The “Custom” role should also work as long as “AllowServiceJobs” and “AllowContentDatabaseJobs” are both set to “true”. You can set them that way with PowerShell like this:

$serverName = "YourServerNameHere"
$farm = Get-SPFarm
$TI = $farm.TimerService.Instances | ?{$_.server -match $serverName}
$TI.AllowContentDatabaseJobs = $true
$TI.AllowServiceJobs = $true
$TI.Update() 

Here’s a list of all the SharePoint 2019 timer jobs with “IsServiceJob” property set to “True”:

Get-SPTimerJob | ?{$_.isservicejob -eq $true} | select name | sort name

daily-any-sptimerservice-health-analysis-job

daily-any-spwebservice-health-analysis-job

daily-any-spwebservice-health-analysis-job

daily-any-translationservice-health-analysis-job

daily-any-userprofileservice-health-analysis-job

hourly-any-sptimerservice-health-analysis-job

hourly-any-userprofileservice-health-analysis-job

job-appanalytics-uploader

job-autohosted-appinstance-counter

job-ceip-datacollection

job-delete-job-history

job-internalspapp-statequery

job-password-management

job-spapp-licenserenewal

job-spapp-statequery

job-spconnectedserviceapplication-addressesrefresh

job-static-ceip

job-upgrade-upgradesession-cleanup

job-usage-database-wait-statistics

job-usage-data-maintenance

job-usage-log-file-processing

MetadataHubTimerJob

monthly-any-sptimerservice-health-analysis-job

mysitecleanup

Prepare query suggestions

PreservationProcessingJob

Query Logging

SearchChangeLogGeneratorJobDefinition

SPAppStatisticsProviderJobDefinition

StateServiceExpiredSessionJobDefinition

UnifiedPolicyOnPremSyncTimerJob

UnifiedPolicyOnPremSyncTimerJob

UnifiedPolicyOnPremSyncTimerJob

UPA-ADI_ActivityFeedCleanupJob

UPA-ADI_ActivityFeedJob

UPA-ADI_AudienceCompilationJob

UPA-ADI_BackgroundOperationsJob

UPA-ADI_FeedCacheRepopulationJob

UPA-ADI_LanguageAndRegionSync

UPA-ADI_LanguageSynchronizationJob

UPA-ADI_LMTRepopulationJob

UPA-ADI_MySiteSuggestionEmailJob

UPA-ADI_ProfileAttributeSyncJob

UPA-ADI_ProfSync

UPA-ADI_SocialDataMaintenanceJob

UPA-ADI_SocialRatingSyncJob

UPA-ADI_SweepSync

UPA-ADI_UpdateMembershipsAndRelationships

UPA-ADI_UserChangeJob

UPA-ADI_UserPointPublishingOperationsJob

UPA-ADI_UserProfileADImportJob

UPA-ADI_UserProfileChangeCleanupJob

UPA-ADI_UserProfileChangeJob

UpdateHiddenListJobDefinition

UpdateHiddenListJobDefinition

UpdateHiddenListJobDefinition

weekly-any-sptimerservice-health-analysis-job

weekly-any-spwebservice-health-analysis-job

weekly-any-spwebservice-health-analysis-job

weekly-any-userprofileservice-health-analysis-job

Add a Comment