Hi all,
I am working on Boron release and am trying to call user difined RPC in netconf
device using odl Restconf.
The URI being used is
http://localhost:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/my/yang-ext:mount/myos-op:ping
Method :POST
Body :
{
"input" :
{
"myos-op:host" : "192.168.128.96",
"myos-op:count":"5"
}
}
The request fails with following error response :
{
"errors":{
"error":[
{
"error-type":"application",
"error-tag":"operation-failed",
"error-message":"The operation encountered an
unexpected error while executing.",
"error-info":"java.lang.IllegalStateException: Unknown
child(ren) node(s) detected, identified by:
(urn:ietf:params:xml:ns:netconf:base:1.0)ok, in: RPC Output output\n\tat
com.google.common.base.Preconditions.checkState(Preconditions.java:197)\n\tat
org.opendaylight.yangtools.yang.data.impl.schema.SchemaUtils.findSchemaForChild(SchemaUtils.java:109)\n\tat
org.opendaylight.yangtools.yang.data.impl.schema.SchemaUtils.findSchemaForChild(SchemaUtils.java:91)\n\tat
org.opendaylight.yangtools.yang.data.impl.schema.SchemaUtils.findSchemaForChild(SchemaUtils.java:97)\n\tat
org.opendaylight.yangtools.yang.data.impl.schema.transform.base.parser.ContainerNodeBaseParser.getSchemaForChild(ContainerNodeBaseParser.java:57)\n\tat
org.opendaylight.yangtools.yang.data.impl.schema.transform.base.parser.ContainerNodeBaseParser.getSchemaForChild(ContainerNodeBaseParser.java:29)\n\tat
org.opendaylight.yangtools.yang.data.impl.schema.transform.base.parser.BaseDispatcherParser.parse(BaseDispatcherParser.java:160)\n\tat
org.opendaylight.yangtools.yang.data.impl.schema.transform.base.parser.ContainerNodeBaseParser.parse(ContainerNodeBaseParser.java:47)\n\tat
org.opendaylight.yangtools.yang.data.impl.schema.transform.base.parser.ContainerNodeBaseParser.parse(ContainerNodeBaseParser.java:29)\n\tat
org.opendaylight.netconf.sal.connect.netconf.schema.mapping.NetconfMessageTransformer.toRpcResult(NetconfMessageTransformer.java:362)\n\tat
org.opendaylight.netconf.sal.connect.netconf.schema.mapping.NetconfMessageTransformer.toRpcResult(NetconfMessageTransformer.java:72)\n\tat
org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDeviceRpc$2.apply(NetconfDeviceRpc.java:69)\n\tat
org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDeviceRpc$2.apply(NetconfDeviceRpc.java:65)\n\tat
com.google.common.util.concurrent.Futures$2.apply(Futures.java:760)\n\tat
com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:906)\n\tat
com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)\n\tat
com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)\n\tat
com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)\n\tat
com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)\n\tat
org.opendaylight.netconf.sal.connect.netconf.listener.UncancellableFuture.set(UncancellableFuture.java:44)\n\tat
org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator.processMessage(NetconfDeviceCommunicator.java:315)\n\tat
org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:257)\n\tat
org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:48)\n\tat
org.opendaylight.netconf.nettyutil.AbstractNetconfSession.handleMessage(AbstractNetconfSession.java:64)\n\tat
org.opendaylight.netconf.nettyutil.AbstractNetconfSession.handleMessage(AbstractNetconfSession.java:35)\n\tat
org.opendaylight.protocol.framework.AbstractProtocolSession.channelRead0(AbstractProtocolSession.java:53)\n\tat
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)\n\tat
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)\n\tat
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)\n\tat
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)\n\tat
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)\n\tat
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)\n\tat
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)\n\tat
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)\n\tat
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)\n\tat
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)\n\tat
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)\n\tat
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)\n\tat
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:33)\n\tat
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:333)\n\tat
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)\n\tat
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:394)\n\tat
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)\n\tat
io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.r*
Connection #0 to host localhost left intact
un(DefaultThreadFactory.java:145)\n\tat
java.lang.Thread.run(Thread.java:745)\n"
}
]
}
}
I checked the device debug level log and find the RPC was executed succeefully,
but failed to return the response.
netopeer-server log:
netopeer-server[5852]: SSH log: ssh_socket_pollcallback: Received POLLOUT in
connecting state
netopeer-server[5852]: SSH log: ssh_socket_unbuffered_write: Enabling POLLOUT
for socket
netopeer-server[5852]: Input channel error (end of file)
netopeer-server[5852]: Adding new event (6)
netopeer-server[5852]: Created dummy session 0 for user 'root' (UID 0) -
recovery session
...
netopeer-server[5852]: Created dummy session 0 for user 'root' (UID 0) -
recovery session
netopeer-server[5852]: np_ssh_client_netconf_rpc: failed to receive client's
message (nc session not working)
netopeer-server[5852]: SSH log: callback_receive_banner: Received banner:
SSH-2.0-SSHD-CORE-0.14.0
netopeer-server[5852]: SSH log: ssh_server_connection_callback: SSH client
banner: SSH-2.0-SSHD-CORE-0.14.0
netopeer-server[5852]: SSH log: ssh_analyze_banner: Analyzing banner:
SSH-2.0-SSHD-CORE-0.14.0
But it is very strange, I can use the netopeer-cli to call the RPC and get the
right response.
this is my netconf device YANG model define:
module myos-op {
yang-version 1;
namespace
"urn:my.com:mgmt:myos-op";
prefix "op";
organization
"my Working Group";
description
"This module contains a collection of YANG definitions for
ping function.
This version of this YANG module is part of RFC 7223; see
the RFC itself for full legal notices.";
revision "2017-01-09" {
description "Initial revision.";
reference
"RFC 7223: A YANG Data Model for myOS";
}
container system {
description
"System group configuration.";
leaf hostname {
type string;
description
"The name of the host. This name can be a single domain
label or the fully qualified domain name of the host.";
}
} // container system
rpc ping {
description
"Ping destination host.";
input {
leaf host {
type string;
description
"Destination host.";
}
leaf count {
type uint32;
description
"ping count.";
default "3";
}
}
output {
leaf result {
type string;
}
}
} // rpc ping
} // myos-op
Kindly help me how to fixed this issue. Thank in advance.
_______________________________________________
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev