search cancel

Unable to delete an item from the SMP Console

book

Article ID: 202150

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

The customer has some old items (like a report or folder) on his SMP Console that he wants to delete. When he tries to delete it, he gets an message that the object can't be deleted. This item doesn't have a dependency as far as we can tell.

The NS logs may show an error like this one:

Unable to delete the specified item: 9685ffef-6d8e-4ccb-8414-20aaa16b0b1b

Could not verify that newly created instance 7f99312f-5a60-4836-a3f7-9b97b3a43d7a was of all expected types.
   [Altiris.NS.Exceptions.AeXException @ Altiris.Reporting.Common]
   at Altiris.Reporting.Common.RegisteredImplementation.CreateAndVerify()
   at Altiris.Reporting.ReportManagementItem.get_Report()
   at Altiris.Reporting.ReportManagementItem.OnDelete()
   at Altiris.NS.ItemManagement.Item.Delete()
   at Altiris.NS.ItemManagement.Item.<>c__DisplayClass403_0.<DeleteItem>b__0(IDatabaseContext ctx)
   at Altiris.NS.ContextManagement.AdminDatabaseContext.<>c__DisplayClass31_0`1.<PerformWithDeadlockRetry>b__0(IDatabaseContext ctx)
   at Altiris.Database.DatabaseContext`1.RetryAction(Int32 retries, Boolean transacted, Getter`1 getContext, Action`1 action, Action`1 retry, DeadlockRetryArgs& re, Exception& exception, Boolean inTransaction)
   at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetryHelper(Int32 retries, Boolean inTransaction, Getter`1 getContext, Action`1 action, Action`1 retry, Boolean transacted)
   at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetry(Int32 retries, Boolean startNewTransaction, Nullable`1 isolationLevel, Boolean independentContext, Action`1 action, Action`1 retry)
   at Altiris.NS.ItemManagement.Item.DeleteItem(Guid itemGuid, ItemLoadFlags flags, Boolean forceKill)
   at Altiris.NS.ItemManagement.ItemToDeleteSchedule.DeleteItems()

Failed to read the configuration from XML.
   [Altiris.Reporting.Common.Exceptions.ReportSerializationException @ Altiris.Reporting]
   at Altiris.Reporting.Report.FromXml(XmlNode node)
   at Altiris.Reporting.Common.RegisteredImplementation.Init(IPersistXml instance)
   at Altiris.Reporting.Common.RegisteredImplementation.CreateAndVerify()

The specified GUID does not refer to a registered class: 891d9058-6b53-4a59-8aff-cf9b4ba13976
   [Altiris.NS.Exceptions.AeXException @ Altiris.NS]
   at Altiris.NS.ClassActivator.Reload(Guid classGuid, Boolean throwOnError)
   at Altiris.NS.ClassActivator.GetType(Guid classGuid, String assemblyName, String typeName, Boolean throwOnError)
   at Altiris.NS.ClassActivator.CreateInstance(Guid classGuid, Object[] parameters)
   at Altiris.Parameters.Parameter.FromXml(XmlNode xmlNode)
   at Altiris.Parameters.Parameter.Load(XmlNode xmlNode, IParameterParent parent, Boolean throwOnException)
   at Altiris.Reporting.Report.FromXml(XmlNode node)

Cause

Bad references to objects that were deleted in the past but still attach to the item that is failing to be deleted.

Environment

ITMS 8.0, 8.1, 8.5

Resolution

Please try the following steps (just replace the query with the GUID for the item that you want to delete):

1. Find the GUIDs that you want to delete on the SMP Console (select the item and Right-click>Properties)

2. Then, place the GUID in the following queries and run them:

--Change the item attribute
update Item
set Attributes = 0
where Guid = 'Guid here'


--find dependencies
select i.Name, i2.Name, ir.Hint, ir.* from ItemReference ir 
left join Item i on i.Guid = ir.ParentItemGuid
left join Item i2 on i2.Guid = ir.ChildItemGuid
where ParentItemGuid = 'Guid here'
OR ChildItemGuid = 'Guid here'


--Delete references from ItemReference table
delete from ItemReference
where ParentItemGuid = 'Guid here'
or ChildItemGuid = 'Guid here'


--Insert item into ItemToDelete table and let the delete framework to remove any other reference
insert into 
ItemToDelete (Guid, DeleteDate)
values ('Guid here', GETDATE ())

3. Run NS.Quarter-Hour scheduled task on your SMP server.

Attachments