Inventory Task is failing to run with error: Failed to find the task handler.
search cancel

Inventory Task is failing to run with error: Failed to find the task handler.

book

Article ID: 279709

calendar_today

Updated On:

Products

IT Management Suite Inventory Solution

Issue/Introduction

Inventory Task fails when it is run against a client machine (in this example, it was a Linux RedHat machine):

An unknown exception was thrown on server side.

Failed to find the task handler.

The NS logs show that the Task failed:

Task instance is completed: 'Run Linux Inventory' (ee9e80c8-2679-4a8a-8efa-a4dd1cb8c47e, 7c441962-d44f-450f-bf88-a8d8bd1af6be), started at 02/02/2024 15:12:28, status=Failed, total time=00:00:04.5280762
-----------------------------------------------------------------------------------------------------
Date: 2/2/2024 3:12:32 PM, Tick Count: 928094109 (10.17:48:14.1090000), Size: 433 B
Process: AtrsHost (24864), Thread ID: 111, Module: AtrsHost.exe
Priority: 4, Source: ServerTaskExecutionInstance

If you run again the Inventory task and collect the Task Server agent logs and Linux agent logs, you may see the following:

1) The Linux agent logs show these errors when running the Task:

WARN 2024-02-19 09:29:29.707    844416  139831218042624  CTA-ExecThread > Failed to open connection to the task handler 'Altiris.InventoryAgent': 2147483742, Invalid argument
WARN 2024-02-19 09:29:29.711    844416  139831193593600  CTA-ExecEngine > Task instance {01E4FDEF-1D4C-4378-B322-49EC3A183DA5} execution failed - could not open task handler.
INFO 2024-02-19 09:29:29.714    844416  139831193593600  CTA-ExecEngine > void ClientTaskAgent::{anonymous}::AExecEngineImpl::PostExecStatus(ClientTaskAgent::AExecResult&)

2) The Task Server agent logs show that the task starts, runs, and at the end fails at those same times:

Starting task instance 'Quick run Linux Inventory on LinuxClient123' (fe96b4a7-6bf3-4aba-891a-a51ab21a6729) from 'Linux Inventory' (89183e9f-577c-4f70-bbca-300ce051199a, 32104b20-ad48-4d5d-b39f-fecea13e6039)
-----------------------------------------------------------------------------------------------------
Date: 2/19/2024 9:29:24 AM, Tick Count: 919766187 (10.15:29:26.1870000), Size: 431 B
Process: AtrsHost (9808), Thread ID: 85, Module: AtrsHost.exe
Priority: 4, Source: ServerTaskExecutionThread


Task instance is completed: 'Quick run Linux Inventory on LinuxClient123' (fe96b4a7-6bf3-4aba-891a-a51ab21a6729, 32104b20-ad48-4d5d-b39f-fecea13e6039), started at 19/02/2024 09:29:24, status=Failed, total time=00:00:05.6706338
-----------------------------------------------------------------------------------------------------
Date: 2/19/2024 9:29:30 AM, Tick Count: 919771859 (10.15:29:31.8590000), Size: 450 B
Process: AtrsHost (9808), Thread ID: 85, Module: AtrsHost.exe
Priority: 4, Source: ServerTaskExecutionInstance

Environment

ITMS 8.x

Cause

The inability to load the task handler: "Failed to open connection to the task handler 'Altiris.InventoryAgent': 2147483742, Invalid argument" is because if nothing can handle the task then it will fail. In this particular scenario, the inventory plug-in (Inventory Agent) was not installed on the client machine. For the Inventory task to work, it needs that plug-in installed to properly collect the information.

Resolution

"Note: The following steps are based on troubleshooting on a Linux client machine but the concepts can be easily applied to a Windows machine.

Make sure the Inventory plug-in is installed. You can check this under the "Agent Health" portion of the affected client machine:

If it is not present, proceed with the following:

  1. You can do the following to verify if it is there (run the following command on that Linux machine and review the results):
    aex-helper list        -- displays the installed components and solutions

    The results that we are expecting to see should look like this:

    CTAGENT
    CTBASEHANDLERS
    aex-iragent
    aex-smfagent
    aex-swuagent
    aex-monitor
    INVENTORY
    SERVERINVENTORY

    Subagents:

    Altiris Client Task Agent
    Altiris Client Task Scheduling Agent
    Altiris Base Task Handlers
    Altiris Inventory Rule Agent
    Altiris Software Management Framework Agent
    Altiris Software Update Agent
    Altiris Monitor Agent
    Altiris Inventory Agent
    Altiris Inventory Pack for Servers

  2. If "INVENTORY" is not present, then go ahead and install the Inventory plug-in:

  3. The agent log on that Linux machine should show something like this when the plug-in is been installed:

    INFO 2024-02-21 11:29:36.757    844416  139831217510144  SWDAgent > RunJobByID: Job {8B9D8FB0-49EB-45E9-8946-4B8D68F63287}, running command "/bin/sh -c "./rollout.sh" > `aex-helper info path`/aex-inventory-install.log 2>&1" in "/opt/altiris/notification/nsagent/var/packages/{746E0B2E-198A-41E8-90FD-D49AE9A4B5D8}"

    INFO 2024-02-21 11:29:36.758    844416  139831217510144  SWD > Executing command line "unset LD_ASSUME_KERNEL; PATH="${PATH}:/opt/altiris/notification/nsagent/var/packages/{746E0B2E-198A-41E8-90FD-D49AE9A4B5D8}"; export PATH; /bin/sh -c /bin/sh\ -c\ \"\./rollout\.sh\"\ \>\ \`aex-helper\ info\ path\`/aex-inventory-install\.log\ 2\>\&1"

    INFO 2024-02-21 11:29:42.526    844416  139831217510144  SWD > Command line result is 0

  4. After the Inventory plug-in is installed, go ahead and try again your Inventory task.

Note:
If the inventory plug-in is not installing:

Add to the agent logs (to have more details on what is happening) DEVNOTE logging as follows:

To enable Devnote logging run this in Terminal:

aex-helper agent -s "Configuration" debug_level DEVNOTE
aex-helper agent -s "Configuration" debug_file_size 0

To Disable devnote logging run this in Terminal:

aex-helper agent -s "Configuration" debug_level ERROR
aex-helper agent -s "Configuration" debug_file_size 1024

Collect agent logs from: /opt/altiris/notification/nsagent/var/

Review the following information and narrow down possible issues:

A) aex-inventory-install.log (located at /opt/altiris/notification/nsagent/)
B) Review the content of /opt/altiris/notification/inventory/ if this directory exists

Additional Information