[CONTROLLER-1619] Better error logging for blueprint config parsing errors Created: 22/Mar/17  Updated: 25/Jul/23  Resolved: 14/Nov/18

Status: Resolved
Project: controller
Component/s: blueprint
Affects Version/s: None
Fix Version/s: None

Type: Improvement
Reporter: Sam Hague Assignee: Robert Varga
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: File karaf.log.tar.xz    

 Comments   
Comment by Sam Hague [ 22/Mar/17 ]

The following error came out when a clustered-app-config config.xml file was parsed. The reason the parse failed was because a tag in the config.xml was not defined in the yang. It would be helpful if the error had listed the tag that failed to be parsed. The failing config.xml is also below and the tag was auto-bridge-create.

2017-03-22 17:07:35,931 | ERROR | rint Extender: 2 | ServiceRecipe | 15 - org.apache.aries.blueprint.core - 1.6.1 | Error retrieving service from ServiceRecipe[name='.component-1']
org.osgi.service.blueprint.container.ComponentDefinitionException: org.opendaylight.netvirt.elanmanager-impl (elanConfig): Could not read/parse app config file etc/opendaylight/datastore/initial/config/netvirt-elanmanager-config.xml

auto-create-bridge was not defined in the yang:

<elanmanager-config xmlns="urn:opendaylight:netvirt:elan:config">
<auto-create-bridge>true</auto-create-bridge>
<int-bridge-gen-mac>true</int-bridge-gen-mac>
<temp-smac-learn-timeout>10</temp-smac-learn-timeout>
<controller-max-backoff>100000</controller-max-backoff>
<controller-inactivity-probe>300000</controller-inactivity-probe>
</elanmanager-config>

Comment by Vratko Polak [ 23/Mar/17 ]

> ServiceRecipe[name='.component-1']

Anyone fixing this, can you look also how your changes affect CONTROLLER-1540?

Comment by Tom Pantelis [ 04/Jul/17 ]

It should log the underlying exception as well that should contain the informative error info. Either way the clustered-app-config just propagates the error so the error reporting would have to be addressed in the underlying parsing code.

Comment by Robert Varga [ 14/Nov/18 ]

tpantelis what are the enxt steps on this?

Comment by Tom Pantelis [ 14/Nov/18 ]

See my prior comment from July.

Comment by Robert Varga [ 14/Nov/18 ]

Ah, now I see, sorry about that. shague do you by any chance have the full exception somewhere?

Comment by Sam Hague [ 14/Nov/18 ]

no I don't have the original log, this was on a downstream job that had a bad config.xml file and blew up.

I did recreate the original scenario by adding a undefined tag and attached that karaf log on a neon build and the problem is fixed. The output is what was requested. since the original bug was filed we moved to blueprint annotations so maybe that had an impact.

2018-11-14T16:40:24,395 | ERROR | Blueprint Extender: 1 | AbstractFuture                   | 82 - com.google.guava - 25.1.0.jre | RuntimeException while executing runnable CallbackListener{org.opendaylight.controller.blueprint.ext.DataStoreAppConfigMetadata$1@7888a2f} with executor MoreExecutors.directExecutor()
java.lang.IllegalStateException: Schema for node with name auto-create-bridge2 and namespace urn:opendaylight:netvirt:elan:config does not exist at AbsoluteSchemaPath{path=[(urn:opendaylight:netvirt:elan:config?revision=2015-07-10)elan-config]}
	at com.google.common.base.Preconditions.checkState(Preconditions.java:842) ~[82:com.google.guava:25.1.0.jre]
	at org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream.read(XmlParserStream.java:364) ~[?:?]
	at org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream.parse(XmlParserStream.java:186) ~[?:?]
	at org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream.traverse(XmlParserStream.java:216) ~[?:?]
	at org.opendaylight.controller.blueprint.ext.BindingContext.parseDataElement(BindingContext.java:93) ~[?:?]
	at org.opendaylight.controller.blueprint.ext.DataStoreAppConfigDefaultXMLReader.parsePossibleDefaultA
Generated at Wed Feb 07 19:56:00 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.