search cancel

Unable to replicate "Preboot Configurations" settings: Object reference not set to an instance of an object.

book

Article ID: 175895

calendar_today

Updated On:

Products

IT Management Suite Deployment Solution

Issue/Introduction

After the customer migrated his database to a new SMP Server, the following warning started to happen while trying to replicate "Preboot Configurations" setting (under SMP Console>Settings>Deployment):

Unable to export the specified object during replication (Task: Replicate, Type: Item, Guid: {cceb6e9c-8a7f-4deb-a94f-57dae7c46622}, Exception: System.NullReferenceException: Object reference not set to an instance of an object.

 

Unable to export the specified object during replication (Task: Replicate, Type: Item, Guid: {cceb6e9c-8a7f-4deb-a94f-57dae7c46622}, Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Altiris.Deployment.PrebootConfigPolicy.OnToXml(XmlTextWriter xmlBuilder)
   at Altiris.NS.ItemManagement.Item.Export()
   at Altiris.NS.Replication.Providers.Item.SourceReplicationImportExportProvider.ExportObject(String type, Guid guid)
   at Altiris.NS.Replication.Providers.Item.SourceReplicationImportExportProvider.ReplicateObjects(ReplicationJob jobItem, String jobId, String operationId, String type, ReplicationManifest2 manifest, ReplicationServersInfo serverInfo, Boolean dataSent)).
-----------------------------------------------------------------------------------------------------
Date: 9/3/2019 4:12:58 PM, Tick Count: 19945921 (05:32:25.9210000), Size: 986 B
Process: AeXSvc (7032), Thread ID: 453, Module: AeXSVC.exe
Priority: 2, Source: SourceReplicationImportExportProvider.ReplicateObjects

Environment

ITMS 8.1 RU7

Cause

Since it was a migration to a new server, some references for the "Preboot Configurations" are meant to be unique to the server where those were created. One of those references was not present on the new server (in this case the "PEInstall" configuration).

Resolution

Suggestion 1:

Check the following:

  1. Run the following query to identify what are the "Preboot Configurations" are available:
    select Guid, Name, cast(state as xml) from item where guid = 'CCEB6E9C-8A7F-4DEB-A94F-57DAE7C46622'
  2. If you have extra ones that are not the default ones, LinInstall, PEInstall,


    please follow TECH232868 in order to clean up this reference from "Automation_image_Configuration" table
     

Note: in some extreme cases, repairing DS installation may recreate those missing references.

 

Suggestion 2:

The following script will identify any deleted preboot configurations and remove them from the following places:

  • Automation_Image_Configuration table
  • The State column of the main “Preboot Configurations” tool/object
  • Item table (after NS.Quarter Hour is run.

 

-- Feed Preboot Configurations State column into a temp table.

     select  cast(state as xml) as State

     into #temp

     from item

     where guid = 'CCEB6E9C-8A7F-4DEB-A94F-57DAE7C46622'

 

 

declare @configurationGuid uniqueidentifier

declare PrebootPurge CURSOR FOR

 

    -- Begin parsing of Preboot Configurations state column for all registered Preboot Configuration Guids

       select  aic.ItemGuid

      from

       (

         select preboot.value('(.)[1]','uniqueidentifier' ) as ConfigurationGuid

         from #temp t

         cross apply t.State.nodes('item/PrebootConfigurationPolicy/PrebootConfigurationGuids/*') tn(preboot)

        ) a

 

       join Automation_Image_Configuration aic on aic.ItemGuid = a.ConfigurationGuid and aic.ActionType in (-1,0)

 

     -- End parsing of Preboot Configurations state column for all registered Preboot Configuration Guids

OPEN PrebootPurge

FETCH NEXT FROM PrebootPurge INTO @configurationGuid

WHILE @@FETCH_STATUS = 0

BEGIN

 

-- Insert deleted preboot configurations into ItemToDelete

 

insert into ItemToDelete

select i.Guid, getdate()

from Item i

left join ItemToDelete d on d.Guid = i.Guid

where i.Guid = @configurationGuid

and d.Guid is null

 

-- Remove deleted preboot configurations from table Automation_Image_Configuration

delete from Automation_Image_Configuration where ItemGuid = @configurationGuid

 

-- Remove deleted preboot configurations from the State column of the main "Preboot Configurations" object

UPDATE Item

SET [State] = replace(cast([State] as nvarchar(max)),

                '<ItemGuid>'+cast(@configurationGuid as nvarchar(36))+'</ItemGuid>',

                ''),

                           ModifiedDate = getdate()

WHERE Guid = 'CCEB6E9C-8A7F-4DEB-A94F-57DAE7C46622' -- Preboot Configurations

-- ***************

 

FETCH NEXT FROM PrebootPurge INTO @configurationGuid

END

 

CLOSE PrebootPurge

DEALLOCATE PrebootPurge

DROP TABLE #temp

Attachments