none
Job stuck at attempting to cancel job RRS feed

  • Question

  • After renaming some databases and adding the new ones back into the protection group, I went to create a recovery point. For almost a day they were stuck at replica creation in progress. These were small in size, so they shouldn't have taken more than minutes, let alone hours. I tried to cancel the job but for over 24 hours now they have been stuck at Attempting to cancel. I can't find any information on how to stop jobs like this. I've tried restarting services, the server, and checked to see if any sync jobs were running. I can't seem to find any powershell cmdlets either.

    Any ideas? I appreciate the help.

    Thanks,

    bd

    Tuesday, February 28, 2012 7:59 PM

Answers

  • After contacting MS tech support I got this resolved about a month ago, but wanted to post the solution here. For clearing jobs that are currently running but stuck, they had to write a custom MSSQL script. After running this, the jobs cleared. I don't recall if I had to restart the service or server. Here it is:

    --Run the following SQL Script

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

    USE DPMDB

    BEGIN TRAN

    -- mark replica as invalid if there was some operation happening on that replica

    UPDATE tbl_PRM_LogicalREplica

    SET Validity = 1 -- Invalid

    WHERE OwnerTaskIdLock IS NOT NULL AND

    Validity <> 5 AND -- ProtectionStopped

    Validity <> 6 -- Inactive

    -- Release all the locks held

    UPDATE tbl_PRM_LogicalREplica

    SET OwnerTaskIdLock = null,

    Status=8

    if (select COUNT(name) from tbl_AM_Agent where Name like 'DPM RA v2%') > 0

    begin

    exec sp_executesql N'UPDATE tbl_RM_ShadowCopy

    SET ArchivetaskId = NULL,

    RecoveryJobId = NULL'

    end

    UPDATE tbl_ARM_Datasource

    SET Status = 0,

    OwnerLockId = NULL

    DELETE tbl_RM_DatasourceServerlock

    DELETE tbl_RM_ShadowCopyLocks

    -- Set All running tasks and jobs to failed

    UPDATE tbl_TE_TaskTrail

    SET ExecutionState = 3,

    LastStateName = 'Failure',

    StoppedDateTime = GetUtcDate()

    WHERE ExecutionState NOT IN (2,3)

    UPDATE tbl_JM_JobTrail

    SET JobState= 'Failed',

    EndDateTime = GetUtcDate()

    WHERE jobstate= 'Execute' OR jobstate= 'Retire'

    -- unreserve resources held

    UPDATE tbl_MM_Global_Media

    SET ReservationLevel = 0,

    ReservationOwnerMMId = null

    UPDATE tbl_MM_Global_Drive

    SET ReservationLevel = 0,

    ReservationOwnerMMId = null

    UPDATE tbl_MM_Global_IEPortResource

    SET ReservationLevel = 0,

    ReservationOwnerMMId = null

    COMMIT TRAN

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

    • Marked as answer by winjutsu Friday, April 6, 2012 2:18 PM
    Friday, April 6, 2012 2:18 PM

All replies

  • some errors in event viewer (for example dcom)? can you send *.errlog from under <DPMInstallFolder>\DPM\Temp?

    hi,

    Mark

    Monday, March 5, 2012 7:32 PM
  • After contacting MS tech support I got this resolved about a month ago, but wanted to post the solution here. For clearing jobs that are currently running but stuck, they had to write a custom MSSQL script. After running this, the jobs cleared. I don't recall if I had to restart the service or server. Here it is:

    --Run the following SQL Script

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

    USE DPMDB

    BEGIN TRAN

    -- mark replica as invalid if there was some operation happening on that replica

    UPDATE tbl_PRM_LogicalREplica

    SET Validity = 1 -- Invalid

    WHERE OwnerTaskIdLock IS NOT NULL AND

    Validity <> 5 AND -- ProtectionStopped

    Validity <> 6 -- Inactive

    -- Release all the locks held

    UPDATE tbl_PRM_LogicalREplica

    SET OwnerTaskIdLock = null,

    Status=8

    if (select COUNT(name) from tbl_AM_Agent where Name like 'DPM RA v2%') > 0

    begin

    exec sp_executesql N'UPDATE tbl_RM_ShadowCopy

    SET ArchivetaskId = NULL,

    RecoveryJobId = NULL'

    end

    UPDATE tbl_ARM_Datasource

    SET Status = 0,

    OwnerLockId = NULL

    DELETE tbl_RM_DatasourceServerlock

    DELETE tbl_RM_ShadowCopyLocks

    -- Set All running tasks and jobs to failed

    UPDATE tbl_TE_TaskTrail

    SET ExecutionState = 3,

    LastStateName = 'Failure',

    StoppedDateTime = GetUtcDate()

    WHERE ExecutionState NOT IN (2,3)

    UPDATE tbl_JM_JobTrail

    SET JobState= 'Failed',

    EndDateTime = GetUtcDate()

    WHERE jobstate= 'Execute' OR jobstate= 'Retire'

    -- unreserve resources held

    UPDATE tbl_MM_Global_Media

    SET ReservationLevel = 0,

    ReservationOwnerMMId = null

    UPDATE tbl_MM_Global_Drive

    SET ReservationLevel = 0,

    ReservationOwnerMMId = null

    UPDATE tbl_MM_Global_IEPortResource

    SET ReservationLevel = 0,

    ReservationOwnerMMId = null

    COMMIT TRAN

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

    • Marked as answer by winjutsu Friday, April 6, 2012 2:18 PM
    Friday, April 6, 2012 2:18 PM
  • Great! I had the same problem on DPM 2012 SP1 and I can confirm that this script works.

    Regards,
    Dinko

    Tuesday, September 3, 2013 5:49 PM
  • yes worked for me as well on dpm 2012 sp1
    Wednesday, September 25, 2013 3:15 PM
  • Thank you for your feedback! it helped!
    Monday, October 14, 2013 11:34 PM
  • Hi,

    I have this issue in DPM 2010, I have rebooted the server but there are still three jobs which are attempting to cancel and won't budge.  Can anyone tell me if this script is suitable to use in 2010 or is it just for 2012?

    Many Thanks

    Gemma

    Thursday, October 29, 2015 1:01 PM
  • Works on DPM 2012 R2 as well with SP1 and Update Rollup 8. 
    Wednesday, December 16, 2015 5:50 PM
  • Works on MABS v3 (DPM 2016) .
    Thanks
    Wednesday, November 13, 2019 3:43 PM