CCA Parser errors with a value containing newlines

book

Article ID: 126338

calendar_today

Updated On:

Products

CENDURA

Issue/Introduction

Parsing a name value file that has the value that contains newlines, the parser will error out with the following in the cca.log:
com.ca.acm.server.parse.YaccParser (YaccParser.java:151) - parser error: line ### column ## text [
] (syntax error)
com.ca.acm.server.parse.ParserEngine (ParserEngine.java:200) - File cant be parsed... Parser: com.ca.acm.server.parse.parser.NVCommentedParser Lexer: com.ca.acm.server.parse.lexer.NVHashLexer

The format of a typical name-value is :
myName = myValue

The wrapping of a newline would show:
myName = myValue1,
   myValue2,
   myValue3,
   myValue4

 

Environment

This has been seen in the main.cf file on Redhat, but can also apply to other similar formations

Resolution

In the OOTB Redhat Blueprint (Red hat Enterprise Linux Server), the Configuration --> File Parsing --> main.cf has the structure class set to "RHEL Configuration Files v2".
  1. In order to make any changes to the OOTB Blueprints, you need to make a copy of it and modify the copy (optionally, disable the OOTB blueprint to avoid a double discovery)
  2. Once the copy is made, go to Blueprints --> Structure Classes and find "RHEL Configuration Files v2".  Checkbox it and do "Select Actions" --> "Copy Structure Class" --> name it as you please
  3. Modify that Structure class to change the parser from "Generic Name-Value Configuration" to "Apache HTTP Configuration Parser"
  4. Save the Structure
  5. Proceed back to the newly copied blueprint -->  Configuration --> File Parsing --> main.cf
  6. Change the structure class from "RHEL Configuration Files v2" to the newly named one you created
  7. Save the setting