Saturday, June 29, 2013

Alerts Timer Job Failure SharePoint 2010

After migrating to SharePoint 2010 from MOSS 2007, we faced issues of alerts not being sent. Many users reported the issue and it was an intermittent issue. It was failing for few lists. Even if there are two lists on a site, alerts from one list are working fine, but the other list was failing to send notifications.

I checked the ULS logs and it has entries for COM exception.

Timestamp    : 6/22/2013 8:30:01 AM
Continuation : False
Process      : OWSTIMER.EXE (0x1D64)
ThreadID     : 8464
Area         : SharePoint Foundation
Category     : Alerts
EventID      : c6f5
Level        : Verbose
Message      : AlertsJob, Filter for Immediate subscription with id {2D5D9F07-D0CE-478F-BFBD-B05AE9C8D337} matched event with Id 11471939
Correlation  : aa6f068e-da75-44ff-bcb1-9ef3313dccde
Context      : {}

Timestamp    : 6/22/2013 8:30:01 AM
Continuation : False
Process      : OWSTIMER.EXE (0x1D64)
ThreadID     : 8464
Area         : SharePoint Foundation
Category     : General
EventID      : 837l
Level        : Exception
Message      : An unhandled exception occured. Watson will be invoked.
Correlation  : aa6f068e-da75-44ff-bcb1-9ef3313dccde 

Exception stack trace:
at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
at Microsoft.SharePoint.Library.SPRequest.DispatchTimerJob(Int32 lJobType, Guid gVServerId, Int32 lScope, Guid gDatabaseId, String bstrDSNServer, String bstrDSNDatabase, String bstrDSNUser, String bstrDSNPassword)
at Microsoft.SharePoint.Administration.SPNativeDatabaseJobDefinition.Execute(Guid targetInstanceId)
at Microsoft.SharePoint.Administration.SPTimerJobInvokeInternal.Invoke(SPJobDefinition jd, Guid targetInstanceId, Boolean isTimerService, Int32& result)

The common thing in these errors was "it was throwing exception after applying filter for immediate subscription as highlighted above.

I first located the alert by using PowerShell script given below. I used the script for web application on which the timer job was failing.

$webs=Get-SPWebApplication <webappurl>|Get-SPSite -Limit All| Get-SPWeb -Limit All
$alert=$webs|%{$_.Alerts}|?{$_.Id -eq "<subscriptionid>"}
$alert|Select @{Name="User";Expression={$_.User.LoginName}}, List, @{Name="Url";Expression={$_.List.ParentWeb.Url}}

The script listed the "SharePoint\System" account as user. This was weird and so we verified on the site "is it really a system account subscribing the alerts?". Yes., it was "System Account."

System account cannot subscribe to alerts in SP2010. We were not sure whether it was possible in MOSS 2007. System account do not have Email ID and so we cannot subscribe to alerts using System Account. This was causing the failure of the Immediate Jobs timer job.



The timer job was failing for the lists where system account had subscription and for other lists it was working.

We removed all system account subscription on all sites in the web application and there were no failures any more.

Hope this will help others.

Post a Comment