locked
Object Reference not set to an instance of an object with Timer Job Definitions RRS feed

  • Question

  • Hi,

    On our sandbox environment (SP Server 2010: WFE + App + DB, CU Dec 2010 on Windows Server 2008 R2), I had to remove orphaned site collections which were leftovers from a previously removed Project Server Web application. To do this I carried out steps described in http://social.technet.microsoft.com/Forums/en-US/projserv2010setup/thread/b26dadd1-95a6-451b-ab7f-536418108cec. This seemed to have worked well, to the extent that the errors we had before, were now gone. Great! Unfortunately a quick scan revealed that we got some other errors in return :-).

    From what I can make of it, it seems that the farm is now struggling with missing Timer Job Definitions. In fact the system shows two different symptoms, but both seem to relate to the same thing.

    1.   When I try to open the jobdefinitions page on CA (http://<CA URL>/_admin/ServiceJobDefinitions.aspx) I get  "Object Reference not set to an instance of an object" error.

    2.   In eventlog groups of 4 errors (Event ID 6464) appear at regular intervals. (details are at the bottom of this message).The 4 errors only differ where the id is put. There are 4 different Id's in play:

    feb4f1bd-721b-4cbc-9903-fb0636e38665

    03f3f0ff-c096-4df4-99db-856001d2988c

    af3cb559-2a9f-4d3f-a957-9420c3c5368c

    dee650f1-3c07-453a-bc54-d5ecce1b6a39

     

    I have tried running config wizard already without any luck. Also tried re-installing CU (but this of course did not work as the update was already applied and nothing was installed)

    Here's detail of one error in eventlog. Thanks for any suggestions that might help resolving this issue.

    Log Name:      Application

    Source:        Microsoft-SharePoint Products-SharePoint Foundation

    Date:          29/03/2011 9:17:40

    Event ID:      6464

    Task Category: Timer

    Level:         Error

    Keywords:     

    User:          PKS\ps_spfarmadmin

    Computer:      behyp02v01.pks.be

    Description:

    There was an exception loading job definition "Microsoft.Office.Project.Server.Administration.ServerScheduledTimerJob" (id "feb4f1bd-721b-4cbc-9903-fb0636e38665"). Object reference not set to an instance of an object.

    Event Xml:

    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

      <System>

        <Provider Name="Microsoft-SharePoint Products-SharePoint Foundation" Guid="{6FB7E0CD-52E7-47DD-997A-241563931FC2}" />

        <EventID>6464</EventID>

        <Version>14</Version>

        <Level>2</Level>

        <Task>12</Task>

        <Opcode>0</Opcode>

        <Keywords>0x4000000000000000</Keywords>

        <TimeCreated SystemTime="2011-03-29T07:17:40.254227300Z" />

        <EventRecordID>5920</EventRecordID>

        <Correlation />

        <Execution ProcessID="1840" ThreadID="1860" />

        <Channel>Application</Channel>

        <Computer>behyp02v01.pks.be</Computer>

        <Security UserID="S-1-5-21-1960408961-1935655697-1801674531-11653" />

      </System>

      <EventData>

        <Data Name="string0">There was an exception loading job definition "Microsoft.Office.Project.Server.Administration.ServerScheduledTimerJob" (id "feb4f1bd-721b-4cbc-9903-fb0636e38665").</Data>

        <Data Name="string1">Object reference not set to an instance of an object.</Data>

      </EventData>

    </Event>

     

    Tuesday, March 29, 2011 8:23 AM

Answers

  • This could be one of the possibility

    -> Looks like you have deleted some of the service application. And when you navigate to the timer job defintion page, which might be still referring to the service applications which are deleted now, it might have thrown this error. After deleting those timer job definitions (may be after few mins, could be because of cache) it should have got loaded again.


    Satheesh http://spsatheesh.wordpress.com/
    • Marked as answer by Lily Wu Sunday, April 10, 2011 2:06 PM
    Tuesday, March 29, 2011 1:53 PM

All replies

  • UPDATE - more info

     

    Since my initial posting I identified the offending timer jobs, using the get-sptimerjob cmdlet. The id's of the timerjobs in question are highlighted in the extract from the console shown below:

    PS C:\Users\PS_SPFarmAdmin> get-sptimerjob | where-object {$_.name -like "PWA*"}

     | format-list name, id

     

     

    Name           : PWASSP_03a1dbff-1857-4ba9-9ab6-e8558573901c_ApplyResourceCapac

                     ityTimeRangeJob_

    Id             : 852f3b93-8a80-4c14-936a-7e167d3e511c

     

    Name           : PWASSP_03a1dbff-1857-4ba9-9ab6-e8558573901c_WorkflowCleanupJob

                     _

    Id             : 54f51d8b-f7c8-40cd-9c4e-cd8bc97a118e

     

    Name           : PWASSP_22b87804-d92d-4243-9bab-df4b73430a29_ApplyResourceCapac

                     ityTimeRangeJob_

    Id             : feb4f1bd-721b-4cbc-9903-fb0636e38665

     

    Name           : PWASSP_22b87804-d92d-4243-9bab-df4b73430a29_WorkflowCleanupJob

                     _

    Id             : 03f3f0ff-c096-4df4-99db-856001d2988c

     

    Name           : PWASSP_9840bd19-10f4-4732-87e2-b2297a65990d_ApplyResourceCapac

                     ityTimeRangeJob_

    Id             : af3cb559-2a9f-4d3f-a957-9420c3c5368c

     

    Name           : PWASSP_9840bd19-10f4-4732-87e2-b2297a65990d_WorkflowCleanupJob

                     _

    Id             : dee650f1-3c07-453a-bc54-d5ecce1b6a39

     

    Name           : PwaJobScheduler_Threon behyp02 Web Site:PWA2

    Id             : 3206bb6d-0bef-4dfe-9723-fbcc65222e44

     

    I then disabled the 4 sptimerjobs as follows:

    PS C:\Users\PS_SPFarmAdmin> disable-sptimerjob feb4f1bd-721b-4cbc-9903-fb0636e38

    665

    PS C:\Users\PS_SPFarmAdmin> disable-sptimerjob 03f3f0ff-c096-4df4-99db-856001d29

    88c

    PS C:\Users\PS_SPFarmAdmin> disable-sptimerjob af3cb559-2a9f-4d3f-a957-9420c3c53

    68c

    PS C:\Users\PS_SPFarmAdmin> disable-sptimerjob dee650f1-3c07-453a-bc54-d5ecce1b6

    a39

     

     

    PS C:\Users\PS_SPFarmAdmin> get-sptimerjob | where-object {$_.name -like "PWA*"}

     | format-list name, id, ISDisabled

     

     

    Name       : PWASSP_03a1dbff-1857-4ba9-9ab6-e8558573901c_ApplyResourceCapacityT

                 imeRangeJob_

    Id         : 852f3b93-8a80-4c14-936a-7e167d3e511c

    IsDisabled : False

     

    Name       : PWASSP_03a1dbff-1857-4ba9-9ab6-e8558573901c_WorkflowCleanupJob_

    Id         : 54f51d8b-f7c8-40cd-9c4e-cd8bc97a118e

    IsDisabled : False

     

    Name       : PWASSP_22b87804-d92d-4243-9bab-df4b73430a29_ApplyResourceCapacityT

                 imeRangeJob_

    Id         : feb4f1bd-721b-4cbc-9903-fb0636e38665

    IsDisabled : True

     

    Name       : PWASSP_22b87804-d92d-4243-9bab-df4b73430a29_WorkflowCleanupJob_

    Id         : 03f3f0ff-c096-4df4-99db-856001d2988c

    IsDisabled : True

     

    Name       : PWASSP_9840bd19-10f4-4732-87e2-b2297a65990d_ApplyResourceCapacityT

                 imeRangeJob_

    Id         : af3cb559-2a9f-4d3f-a957-9420c3c5368c

    IsDisabled : True

     

    Name       : PWASSP_9840bd19-10f4-4732-87e2-b2297a65990d_WorkflowCleanupJob_

    Id         : dee650f1-3c07-453a-bc54-d5ecce1b6a39

    IsDisabled : True

     

    Name       : PwaJobScheduler_Threon behyp02 Web Site:PWA2

    Id         : 3206bb6d-0bef-4dfe-9723-fbcc65222e44

    IsDisabled : False

     

    Also restarted Sharepoint Timer service and did iisreset. However, when I go back to the ServiceJobDefinitions page, it still ends up in the same ‘object reference not set ….’ Error.

    The obvious next thing to do seems to be to delete the SPTimerJobs. How can I delete SPTimerjobs in SP 2010 though? Powershell does not have a cmdlet similar to the stsadm operation called deletessptimerjob. Moreover this operation seems to have been removed from the (deprecated) stsadm utility as well.

    Any help is welcome.

     

    Tuesday, March 29, 2011 12:01 PM
  • wow! couple of minutes after my previous post, and the ServiceJobDefinitions page displays again! No idea what may have caused the page to function now, but I'm guessing that after disabling the SPTimerjobs, some other TimerJob kicked in and cleaned up any loose ends.

    Would like to read some of your opinions about this though.

    Thanks

     

    Tuesday, March 29, 2011 12:16 PM
  • This could be one of the possibility

    -> Looks like you have deleted some of the service application. And when you navigate to the timer job defintion page, which might be still referring to the service applications which are deleted now, it might have thrown this error. After deleting those timer job definitions (may be after few mins, could be because of cache) it should have got loaded again.


    Satheesh http://spsatheesh.wordpress.com/
    • Marked as answer by Lily Wu Sunday, April 10, 2011 2:06 PM
    Tuesday, March 29, 2011 1:53 PM
  • You can assign the job to a variable and use the delete method to get rid of it.

     

    $job = Get-SPTimerJob <guid>

    $job.delete()

     

    Sean

    • Proposed as answer by Matt StainlessX Wednesday, October 10, 2012 1:00 PM
    Thursday, April 28, 2011 4:56 PM
  • Hi Kurt and Sean,
    I ran into the same situation and deleting the affected jobs did the trick for me. Thanks for the outline of the solution.

    Regards Norbert

    Tuesday, July 19, 2011 6:15 AM
  • After migrating a PWA site from one farm to another, I got the same "Object Reference not set to an instance of an object"-error instead of the Timer Jobs list.

    Got this in the ULS logs:

    System.NullReferenceException: Object reference not set to an instance of an object.
     Microsoft.Office.Project.Server.Administration.ServerScheduledTimerJob.get_DisplayName()
     Microsoft.SharePoint.ApplicationPages.JobDefinitionsDataSourceView.AddRow(SPJobDefinition jd, DataTable table, DataSourceSelectArguments selectArguments)
     Microsoft.SharePoint.ApplicationPages.JobDefinitionsDataSourceView.AddService(SPService service, DataTable table, DataSourceSelectArguments selectArguments)
     Microsoft.SharePoint.ApplicationPages.JobDefinitionsDataSourceView.AddFarm(SPFarm farm, DataTable table, DataSourceSelectArguments selectArguments)
     Microsoft.SharePoint.WebControls.TimerJobDataSourceView.FillDataTable(DataTable table, DataSourceSelectArguments selectArguments)
     Microsoft.SharePoint.WebControls.DataTableDataSourceView.Select(DataSourceSelectArguments selectArguments)
     Microsoft.SharePoint.WebControls.AdministrationDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)
     System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
     System.Web.UI.WebControls.DataBoundControl.PerformSelect()
     System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
     System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
     System.Web.UI.Control.EnsureChildControls()
     System.Web.UI.Control.PreRenderRecursiveInternal()
     System.Web.UI.Control.PreRenderRecursiveInternal()
     System.Web.UI.Control.PreRenderRecursiveInternal()
     System.Web.UI.Control.PreRenderRecursiveInternal()
     System.Web.UI.Control.PreRenderRecursiveInternal()
     System.Web.UI.Control.PreRenderRecursiveInternal()
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    - In bold is what led me to doing the following:

    PS C:\> $FUBARjob = Get-SPTimerJob | Where-Object {$_.DisplayName -eq $null}
    PS C:\> $FUBARjob
    
    Name                 Schedule             Last Run
    ----                 --------             --------
    PWASSP_71ae9cba-4... daily between 00:... 1/1/0001 12:00:00 AM
    
    
    PS C:\> $FUBARjob.Description
    Project Server Shared Timer Job
    PS C:\> $FUBARjob.Delete()

    Which solved my problem, being an orphaned PWA job without a displayname :)

    • Proposed as answer by fsupport Thursday, July 24, 2014 12:32 PM
    Tuesday, May 15, 2012 11:18 AM
  • Rune,

    I ran across this same issue you described in your post and ran your script but it doesn't return a description of the 2 timerjob that have a null desription.  I have disabled these jobs but it seems they need to be deleted to solve the problem.  Can you guide me in the right direction to delete the jobs by GUID. 

    I appreciate your help.  

    Scott

    Saturday, June 9, 2012 12:35 AM
  • Hey Scott,

    Late reply, sorry - I am not receiving notifications by mail.

    Maybe your issue is a different one (by the way, the commands wont return a description if that one is null, and they will only return anything if DisplayName is null), but if you know the Id of the timerjob, use this:

    PS C:\> $FUBARjob = Get-SPTimerJob | Where-Object {$_.Id -eq '<ID_OF_THE_JOB>'}
    PS C:\> $FUBARjob #(To verify the existance of that job)
    PS C:\> $FUBARjob.Delete()

    Or, if you know the Name, use this:

    PS C:\> $FUBARjob = Get-SPTimerJob | Where-Object {$_.Name -eq '<NAME_OF_THE_JOB>'}
    PS C:\> $FUBARjob #(To verify the existance of that job)
    PS C:\> $FUBARjob.Delete()
    Thursday, December 6, 2012 3:39 PM