Error when adding associated software

book

Article ID: 170630

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server)

Issue/Introduction

When trying to add Association to software there is an error "Symantec Management Server Error", "Internal Server Error"

This is the error thrown in the logs:
HTTP Request failed:
/Altiris/SoftwareManagement/Dialogs/dlgResourceSelector.aspx?showpick=1&multi=1&ret=1&mode=1&typeguid=07849305-d41a-45c2-95f0-333fa79fb862&nopatch=1


Violation of PRIMARY KEY constraint 'PK__#validRe__FEDF33B1EB865BED'. Cannot insert duplicate key in object 'dbo.#validResources'. The duplicate key value is (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
   at Altiris.NS.DataAccessLayer.Implementation.Altiris_SoftwareManagementSoftwareManagementFrameworkDAL.spSMF_GetScopeMembersLocalizedNoPatch(Guid scopeCollectionGuid, String trusteeMembership, Boolean includeChildren, String culture)

SQL Exception details: code=2627, line=9, procedure=spSMF_GetScopeMembersLocalizedNoPatch

Cause

There is at least one software resource that was created as two different types

Environment

8.x

Resolution

To resolve this we need to identify the problem software.

The following query can be used in a report or run from SQL Management Studio to isolate the Software Resources that are causing the problem.

SELECT r.Guid, r.Name, rt.Name
FROM vRM_Resource_Item r
JOIN ResourceType rt ON rt.Guid = r.ResourceTypeGuid
WHERE r.Guid IN
(
SELECT IR.Guid  
FROM ItemResource IR   
JOIN ResourceType     RT ON RT.Guid = IR.ResourceTypeGuid  
WHERE RT.ClassGuid NOT IN('395AF97C-09DE-435f-96FF-C386F2B38FB2', '043EDFB8-6A1D-4699-9EE8-BA9CCCBDE442','9B0E3088-FF66-4114-ABC7-C748E58F9CAD')  
GROUP BY IR.Guid
HAVING COUNT (IR.Guid) > 1
)
 
The Software Resource can then be exported, deleted and imported back to resolve the problem.