[CONTROLLER-78] config parser failures should provide more useful error Created: 03/Dec/13  Updated: 25/Jul/23  Due: 13/Mar/14  Resolved: 03/Apr/14

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

Type: Improvement
Reporter: Ed Warnicke Assignee: Maros Marsalek
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC



 Description   

I attempted to modify the config and got the following exception on controller startup:

2013-12-03 05:44:40.535 PST [ConfigPersister-registrator] ERROR o.o.c.l.b.i.UncaughtExceptionHandler - Uncaught ExceptionHandler:
java.lang.IllegalStateException: Unable to load last config
at org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler.pushLastConfigWithRetries(ConfigPersisterNotificationHandler.java:132) ~[na:na]
at org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler.init(ConfigPersisterNotificationHandler.java:104) ~[na:na]
at org.opendaylight.controller.netconf.persist.impl.osgi.ConfigPersisterActivator$1.run(ConfigPersisterActivator.java:65) ~[na:na]
at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]
Caused by: org.xml.sax.SAXParseException: The element type "data" must be terminated by the matching end-tag "</data>".
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:251) ~[na:1.7.0_25]
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) ~[na:1.7.0_25]
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121) ~[na:1.7.0_25]
at org.opendaylight.controller.netconf.util.xml.XmlUtil.readXmlToDocument(XmlUtil.java:70) ~[na:na]
at org.opendaylight.controller.netconf.util.xml.XmlUtil.readXmlToDocument(XmlUtil.java:59) ~[na:na]
at org.opendaylight.controller.netconf.util.xml.XmlUtil.readXmlToElement(XmlUtil.java:49) ~[na:na]
at org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler.pushLastConfigWithRetries(ConfigPersisterNotificationHandler.java:125) ~[na:na]
... 3 common frames omitted

I'm not saying I got the config right... but the error should be more helpful and point to a line where the issue is.



 Comments   
Comment by Ed Warnicke [ 03/Dec/13 ]

Here is the config I used for 01-md-sal.conf:

//MODULES START
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:schema-service-singleton</type>
<name>yang-schema-service</name>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:hash-map-data-store</type>
<name>hash-map-data-store</name>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-broker-impl</type>
<name>dom-broker</name>
<data-store xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-data-store</type>
<name>ref_hash-map-data-store</name>
</data-store>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-broker-impl</type>
<name>binding-broker-impl</name>
<notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
<name>ref_binding-notification-broker</name>
</notification-service>
<data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-data-broker</type>
<name>ref_binding-data-broker</name>
</data-broker>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:runtime-generated-mapping</type>
<name>runtime-mapping-singleton</name>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-notification-broker</type>
<name>binding-notification-broker</name>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-data-broker</type>
<name>binding-data-broker</name>
<dom-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
<name>ref_dom-broker</name>
</dom-broker>
<mapping-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
<name>ref_runtime-mapping-singleton</name>
</mapping-service>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:cluster:store">prefix:dom-clustered-store-impl</type>
<name>cluster-data-store</name>
</module>
</modules>
//SERVICES START
<service>
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
<instance>
<name>ref_yang-schema-service</name>
<provider>/config/modules/module[name='schema-service-singleton']/instance[name='yang-schema-service']</provider>
</instance>
</service>
<service>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
<instance>
<name>ref_binding-notification-broker</name>
<provider>/config/modules/module[name='binding-notification-broker']/instance[name='binding-notification-broker']</provider>
</instance>
</service>
<service>
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-data-store</type>
<instance>
<name>ref_hash-map-data-store</name>
<provider>/config/modules/module[name='cluster-data-store']/instance[name='cluster-data-store']</provider>
</instance>
</service>
<service>
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-data-store</type>
<instance>
<name>ref_cluster-data-store</name>
<provider>/config/modules/module[name='hash-map-data-store']/instance[name='hash-map-data-store']</provider>
</instance>
</service>
<service>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
<instance>
<name>ref_binding-broker-impl</name>
<provider>/config/modules/module[name='binding-broker-impl']/instance[name='binding-broker-impl']</provider>
</instance>
</service>
<service>
<type xmlns:binding-impl="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding-impl:binding-dom-mapping-service</type>
<instance>
<name>ref_runtime-mapping-singleton</name>
<provider>/config/modules/module[name='runtime-generated-mapping']/instance[name='runtime-mapping-singleton']</provider>
</instance>
</service>
<service>
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
<instance>
<name>ref_dom-broker</name>
<provider>/config/modules/module[name='dom-broker-impl']/instance[name='dom-broker']</provider>
</instance>
</service>
<service>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-data-broker</type>
<instance>
<name>ref_binding-data-broker</name>
<provider>/config/modules/module[name='binding-data-broker']/instance[name='binding-data-broker']</provider>
</instance>
</service>
//CAPABILITIES START
urn:opendaylight:l2:types?module=opendaylight-l2-types&revision=2013-08-27
urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28
urn:opendaylight:params:xml:ns:yang:controller:threadpool?module=threadpool&revision=2013-04-09
urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom?module=opendaylight-md-sal-dom&revision=2013-10-28
urn:opendaylight:params:xml:ns:yang:controller:config?module=config&revision=2013-04-05
urn:ietf:params:netconf:capability:candidate:1.0
urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&revision=2010-10-04
urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor?module=netty-event-executor&revision=2013-11-12
urn:ietf:params:xml:ns:yang:rpc-context?module=rpc-context&revision=2013-06-17
urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl?module=opendaylight-sal-binding-broker-impl&revision=2013-10-28
urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2010-09-24
urn:ietf:params:netconf:capability:rollback-on-error:1.0
urn:ietf:params:xml:ns:yang:ietf-yang-types?module=ietf-yang-types&revision=2010-09-24
urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl?module=threadpool-impl&revision=2013-04-05
urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl?module=opendaylight-sal-dom-broker-impl&revision=2013-10-28
urn:opendaylight:yang:extension:yang-ext?module=yang-ext&revision=2013-07-09
urn:opendaylight:params:xml:ns:yang:iana?module=iana&revision=2013-08-16
urn:opendaylight:params:xml:ns:yang:controller:md:sal:common?module=opendaylight-md-sal-common&revision=2013-10-28
urn:opendaylight:params:xml:ns:yang:ieee754?module=ieee754&revision=2013-08-19
urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:cluster:store?module=odl-sal-dom-clustered-store-cfg&revision=2013-10-28

Comment by Ed Warnicke [ 03/Dec/13 ]

Another unhelpful error:

2013-12-03 05:53:40.955 PST [Start Level Event Dispatcher] INFO o.o.c.s.dom.broker.SchemaServiceImpl - SchemaService updated to new consistent state
2013-12-03 05:53:42.118 PST [ConfigPersister-registrator] INFO o.o.c.n.p.i.ConfigPersisterNotificationHandler - Session id received from netconf server: 2
[Fatal Error] :72:7: The element type "data" must be terminated by the matching end-tag "</data>".
2013-12-03 05:53:42.126 PST [ConfigPersister-registrator] ERROR o.o.c.l.b.i.UncaughtExceptionHandler - Uncaught ExceptionHandler:
java.lang.IllegalStateException: Unable to load last config
at org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler.pushLastConfigWithRetries(ConfigPersisterNotificationHandler.java:132) ~[na:na]
at org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler.init(ConfigPersisterNotificationHandler.java:104) ~[na:na]
at org.opendaylight.controller.netconf.persist.impl.osgi.ConfigPersisterActivator$1.run(ConfigPersisterActivator.java:65) ~[na:na]
at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]
Caused by: org.xml.sax.SAXParseException: The element type "data" must be terminated by the matching end-tag "</data>".
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:251) ~[na:1.7.0_25]
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300) ~[na:1.7.0_25]
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121) ~[na:1.7.0_25]
at org.opendaylight.controller.netconf.util.xml.XmlUtil.readXmlToDocument(XmlUtil.java:70) ~[na:na]
at org.opendaylight.controller.netconf.util.xml.XmlUtil.readXmlToDocument(XmlUtil.java:59) ~[na:na]
at org.opendaylight.controller.netconf.util.xml.XmlUtil.readXmlToElement(XmlUtil.java:49) ~[na:na]
at org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler.pushLastConfigWithRetries(ConfigPersisterNotificationHandler.java:125) ~[na:na]
... 3 common frames omitted

Comment by Ed Warnicke [ 03/Dec/13 ]

The above error from this slightly corrected config:
//MODULES START
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:schema-service-singleton</type>
<name>yang-schema-service</name>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:hash-map-data-store</type>
<name>hash-map-data-store</name>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-broker-impl</type>
<name>dom-broker</name>
<data-store xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-data-store</type>
<name>ref_hash-map-data-store</name>
</data-store>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-broker-impl</type>
<name>binding-broker-impl</name>
<notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
<name>ref_binding-notification-broker</name>
</notification-service>
<data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-data-broker</type>
<name>ref_binding-data-broker</name>
</data-broker>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:runtime-generated-mapping</type>
<name>runtime-mapping-singleton</name>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-notification-broker</type>
<name>binding-notification-broker</name>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-data-broker</type>
<name>binding-data-broker</name>
<dom-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
<name>ref_dom-broker</name>
</dom-broker>
<mapping-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
<name>ref_runtime-mapping-singleton</name>
</mapping-service>
</module>
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:cluster:store">prefix:dom-clustered-store-impl</type>
<name>cluster-data-store</name>
</module>
</modules>
//SERVICES START
<service>
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
<instance>
<name>ref_yang-schema-service</name>
<provider>/config/modules/module[name='schema-service-singleton']/instance[name='yang-schema-service']</provider>
</instance>
</service>
<service>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
<instance>
<name>ref_binding-notification-broker</name>
<provider>/config/modules/module[name='binding-notification-broker']/instance[name='binding-notification-broker']</provider>
</instance>
</service>
<service>
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-data-store</type>
<instance>
<name>ref_cluster-data-store</name>
<provider>/config/modules/module[name='cluster-data-store']/instance[name='cluster-data-store']</provider>
</instance>
</service>
<service>
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-data-store</type>
<instance>
<name>ref_hash-map-data-store</name>
<provider>/config/modules/module[name='hash-map-data-store']/instance[name='hash-map-data-store']</provider>
</instance>
</service>
<service>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
<instance>
<name>ref_binding-broker-impl</name>
<provider>/config/modules/module[name='binding-broker-impl']/instance[name='binding-broker-impl']</provider>
</instance>
</service>
<service>
<type xmlns:binding-impl="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding-impl:binding-dom-mapping-service</type>
<instance>
<name>ref_runtime-mapping-singleton</name>
<provider>/config/modules/module[name='runtime-generated-mapping']/instance[name='runtime-mapping-singleton']</provider>
</instance>
</service>
<service>
<type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
<instance>
<name>ref_dom-broker</name>
<provider>/config/modules/module[name='dom-broker-impl']/instance[name='dom-broker']</provider>
</instance>
</service>
<service>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-data-broker</type>
<instance>
<name>ref_binding-data-broker</name>
<provider>/config/modules/module[name='binding-data-broker']/instance[name='binding-data-broker']</provider>
</instance>
</service>
//CAPABILITIES START
urn:opendaylight:l2:types?module=opendaylight-l2-types&revision=2013-08-27
urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28
urn:opendaylight:params:xml:ns:yang:controller:threadpool?module=threadpool&revision=2013-04-09
urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom?module=opendaylight-md-sal-dom&revision=2013-10-28
urn:opendaylight:params:xml:ns:yang:controller:config?module=config&revision=2013-04-05
urn:ietf:params:netconf:capability:candidate:1.0
urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&revision=2010-10-04
urn:opendaylight:params:xml:ns:yang:controller:netty:eventexecutor?module=netty-event-executor&revision=2013-11-12
urn:ietf:params:xml:ns:yang:rpc-context?module=rpc-context&revision=2013-06-17
urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl?module=opendaylight-sal-binding-broker-impl&revision=2013-10-28
urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2010-09-24
urn:ietf:params:netconf:capability:rollback-on-error:1.0
urn:ietf:params:xml:ns:yang:ietf-yang-types?module=ietf-yang-types&revision=2010-09-24
urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl?module=threadpool-impl&revision=2013-04-05
urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl?module=opendaylight-sal-dom-broker-impl&revision=2013-10-28
urn:opendaylight:yang:extension:yang-ext?module=yang-ext&revision=2013-07-09
urn:opendaylight:params:xml:ns:yang:iana?module=iana&revision=2013-08-16
urn:opendaylight:params:xml:ns:yang:controller:md:sal:common?module=opendaylight-md-sal-common&revision=2013-10-28
urn:opendaylight:params:xml:ns:yang:ieee754?module=ieee754&revision=2013-08-19
urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:cluster:store?module=odl-sal-dom-clustered-store-cfg&revision=2013-10-28

Comment by Tomas Olvecky [ 03/Apr/14 ]

I believe this is fixed now

Generated at Wed Feb 07 19:52:07 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.