Error "Object reference is not set to an instance of an object" occurs in the Altiris logs when trying to run the CMDB task "Assign Asset Owner to be the Primary User"
search cancel

Error "Object reference is not set to an instance of an object" occurs in the Altiris logs when trying to run the CMDB task "Assign Asset Owner to be the Primary User"

book

Article ID: 155816

calendar_today

Updated On:

Products

CMDB Solution

Issue/Introduction

Trying to run the CMDB task "Assign Asset Owner to be the Primary User" fails to work. Reviewing the Altiris logs, the error "Object reference is not set to an instance of an object" is found during the task run.

Object reference is not set to an instance of an object.

Cause

There are more than one primary users set to the ownership of a computer. The other users are no longer in the database and attempting to edit them via their GUID also results in an object reference error.

It is unknown how this may normally happen and Symantec has not been able to reproduce the issue.

Resolution

Modify the stored procedure "spGetComputer_PrimaryOwner" used by the CMDB task to perform additional checks. This will only use the valid user seen as the primary user and resolve the error, enabling the task to then successfully work.

A sample of a modified "spGetComputer_PrimaryOwner" stored procedure and the original are attached to this article. In SQL Server Management Studio, run the spget-new.sql. This will update the stored procedure. Then in the Symantec Management Platform, run the task again. This should work this time. To run the stored procedure, do the following:
 

  1. Copy the code from spget-new.sql into SQL Server Management Studio.
  2. Use the Symantec_CMDB database to run the code against.
  3. Execute the code. The stored procedure is then modified and ready.

Attachments

spget-original-query.sql get_app
spget-new-query.sql get_app