[NETCONF-488] We call rpc addNetconfNode by restconf,attribute TcpOnly is default,After write datastore,the TcpOnly is null in datastore Created: 25/Nov/17  Updated: 05/Feb/19  Resolved: 05/Feb/19

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: None
Fix Version/s: Sodium

Type: Bug Priority: Medium
Reporter: Geng Xingyuan Assignee: Jakub Morvay
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

2017-11-24 17:45:05,855 | ERROR | on-dispatcher-51 | DataTreeChangeListenerActor | 199 - org.opendaylight.controller.sal-clustering-commons - 1.6.0 | member-1-shard-topology-config: Error notifying listener org.opendaylight.netconf.topology.impl.NetconfTopologyImpl@1c1e15a9
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:782)[71:com.google.guava:22.0.0]
at org.opendaylight.netconf.topology.AbstractNetconfTopology.setupConnection(AbstractNetconfTopology.java:224)[344:netconf-topology-config:1.3.0]
at org.opendaylight.netconf.topology.AbstractNetconfTopology.connectNode(AbstractNetconfTopology.java:200)[344:netconf-topology-config:1.3.0]
at org.opendaylight.netconf.topology.impl.NetconfTopologyImpl.onDataTreeChanged(NetconfTopologyImpl.java:125)[344:netconf-topology-config:1.3.0]
at org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataTreeChangeListenerAdapter.onDataTreeChanged(BindingDOMDataTreeChangeListenerAdapter.java:41)[193:org.opendaylight.controller.sal-binding-broker-impl:1.6.0]
at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.dataChanged(DataTreeChangeListenerActor.java:67)[206:org.opendaylight.controller.sal-distributed-datastore:1.6.0]
at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.handleReceive(DataTreeChangeListenerActor.java:41)[206:org.opendaylight.controller.sal-distributed-datastore:1.6.0]
at org.opendaylight.controller.cluster.common.actor.AbstractUntypedActor.onReceive(AbstractUntypedActor.java:38)[199:org.opendaylight.controller.sal-clustering-commons:1.6.0]



 Comments   
Comment by Geng Xingyuan [ 25/Nov/17 ]

Can modify method encryptPassword(AddNetconfNodeInput input)   in NetconfTopologyRPCProvider.java

add 

builder.setTcpOnly(null == input.isTcpOnly()?false:input.isTcpOnly());  

at line 66.

Comment by Tomas Cere [ 27/Nov/17 ]

Feel free to submit a patch

Comment by Robert Varga [ 28/Aug/18 ]

xygeng any update on this issue?

Comment by Jakub Morvay [ 04/Feb/19 ]

Actually I checked netconf-node-topology model and tcp-only leaf does not have any default value. So I am not sure why do you expect such behavior from NetconfTopologyRPCProvider (the class that implements and provides add-device RPC).

On the other hand I think that tcp-only leaf should have some default value and it should default to false. We want to use more secure protocol by default.

I created a patch that does this. It should also solve that NPE you saw when calling add-device RPC without tcp-only node defined.

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