Maintenance Plan Failed/Error

  • Dear Experts,
    I have a maintenance  to write different backup and an associated task recently introduced by me in that plan which calls an SQL Agent job to purge one day old backup , using FORFILES command at DOS. The backup completes but the history says the job failed. Also , I don't have history for this Agent job that deletes old backup . Any help please ? thank you.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Date  12-09-2017 12:30:02
    Log  Job History (ISSUER_DiffBackup.Subplan_1)

    Step ID  1
    Server  SERVERNM
    Job Name  ISSUER_DiffBackup.Subplan_1
    Step Name  Subplan_1
    Duration  02:41:02
    Sql Severity  0
    Sql Message ID  0
    Operator Emailed  
    Operator Net sent  
    Operator Paged  
    Retries Attempted  0

    Message
    Executed as user: SERVERNM\SYSTEM. Microsoft (R) SQL Server Execute Package Utility  Version 10.50.6000.34 for 64-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.   
    Started:  12:30:02 PM  Progress: 2017-09-12 12:30:03.38     Source: {5F48E36B-0C8A-4C34-AAF0-195EA2B542D3}     
    Executing query "DECLARE @GUID UNIQUEIDENTIFIER      EXECUTE msdb..sp...".: 100% complete  End Progress  Progress: 2017-09-12 15:08:54.98  
    Source: Back Up Database Task      Executing query "BACKUP DATABASE [DB] TO  DISK = N'D:\BACKUPFOLDER...".: 50% complete  End Progress  Progress: 2017-09-12 15:11:02.50    
    Source: Back Up Database Task      Executing query "declare @backupSetId as int  select @backupSetId =...".: 100% complete  End Progress  Error: 2017-09-12 15:11:02.54 
    Code: 0xC0024104     Source: Execute SQL Server Agent Job Task     
    Description: The Execute method on the task returned error code 0x80004003 (Object reference not set to an instance of an object.).
    The Execute method must succeed, and indicate the result using an "out" parameter.  End Error  DTExec: The package execution returned DTSER_FAILURE (1). 
    Started:  12:30:02 PM  Finished: 3:11:02 PM  Elapsed:  9660.47 seconds.
    The package execution failed.  The step failed.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------

  • Looks like with your error of:
    Code: 0xC0024104     Source: Execute SQL Server Agent Job Task     
    Description: The Execute method on the task returned error code 0x80004003 (Object reference not set to an instance of an object.).

    It's failing on the other job or when the job is called that deletes the files using forfiles. If you have no job history for the delete job then it seems like it never started. Did you try running the delete files job manually? Did you check the SQL Agent error logs? Did you enable reporting and verbose logging for the Maintenance plan - that could show issues if it's when you call the job. Did you verify the T-SQL for that task? It should just be sp_start_job passing in the job id.

    Sue

  • Sue_H - Tuesday, September 12, 2017 5:27 PM

    Looks like with your error of:
    Code: 0xC0024104     Source: Execute SQL Server Agent Job Task     
    Description: The Execute method on the task returned error code 0x80004003 (Object reference not set to an instance of an object.).

    It's failing on the other job or when the job is called that deletes the files using forfiles.

    Sue

    Sue  , you are right . I'd figured out after posting the question looking carefully at the full error msg . When I added the Agent Job in the maintenance plan , I double-clicked with some delay while checking the job name . So it got checked and then unchecked and then I saved it . I checked it properly and saved .So what you pointed out as the first cause turned out to be correct. Now it ran fine for the backups last night . Thank you so much.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply