Video Screencast Help

Managed Software unable to edit Getting "Unable to generate policy XML for item: Product based usage tracking Policy" error

Created: 03 Jun 2013 • Updated: 20 Aug 2013 | 8 comments
R.Prasanna's picture
This issue has been solved. See solution.

Hi,

 

Below is the error i am getting and not able to edit any managed software........ need help to fix it

 

 

Log File Name: C:\ProgramData\Symantec\SMP\Logs\a.log
Priority: 1
Help and Support:
Date: 03-06-2013 19:32:35
Tick Count: 561782251
Host Name: xxxxxxxx
Process: w3wp (16376)
Thread ID: 36
Module: w3wp.exe
Source: Altiris.NS.AgentManagement.PolicyRequest.LoadItemPolicy
Description: Unable to generate policy XML for item: Product based usage tracking Policy. (660dae58-b89c-4e8a-9c26-ec2029b222c9)

 

( Exception Details: Altiris.NS.Exceptions.AeXException: Unable to load the specified item (GUID:Product based usage tracking Policy. (660dae58-b89c-4e8a-9c26-ec2029b222c9)) ---> System.Xml.XmlException: An error occurred while parsing EntityName. Line 5, position 41522.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseEntityName()
   at System.Xml.XmlTextReaderImpl.ParseEntityReference()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.LoadXml(String xml)
   at Altiris.NS.ItemManagement.Item.Load(Guid itemGuid)
   --- End of inner exception stack trace ---
   at Altiris.NS.ItemManagement.Item.Load(Guid itemGuid)
   at Altiris.NS.ItemManagement.Item.GetItemInternal(Guid itemGuid, IEnumerable`1 accessPermissions, ItemLoadFlags itemLoadFlags)
   at Altiris.NS.ItemManagement.Item.GetItem[T](Guid itemGuid, IEnumerable`1 accessPermissions, ItemLoadFlags itemLoadFlags)
   at Altiris.NS.ItemManagement.Item.GetItem[T](Guid itemGuid)
   at Altiris.NS.AgentManagement.PolicyRequest.LoadItemPolicy(String request, Guid requestGuid, Guid resourceGuid, Guid hostGuid, Guid policyGuid, String& policy, String& policyHash, Guid& category, Int32& priority, Boolean& canCache, ISet`1& requiredPermissions, ISet`1& filterCollections) )
( Exception logged from:
   at Altiris.Diagnostics.Logging.EventLog.ReportException(Int32 severity, String strMessage, String category, Exception exception)
   at Altiris.NS.Logging.EventLog.ReportException(Int32 severity, String strMessage, String category, Exception exception)
   at Altiris.NS.AgentManagement.PolicyRequest.LoadItemPolicy(String request, Guid requestGuid, Guid resourceGuid, Guid hostGuid, Guid policyGuid, String& policy, String& policyHash, Guid& category, Int32& priority, Boolean& canCache, ISet`1& requiredPermissions, ISet`1& filterCollections)
   at Altiris.NS.AgentManagement.PolicyRequest.LoadItemPolicies(String request, String configVers, Guid hostGuid, List`1 idents, SortedDictionary`2& policies, SortedDictionary`2& hashes)
   at Altiris.NS.AgentManagement.PolicyRequest.GetPolicies(String request)
   at Altiris.Web.NS.Agent.GetClientPolicies.ProcessRequest(String& request, Byte[]& clientConfigData, String& clientConfigXml, Boolean& compress)
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at Altiris.Common.Threading.LocalThreadPool.InvokeCallback(Object state)
   at Altiris.Common.Threading.LocalThreadPool.ExecuteUserWorkItem(UserWorkItem workItem)
   at Altiris.NS.Threading.NSThreadPool.ExecuteUserWorkItem(UserWorkItem workItem)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at Altiris.Common.Threading.LocalThreadPool.ExecuteUserWorkItemInContext(UserWorkItem workItem)
   at Altiris.Common.Threading.LocalThreadPool.ThreadPoolProc(Object threadStartParameter)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)
 )
( Extra Details:  Type=Altiris.NS.Exceptions.AeXException Src=Altiris.NS

  Inner Extra Details:  Type=System.Xml.XmlException Src=System.Xml )

Operating Systems:

Comments 8 CommentsJump to latest comment

andykn101's picture

My guess is that you have a non standard character in a name somewhere, an apostrophe, ampersand, slash or similar. If you never use non standard characters anywhere in Altiris you will lose very little and save a lot of problems.

Authorised Symantec Consultant (ASC) with Endpoint Management Limited, an Authorised Symantec Delivery Provider based in the UK.

Connect Etiquette: Please "Mark as Solution" posts that fix your problem.

R.Prasanna's picture

Hi,

Issue atarted after enabling traking for managed software ... any way to find and fix it

 

Thanks

Prasanna R

R.Prasanna's picture

from the XML i can see the below and file name is having & in it ...

 

will be the couse if so how to fix it

 

"</ProductName><ProductVersion>10.0.0</ProductVersion></MonitorItem><MonitorItem><CommandLine></CommandLine><CompanyName></CompanyName><FileName>psp.exe</FileName><FileVersion>7.05 Release Try & Buy</FileVersion><InternalName>PSP7</InternalName><KnownAs></KnownAs><Name>532DAB32-DDF2-4DBF-B4E4-3BD99D223885</Name><ProductName>Paint Shop Pro 7"

 

 

 

Thanks

Prasanna R

andykn101's picture

Ouch! I think that's the file version, not the file name.

The only workaround I can think of is to create a stand alone metering policy under Policies > Software . Application Metering.

Authorised Symantec Consultant (ASC) with Endpoint Management Limited, an Authorised Symantec Delivery Provider based in the UK.

Connect Etiquette: Please "Mark as Solution" posts that fix your problem.

R.Prasanna's picture

Hi,

 

Can't we cleare this setting from DB and remove this file assosiation ?

 

Thanks

Prasanna R

andykn101's picture

You could clear the association between the metering policy and that file on the "Meter/track usage" tab of the Software Product but then you wouldn't be monitoring the correct file. If you clear the file from the db it will just get repopulated on the next inventory.

Authorised Symantec Consultant (ASC) with Endpoint Management Limited, an Authorised Symantec Delivery Provider based in the UK.

Connect Etiquette: Please "Mark as Solution" posts that fix your problem.

Jarno's picture

Hi,

We have faced this situation two times already. From our perspective this is a product defect, apparently when a .exe installed by end users contains especial character as part the internal name or any other attribute of the .exe, the XML parser is not able to handle it properly and the hiddens policy ends up corrupted, not allowing to edit it or any product definition in any way.

We opened a trouble ticket to support quite some time ago, and we have to response as of yet. After much investigation in lab we have found you possible solutions to this issue, one would be to recover from backup, and the other is described bellow.

Do at your own risks, this is not an official solution and requires data manipulation directly in the DB, although it have worked fine for us and has caused no issues, this could cause problems in other parts of Altiris and it is unsupported:

1-Extract and save the 'state' attribute directly from the SQL DB (if in hierarchy from the top level DB). Using SQL fat client run,

select * from Item where Guid = '660dae58-b89c-4e8a-9c26-ec2029b222c9'

right click on 'state' and copy, paste in a CSV file in your local disk.

2-Edit the CSV file, find and remove the non standard characters from the .exe definition.

Continued in next post

SOLUTION
Jarno's picture

3-Import this new 'state' definition without the conflicting characters. For example:

update Item set State = '<item><hierarchyEditableProperties><hierarchyEditableProperty editable="False">ResourceTargets</hierarchyEditableProperty><hierarchyEditableProperty editable="False">Enabled</hierarchyEditableProperty></hierarchyEditableProperties><Application type="detail" stop="False" InventoryOnly="True" Denial="False"><DenialEmailAddress/><DenialEmailSubject/><DenialEmailMessage/><CompanyName/><InternalName/><FileName/><FileVersion/><ProductName/><ProductVersion/><KnownAs/><CommandLine/><DenialMessage type=""/><DenialTimes/><MonitorItems></MonitorItems></Application></item>' where Guid = '660dae58-b89c-4e8a-9c26-ec2029b222c9'

4-You should now be able to edit product definitions, completely delete the software product, otherwise it will be populated again during the nightly task, and you will be in the same situation in the following day.

Regards

SOLUTION