[NETCONF-790] Restconf fails to handle non-existent data Created: 13/Jul/21  Updated: 13/Jul/21  Resolved: 13/Jul/21

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: 2.0.0
Fix Version/s: 2.0.1

Type: Bug Priority: Highest
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

This is detected by https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/bgpcep-csit-1node-userfeatures-all-phosphorus/91/odl_1/odl1_karaf.log.gz where we get:

2021-07-07T18:27:00,946 | INFO  | qtp2139318170-336 | RestconfImpl                     | 398 - org.opendaylight.netconf.restconf-nb-bierman02 - 2.0.0 | Location for instance identifier /(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)application-rib/application-rib[{(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)id=127.0.0.12}]/tables/tables[{(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)afi=(urn:opendaylight:params:xml:ns:yang:bgp-types?revision=2020-01-20)ipv6-address-family, (urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)safi=(urn:opendaylight:params:xml:ns:yang:bgp-types?revision=2020-01-20)unicast-subsequent-address-family}]/routes/(urn:opendaylight:params:xml:ns:yang:bgp-inet?revision=2018-03-29)ipv6-routes/ipv6-route/ipv6-route[{(urn:opendaylight:params:xml:ns:yang:bgp-inet?revision=2018-03-29)route-key=1:1:1::1/128, (urn:opendaylight:params:xml:ns:yang:bgp-inet?revision=2018-03-29)path-id=1}] was not created
com.google.common.base.VerifyException: No child matching (urn:opendaylight:params:xml:ns:yang:bgp-inet?revision=2018-03-29)ipv6-routes found
	at com.google.common.base.Verify.verify(Verify.java:124) ~[bundleFile:?]
	at com.google.common.base.Verify.verifyNotNull(Verify.java:500) ~[bundleFile:?]
	at org.opendaylight.yangtools.yang.model.api.DataNodeContainer.getDataChildByName(DataNodeContainer.java:84) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.restconf.impl.ControllerContext.dataNodeChildByQName(ControllerContext.java:506) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.restconf.impl.ControllerContext.childByQName(ControllerContext.java:474) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.restconf.impl.ControllerContext.childByQName(ControllerContext.java:494) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.restconf.impl.ControllerContext.toFullRestconfIdentifier(ControllerContext.java:309) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.resolveLocation(RestconfImpl.java:1001) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.createConfigurationData(RestconfImpl.java:983) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.createConfigurationData(RestconfImpl.java:909) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.restconf.impl.StatisticsRestconfServiceWrapper.createConfigurationData(StatisticsRestconfServiceWrapper.java:161) ~[bundleFile:?]
	at org.opendaylight.netconf.sal.rest.impl.RestconfCompositeWrapper.createConfigurationData(RestconfCompositeWrapper.java:86) ~[bundleFile:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

This boils down to porting damage with yangtools-7, as the semantics of getDataChildByName() has changed to force existence. I think this was hidden by the sheer deprecation warnings in bierman02.

Audit all callers of getDataChildByName() and convert them as appropriate.


Generated at Wed Feb 07 20:15:54 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.