[NETCONF-452] NPE when adding routes to app-peer Created: 14/Aug/17  Updated: 15/Mar/19  Resolved: 13/Oct/17

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

Type: Bug
Reporter: Vratko Polak Assignee: Jakub Morvay
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Duplicate
is duplicated by NETCONF-467 Restconf often invokes RPCs with null... Resolved
External issue ID: 8988

 Description   

This is affecting Nitrogen CSIT. Robot symptom is prefixes missing [0], but the reason is visible in configurer tool log [1] and in karaf.log [2] (at 05:45:12,953):

2017-08-14 05:45:12,953 | ERROR | qtp573170128-423 | ContainerResponse | 33 - com.sun.jersey.jersey-server - 1.17.0 | The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NullPointerException
at org.opendaylight.controller.cluster.databroker.AbstractDOMBrokerWriteTransaction.checkInstanceIdentifierReferencesData(AbstractDOMBrokerWriteTransaction.java:87)
at org.opendaylight.controller.cluster.databroker.AbstractDOMBrokerWriteTransaction.put(AbstractDOMBrokerWriteTransaction.java:79)
at org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.simplePostPut(BrokerFacade.java:941)[313:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]
at org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.makeNormalPost(BrokerFacade.java:890)[313:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]
at org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.postData(BrokerFacade.java:707)[313:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]
at org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.postDataViaTransaction(BrokerFacade.java:689)[313:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]
at org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.commitConfigurationDataPost(BrokerFacade.java:468)[313:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]
at org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.createConfigurationData(RestconfImpl.java:973)[313:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]
at org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.createConfigurationData(RestconfImpl.java:920)[313:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]
at org.opendaylight.netconf.sal.restconf.impl.StatisticsRestconfServiceWrapper.createConfigurationData(StatisticsRestconfServiceWrapper.java:157)[313:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]
at org.opendaylight.netconf.sal.rest.impl.RestconfCompositeWrapper.createConfigurationData(RestconfCompositeWrapper.java:92)[313:org.opendaylight.netconf.sal-rest-connector:1.6.0.SNAPSHOT]

It is possible that this is just a consequence of the preceding BGPCEP-683 symptoms.

[0] https://logs.opendaylight.org/releng/jenkins092/bgpcep-csit-1node-userfeatures-only-nitrogen/113/log.html.gz#s1-s5-t5-k2-k2-k1-k6
[1] https://logs.opendaylight.org/releng/jenkins092/bgpcep-csit-1node-userfeatures-only-nitrogen/113/bgp_app_peer_initial_post_tc1.log.gz
[2] https://logs.opendaylight.org/releng/jenkins092/bgpcep-csit-1node-userfeatures-only-nitrogen/113/odl1_karaf.log.gz



 Comments   
Comment by Vratko Polak [ 05/Sep/17 ]

> It is possible that this is just a consequence of the preceding BGPCEP-683 symptoms.

It is not, as [3] fixes BGPCEP-683 but this symptom is still visible in gate job tool log [4].

Also, Claudio says this is a Restconf bug, so changing component.

[3] https://git.opendaylight.org/gerrit/#/c/62636/1
[4] https://logs.opendaylight.org/releng/jenkins092/bgpcep-csit-1node-gate-userfeatures-only-nitrogen/7/bgp_app_peer_initial_post_tc1.log.gz

Comment by Vratko Polak [ 05/Sep/17 ]

> gate job tool log [4].

Restconf request details copied here.

method: POST

URL: 10.29.12.209:8181/restconf/config/bgp-rib:application-rib/10.29.12.209/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/

XML data:
<ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
<ipv4-route>
<prefix>8.0.1.0/28</prefix>
<path-id>0</path-id>
<attributes>
<ipv4-next-hop>
<global>192.0.2.1</global>
</ipv4-next-hop><as-path/>
<multi-exit-disc>
<med>0</med>
</multi-exit-disc>
<local-pref>
<pref>100</pref>
</local-pref>
<originator-id>
<originator>41.41.41.41</originator>
</originator-id>
<origin>
<value>igp</value>
</origin>
<cluster-id>
<cluster>40.40.40.40</cluster>
</cluster-id>
</attributes>
</ipv4-route>
<ipv4-route>
<prefix>8.0.1.16/28</prefix>
<path-id>0</path-id>
<attributes>
<ipv4-next-hop>
<global>192.0.2.1</global>
</ipv4-next-hop><as-path/>
<multi-exit-disc>
<med>0</med>
</multi-exit-disc>
<local-pref>
<pref>100</pref>
</local-pref>
<originator-id>
<originator>41.41.41.41</originator>
</originator-id>
<origin>
<value>igp</value>
</origin>
<cluster-id>
<cluster>40.40.40.40</cluster>
</cluster-id>
</attributes>
</ipv4-route>
<ipv4-route>
<prefix>8.0.1.32/28</prefix>
<path-id>0</path-id>
<attributes>
<ipv4-next-hop>
<global>192.0.2.1</global>
</ipv4-next-hop><as-path/>
<multi-exit-disc>
<med>0</med>
</multi-exit-disc>
<local-pref>
<pref>100</pref>
</local-pref>
<originator-id>
<originator>41.41.41.41</originator>
</originator-id>
<origin>
<value>igp</value>
</origin>
<cluster-id>
<cluster>40.40.40.40</cluster>
</cluster-id>
</attributes>
</ipv4-route>
</ipv4-routes>

Comment by Vratko Polak [ 05/Sep/17 ]

I have tried to reproduce this manually, but it did not happen for me.
I think Robot suite catches ODL in some transient state before it finishes booting up.

I will continue my investigations on Sandbox.

Comment by Vratko Polak [ 05/Sep/17 ]

> I will continue my investigations on Sandbox.

When run with a logging change [5], the test passed [6].

Meanwhile, Robert proposed [7] a guard (so no increased logging as with my change), running that now.

[5] https://git.opendaylight.org/gerrit/#/c/62670/1
[6] https://logs.opendaylight.org/sandbox/jenkins091/bgpcep-csit-1node-userfeatures-only-nitrogen/1/bgp_app_peer_initial_post_tc1.log.gz
[7] https://git.opendaylight.org/gerrit/#/c/62699/1

Comment by Vratko Polak [ 06/Sep/17 ]

Testing with logging change [8] shows the reason is XML codec getting apparently empty input stream.

By "shows" I mean karaf.log [9] from sandbox contains the incriminating line:

2017-09-06 12:56:22,244 | WARN | qtp444030204-142 | XmlNormalizedNodeBodyReader | 314 - org.opendaylight.netconf.sal-rest-connector - 1.6.0.SNAPSHOT | Reading empty payload!

[8] https://git.opendaylight.org/gerrit/#/c/62752/3
[9] https://logs.opendaylight.org/sandbox/jenkins091/bgpcep-csit-1node-userfeatures-only-nitrogen/5/odl1_karaf.log.gz

Comment by Vratko Polak [ 06/Sep/17 ]

One difference from other suites is that the Restconf request is constructed by a Python utility [10] (instead of a Robot library) which sends data in chunks.
Perhaps Carbon http server was joining this chunks for Restconf, but Nitrogen passes the input stream without reading all the data?

[10] https://github.com/opendaylight/integration-test/blob/master/tools/fastbgp/bgp_app_peer.py

Comment by Martin Dindoffer [ 08/Sep/17 ]

NETCONF-467 might be a duplicate, or at least a related problem
https://bugs.opendaylight.org/show_bug.cgi?id=9125

Comment by Jakub Morvay [ 12/Sep/17 ]

(In reply to Vratko Polák from comment #6)
> One difference from other suites is that the Restconf request is constructed
> by a Python utility [10] (instead of a Robot library) which sends data in
> chunks.
> Perhaps Carbon http server was joining this chunks for Restconf, but
> Nitrogen passes the input stream without reading all the data?

Yeah, it looks like this is the case. Our implementation checks for empty payload incorrectly. In a case that the first chunk of payload's data is unavailable during processing request by our implementations of MessageBodyReader, it prematurely sorts out non-empty payload as empty payload. We read NormalizedNodeContext with null data and this ends with NPE from md-sal, because we want to store null data.

Fix for Nitrogen:
https://git.opendaylight.org/gerrit/#/c/63048/

Comment by Jakub Morvay [ 12/Sep/17 ]

Oxygen:
https://git.opendaylight.org/gerrit/#/c/63055/

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