After a network issue where the connection to the database got disconnected, an AD Import Rule failed to stop, giving the following error:
Web service error: Error occurred ---> Failed to stop task
The customer is unable to stop or start the AD Import again.
Entry 1:
Directory import will not start, rule is already runing: 'Import Computer resources from MyDomain.org, from ... (335) and using the default column mappings. Import some computers on the specified schedules.' (69173f10-1160-40f6-b780-1e92507b1f2a)
Entry 2:
Stopping import rule: {69173F10-1160-40F6-B780-1E92507B1F2A}
Entry 3:
Failed to stop task ID {69173F10-1160-40F6-B780-1E92507B1F2A}. Error: Invalid task id: {69173F10-1160-40F6-B780-1E92507B1F2A}
Invalid task id: {69173F10-1160-40F6-B780-1E92507B1F2A}
Entry 4:
Failed to stop task: {69173F10-1160-40F6-B780-1E92507B1F2A}
Failed to stop task ID {69173F10-1160-40F6-B780-1E92507B1F2A}. Error: Invalid task id: {69173F10-1160-40F6-B780-1E92507B1F2A}
Entry 5:
Failed to stop import rule: {69173F10-1160-40F6-B780-1E92507B1F2A}
Failed to stop task: {69173F10-1160-40F6-B780-1E92507B1F2A}
ITMS 8.1 or later
After the database connection was reestablished, the AD Import rule was in a bad state with the incorrect status.
Since the affected AD Import is in a bad state, the following query should be able to help you to stop any running AD Import Rule:
delete from taskmanager
where TaskID in (
select TaskID from taskmanager
where state like 'R'
and name = 'directory import'
)