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"

Article:TECH179942  |  Created: 2012-01-26  |  Updated: 2012-01-26  |  Article URL http://www.symantec.com/docs/TECH179942
Article Type
Technical Solution


Issue



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.


Error



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 now this may normally happen and Symantec has not been able to reproduce the issue.


Solution



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-new.sql (2 kBytes)
spget-original.sql (2 kBytes)






Article URL http://www.symantec.com/docs/TECH179942


Terms of use for this information are found in Legal Notices