ZCM Bundles with Edit INI File Action " Modify Section " are failing to modify the INI file, error: 'Unable to build AST for file...'

  • 7011976
  • 19-Mar-2013
  • 19-Mar-2013

Environment

Novell ZENworks Configuration Management 11.1 Bundles
Novell ZENworks Configuration Management 11.2 Bundles

Situation

ZCM Bundles with Edit INI File Action " Modify Section " are failing to modify the INI file.
 
Error:
 
"Exception occurred while making the textfile modification: Unable to build AST for file - C:\<path>\<filename>"
 

"Fehler beim Durchführen der Aktion "Edit INI File Action". Die Fehlermeldung lautet - "Exception occurred while making the textfile modification: Unable to build AST for file - C:\<path>\<filename>"

Resolution

When creating the Edit INI Action in ZENworks Control Center (ZCC), create action with "Encoding" type specific to the file type (Unicode for the reported failure), or recreate the file (locally) with the same text and expected BOM (Byte Order Mark) character, then the 'Auto Detect' option will work.

Cause

With 'Auto Detect' selected, the INI parser expects BOM character to be present and it was not in the file.

Additional Information

This is working as designed (WAD) when 'Auto Detect' is selected.  If the file does not contain any BOM characters ZCM code is not able to identify the proper encoding type, and will use Windows default encoding to encode the file, which leads to this exception while parsing the file lacking the BOM character.