Job stuck at attempting to cancel job

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

February 28th, 2012 10:59pm

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

hi,

Mark

Free Windows Admin Tool Kit Click here and download it now
March 5th, 2012 10:32pm

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

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

April 6th, 2012 5:18pm

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 06, 2012 2:18 PM
Free Windows Admin Tool Kit Click here and download it now
April 6th, 2012 5:18pm

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 06, 2012 2:18 PM
April 6th, 2012 5:18pm

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 06, 2012 2:18 PM
Free Windows Admin Tool Kit Click here and download it now
April 6th, 2012 5:18pm

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 06, 2012 2:18 PM
April 6th, 2012 5:18pm

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 06, 2012 2:18 PM
Free Windows Admin Tool Kit Click here and download it now
April 6th, 2012 5:18pm

Great! I had the same problem on DPM 2012 SP1 and I can confirm that this script works.

Regards,
Dinko

September 3rd, 2013 8:49pm

yes worked for me as well on dpm 2012 sp1
Free Windows Admin Tool Kit Click here and download it now
September 25th, 2013 11:16am

Thank you for your feedback! it helped!
October 14th, 2013 7:36pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics