[GENIUS-59] NullPointerException at org.opendaylight.genius.interfacemanager.rpcservice.InterfaceManagerRpcService.getDpnInterfaceList Created: 16/Mar/17  Updated: 07/Jun/17  Resolved: 07/Jun/17

Status: Resolved
Project: genius
Component/s: General
Affects Version/s: (unspecified)
Fix Version/s: None

Type: Bug
Reporter: Michael Vorburger Assignee: Miguel Perez
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


External issue ID: 8008

 Description   

I regularly hit the following NPE when "playing around" - I think it's when I have a running ODL & devstack, and stop the Karaf and restart it, something doesn't quite go the way it expects:

2017-03-16 18:16:43,008 | WARN | eChangeHandler-0 | TunnelInterfaceStateListener | 365 - org.opendaylight.netvirt.vpnmanager-impl - 0.4.0.SNAPSHOT | Exception when querying for GetDpnInterfaceList for dpnid 73240449055560
java.lang.NullPointerException
at org.opendaylight.genius.interfacemanager.rpcservice.InterfaceManagerRpcService.getDpnInterfaceList(InterfaceManagerRpcService.java:491)[357:org.opendaylight.genius.interfacemanager-impl:0.2.0.SNAPSHOT]
at org.opendaylight.yangtools.yang.binding.util.RpcMethodInvokerWithInput.invokeOn(RpcMethodInvokerWithInput.java:31)[74:org.opendaylight.mdsal.yang-binding:0.10.0.SNAPSHOT]
at org.opendaylight.yangtools.yang.binding.util.AbstractMappedRpcInvoker.invokeRpc(AbstractMappedRpcInvoker.java:52)[74:org.opendaylight.mdsal.yang-binding:0.10.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcImplementationAdapter.invoke(BindingDOMRpcImplementationAdapter.java:85)[173:org.opendaylight.controller.sal-binding-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcImplementationAdapter.invokeRpc(BindingDOMRpcImplementationAdapter.java:72)[173:org.opendaylight.controller.sal-binding-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.dom.broker.impl.GlobalDOMRpcRoutingTableEntry.invokeRpc(GlobalDOMRpcRoutingTableEntry.java:39)[171:org.opendaylight.controller.sal-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRoutingTable.invokeRpc(DOMRpcRoutingTable.java:177)[171:org.opendaylight.controller.sal-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRouter.invokeRpc(DOMRpcRouter.java:102)[171:org.opendaylight.controller.sal-broker-impl:1.5.0.SNAPSHOT]
at Proxy72e63eb6_e1b9_4b09_a6fc_36aa34e5f4cd.invokeRpc(Unknown Source)[:]
at Proxy1ab30bfb_17bc_4868_aac8_f3c06f8608a3.invokeRpc(Unknown Source)[:]
at org.opendaylight.controller.md.sal.binding.impl.RpcServiceAdapter.invoke0(RpcServiceAdapter.java:65)[173:org.opendaylight.controller.sal-binding-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.binding.impl.RpcServiceAdapter.access$000(RpcServiceAdapter.java:43)[173:org.opendaylight.controller.sal-binding-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.binding.impl.RpcServiceAdapter$RpcInvocationStrategy.invoke(RpcServiceAdapter.java:159)[173:org.opendaylight.controller.sal-binding-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.binding.impl.RpcServiceAdapter.invoke(RpcServiceAdapter.java:96)[173:org.opendaylight.controller.sal-binding-broker-impl:1.5.0.SNAPSHOT]
at com.sun.proxy.$Proxy135.getDpnInterfaceList(Unknown Source)[329:org.opendaylight.genius.interfacemanager-api:0.2.0.SNAPSHOT]
at org.opendaylight.netvirt.vpnmanager.TunnelInterfaceStateListener.handleTunnelEventForDPN(TunnelInterfaceStateListener.java:201)[365:org.opendaylight.netvirt.vpnmanager-impl:0.4.0.SNAPSHOT]
at org.opendaylight.netvirt.vpnmanager.TunnelInterfaceStateListener.add(TunnelInterfaceStateListener.java:136)[365:org.opendaylight.netvirt.vpnmanager-impl:0.4.0.SNAPSHOT]
at org.opendaylight.netvirt.vpnmanager.TunnelInterfaceStateListener.add(TunnelInterfaceStateListener.java:50)[365:org.opendaylight.netvirt.vpnmanager-impl:0.4.0.SNAPSHOT]
at org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase$DataTreeChangeHandler.run(AsyncDataTreeChangeListenerBase.java:153)[326:org.opendaylight.genius.mdsalutil-api:0.2.0.SNAPSHOT]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]



 Comments   
Comment by Michael Vorburger [ 20/Mar/17 ]

> org.opendaylight.genius.interfacemanager.rpcservice.InterfaceManagerRpcService.getDpnInterfaceList(InterfaceManagerRpcService.java:491)

InterfaceManagerRpcService on current master already changed significantly, and it's hard to match the line number just a few days later.. I'll have to update this with the new line number (and immediately check what is null) when I see this happen next.

Comment by Michael Vorburger [ 06/Apr/17 ]

It would be great if the fix for this could be covered by a new JUnit!

Comment by Michael Vorburger [ 06/Jun/17 ]

Changed from Status resolved Fixed by Faesela to WORKSFORME (= can't reproduce).

Comment by Miguel Perez [ 07/Jun/17 ]

I did hit it too and pushed a change to gerrit:
https://git.opendaylight.org/gerrit/#/c/58351/

Now, NPE is thrown from line 403:

return Futures.immediateFuture(rpcResultBuilder.build());

There are other sentences like that in the class that are potential NPEs too.

017-06-06 15:53:35,773 | TRACE | eChangeHandler-0 | TunnelInterfaceStateListener | 450 - org.opendaylight.netvirt.vpnmanager-impl - 0.4.0.SNAPSHOT | ITM Tunnel ,type VXLAN ,added between src: 121158375352128 and dest: 20779713299791
2017-06-06 15:53:35,775 | TRACE | eChangeHandler-0 | TunnelInterfaceStateListener | 450 - org.opendaylight.netvirt.vpnmanager-impl - 0.4.0.SNAPSHOT | Handle tunnel event for srcDpn 121158375352128 SrcTepIp 192.168.2.3 DestTepIp 192.168.2.4
2017-06-06 15:53:35,775 | TRACE | eChangeHandler-0 | TunnelInterfaceStateListener | 450 - org.opendaylight.netvirt.vpnmanager-impl - 0.4.0.SNAPSHOT | tunTypeVal is 1
2017-06-06 15:53:35,775 | TRACE | eChangeHandler-0 | TunnelInterfaceStateListener | 450 - org.opendaylight.netvirt.vpnmanager-impl - 0.4.0.SNAPSHOT | Tunnel ADD event received for Dpn 121158375352128 VTEP Ip 192.168.2.3
2017-06-06 15:53:35,776 | TRACE | nPool-2-worker-0 | edEgressServicesConfigBindHelper | 442 - org.opendaylight.genius.interfacemanager-impl - 0.2.0.SNAPSHOT | Installing egress dispatcher table entry for existing service BoundServices{getServiceName=default.tunf0c1711eb97, getServicePriority=9, getServiceType=class org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceTypeFlowBased, augmentations={interface org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflow=StypeOpenflow{getFlowCookie=134217735, getFlowPriority=9, getInstruction=[Instruction{getInstruction=ApplyActionsCase{getApplyActions=ApplyActions{getAction=[Action{getAction=OutputActionCase{getOutputAction=OutputAction{getMaxLength=0, getOutputNodeConnector=Uri [_value=1], augmentations={}}, augmentations={}}, getOrder=0, augmentations={}}], augmentations={}}, augmentations={}}, getOrder=0, augmentations={}}]}}} service match on service index 9 update with service index 10
2017-06-06 15:53:35,776 | DEBUG | nPool-2-worker-0 | FlowBasedServicesUtils | 442 - org.opendaylight.genius.interfacemanager-impl - 0.2.0.SNAPSHOT | Installing Egress Dispatcher Flows on dpn : 121158375352128, for interface : tunf0c1711eb97
2017-06-06 15:53:35,776 | DEBUG | nPool-2-worker-0 | FlowBasedServicesUtils | 442 - org.opendaylight.genius.interfacemanager-impl - 0.2.0.SNAPSHOT | Installing Egress Dispatcher Flow for interface : tunf0c1711eb97, with flow-ref : 121158375352128220.tunf0c1711eb97.9
2017-06-06 15:53:35,777 | TRACE | nPool-2-worker-0 | edEgressServicesConfigBindHelper | 442 - org.opendaylight.genius.interfacemanager-impl - 0.2.0.SNAPSHOT | Installing egress dispatcher table entry for new service match on service index 0 update with service index 9
2017-06-06 15:53:35,777 | DEBUG | nPool-2-worker-0 | FlowBasedServicesUtils | 442 - org.opendaylight.genius.interfacemanager-impl - 0.2.0.SNAPSHOT | Installing Egress Dispatcher Flows on dpn : 121158375352128, for interface : tunf0c1711eb97
2017-06-06 15:53:35,779 | WARN | eChangeHandler-0 | TunnelInterfaceStateListener | 450 - org.opendaylight.netvirt.vpnmanager-impl - 0.4.0.SNAPSHOT | Exception when querying for GetDpnInterfaceList for dpnid 121158375352128
java.lang.NullPointerException
at org.opendaylight.genius.interfacemanager.rpcservice.InterfaceManagerRpcService.getDpnInterfaceList(InterfaceManagerRpcService.java:403)[442:org.opendaylight.genius.interfacemanager-impl:0.2.0.SNAPSHOT]
at org.opendaylight.yangtools.yang.binding.util.RpcMethodInvokerWithInput.invokeOn(RpcMethodInvokerWithInput.java:31)[132:org.opendaylight.mdsal.yang-binding:0.10.0.SNAPSHOT]
at org.opendaylight.yangtools.yang.binding.util.AbstractMappedRpcInvoker.invokeRpc(AbstractMappedRpcInvoker.java:52)[132:org.opendaylight.mdsal.yang-binding:0.10.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcImplementationAdapter.invoke(BindingDOMRpcImplementationAdapter.java:83)[213:org.opendaylight.controller.sal-binding-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcImplementationAdapter.invokeRpc(BindingDOMRpcImplementationAdapter.java:70)[213:org.opendaylight.controller.sal-binding-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.dom.broker.impl.GlobalDOMRpcRoutingTableEntry.invokeRpc(GlobalDOMRpcRoutingTableEntry.java:39)[211:org.opendaylight.controller.sal-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRoutingTable.invokeRpc(DOMRpcRoutingTable.java:177)[211:org.opendaylight.controller.sal-broker-impl:1.5.0.SNAPSHOT]
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRouter.invokeRpc(DOMRpcRouter.java:102)[211:org.opendaylight.controller.sal-broker-impl:1.5.0.SNAPSHOT]
at Proxyc1bb3bf6_2294_4a57_bf59_2bea9dc23080.invokeRpc(Unknown Source)[:]
at Proxyde4d7a0c_2be9_44cb_87a4_e5948d28e6c1.invokeRpc(Unknown Source)[:]

Comment by Faseela K [ 07/Jun/17 ]

Thanks Miguel..will review the changes.
Edwin was not able to reproduce the issue and hence the bug status was changed

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