Troubleshooting duplicate resources
Issue
Error messages in the a.log on the SMP server regarding Duplicate Resources for ResourceTypeKey.
- Source: Arellia.SMP.FileInventory.Discovery.FileDigitalSignatureResourceDiscoverer.DiscoverResource Description: Unable to inventory certificate details for Resource DISTRIB.exe (f8adc4a4-f512-432b-92ca-d40663ed811e)
- ( Exception Details: Arellia.SMP.Resource.Exceptions.AeXDuplicateResourceTypeKeyValueException: Duplicate Resources for ResourceTypeKey Hash (2244c832-3c51-4b26-9f8b-b2dfff449d9f). Resolving for ResourceType Digital Certificate (c76fc2a7-85db-4ecb-a055-8cd0d5fc91fd). Values = AlgorithmGuid='sha1 (3bc0e8a0-caa1-40e0-b705-c8d990c0babf)', Hash='Vk4BBmOH8myRIBDQa9eNPPHoRas='. MatchDerived = True ---> Altiris.Resource.AeXDuplicatedKeyValueException: Error in the application. at Altiris.Resource.ResourceTypeKey.FindResource(DataRow row, Guid resourceType, Boolean matchDerivedTypes)
- Unable to extract CertDetails for Resource a76d9563-68a9-4855-8b41-fd6ca9dca0d0
- (Unhandled exception. Type=MSoft.Resource.Exceptions.AeXDuplicateResourceTypeKeyValueException Msg=Duplicate Resources for ResourceTypeKey edb434fc-f301-4055-8e71-9b05ba2e1270. Resolving for ResourceType fb8a37a3-6b26-4ee9-a81b-fae48e3689b9. Values = OID='1.2.840.113549.1.1.1'.
Resolution
Note:
- When resources are being created the dynamic creation of two simultaneously should not occur: the ResourceKeyPendingSession and ResourceKeyPending tables protect against this. However if the SMP/NS Service is killed there are situations where this can occur within certain timeframes.
- The other scenario (which shouldn't occur) is if the standard resouce was deleted (or marked as deleted). Then a new one would be created on the fly and a subsequent import of a solution Report or Data Pack ( on upgrade or repair) it would re-introduce the resource.
To Resolve
Check for the text "Values" in the error message. Extract the name of the Value(s) (in Ex. 1 above "AlgorithmGuid" and "Hash". In Ex. 2 above "OID"). Substitute the name of the value in the following SQL where it says 'Name'. The single quotes must surround the name of the value. If there are two value then do them one at a time.
select sc.name, so.name from syscolumns sc
join sysobjects so on sc.id=so.id
where sc.name = 'Name' and so.xtype = 'U'
The Results of the query will give a list of columns and tables. It should be a short list. Find the inventory tables (denoted usually by starting with "Inv_"). Then the table with the correct columns will be the one to put in the following query. If there is more than one try them all. There shouldn't be more than a couple, especially if the table name doesn't apply to the issue.
select * from Inv_Hash
where AlgorithmGuid = '3bc0e8a0-caa1-40e0-b705-c8d990c0babf' and Hash = 'Vk4BBmOH8myRIBDQa9eNPPHoRas='
Put the table name where Inv_Hash is and put the values from the error message in the query. This should give the list of duplicate resources.
Then open Resource Manager and substitute on the URL at the end the Guids of the Resources from the previous query. There should be a Creation date on the Base Resource Portal Page in the Item Property Summary section. Compare the dates of the duplicate resources. Usually the earlier date is the correct resource and the other one should be deleted.
Find the resource to be deleted in the Resource Collections in the Default view of the Organizational Views and Groups. The Resource Type is given in the error message right after this text "Resolving for ResourceType...". If the resource type is not visible then select the Filter button (in the orange box below) and make the Resource Type visible. Then when the resource is found right-click and delete it
.