Troubleshoot Duplicate Objects in Assets Discovery
Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Importing Discovery scan results into Assets may create duplicate Hosts. If Object Hashes match and settings are default, contact support.
Diagnosis
Importing Discovery scan results can create duplicate Host objects. Before changing anything, diagnose why the duplicates formed by comparing the identifying attributes of the duplicate hosts.
To better troubleshoot the issue, open your Host object type > List View, sort by Name (or Hostname), and add these attribute columns so you can compare the duplicates side by side (you may hide Created and Updated):
HostinfoFQDNModelSerial NumberUUIDVendorNetwork InterfacesObject Hash
If two hosts share the same Object Hash while settings are at their defaults, that indicates a genuine collision — gather the attribute values and contact Atlassian Support.
The first thing to look for is whether there are different Object Hash values between two instances (objects) with the same Hostname.
If you see different values for the Object Hash attributes of two objects with the same Hostname, technically, these are not duplicates, as they each have a different Unique identifier (Object Hash) calculated for them during a scan.
In this case, see which other Attributes listed above are showing different values between two objects with the same Hostname. These differences will cause different hash value, resulting in "legitimate duplicates".
The most probable cause is the Network Interface, but another example is that one scan was unable to retrieve the Host's Model, so a different Object Hash value was calculated, resulting in a duplicate. (Later, the duplicated object was tagged as a Missing Object, its Status set to Not Found, and the network interfaces were removed.)
Cause
The columns/attributes added to the list view correspond to the default settings in the Discovery ObjectHashSettings.xml file (see here, and your Discovery installation folder):
<!-- HostInfo Attributes -->
<HostInfo_Hostname>true</HostInfo_Hostname>
<HostInfo_FQDN>true</HostInfo_FQDN>
<HostInfo_Model>true</HostInfo_Model>
<HostInfo_Serialnumber>true</HostInfo_Serialnumber>
<HostInfo_UUID>true</HostInfo_UUID>
<HostInfo_Vendor>true</HostInfo_Vendor>
<HostInfo_Virtual>false</HostInfo_Virtual>
<HostInfo_SystemUpTime>false</HostInfo_SystemUpTime>
<HostInfo_SystemUpTimeMinutes>false</HostInfo_SystemUpTimeMinutes>
<HostInfo_RAM>false</HostInfo_RAM>
<HostInfo_FirstNICMAC>true</HostInfo_FirstNICMAC>The value of any attribute set to 'True' will be taken into account when calculating the Object Hash during a scan.
The Object Hash will be used as a unique identifier to establish references between different discovered objects and, by default, to identify Objects in Assets during the discovery import.
Note that any change to this file (e.g., changing an Attribute to False) will result in a duplicated object created once the next scan is imported (see how to prevent this, below).
Solution
Identify the Attribute showing different values between two instances of the Host object.
The cause might be that a Pattern file was recently disabled/enabled - in which case the duplicate is 'legitimate' - so no need to change the objectHashSettings (proceed to "How to avoid duplicates" section below).
In many cases, the FirstNICMAC may cause duplicated objects when using MAC or NIC Swapping during a new VM's span.
The way to workaround this is to edit the objectHashSettings.xml file:
<HostInfo_FirstNICMAC>false</HostInfo_FirstNICMAC>
This will result in Host objects with a new Object Hash created.
How to avoid duplicates
So, to avoid Duplicates, please do the following before importing these new scan results:
Navigate to the Schema Configuration > Import Tab > Discovery Import, and expand the Host object type map to see all the attribute maps.
The Object Hash should be the only identifier (indicated by a checkbox in the leftmost column of an Attribute map).
Set Hostname, UUID, and Serial Number as the Identifiers. Once done, uncheck the Object Hash attribute from being the Identifier.
Now, you may run the import to update your Host objects so they are identified by these 3 attributes rather than the Object Hash. The Object Hash itself will be updated during the import to a new value that should be consistent from now on.
Once the import is complete, you may revert to using the Object Hash as the sole identifier.
You may still want to manually delete the duplicated Host objects - after revising them, by filtering on either their Creation Date or their Status (e.g. 'Not Found'), and bulk deleting the results.
After adjusting the identifying attributes/import mapping, re-run the Discovery import and confirm no new duplicate Host is created for a device already present.
Was this helpful?