user-rpc with toaster example

884 views
Skip to first unread message

laxman.v...@gmail.com

unread,
Nov 24, 2014, 6:53:34 AM11/24/14
to neto...@googlegroups.com

Hi

I am testing the toaster module to get an understanding on user-rpc. But it looks like something is missing in my setup.
Steps followed and the error:

netconf> user-rpc

Type the content of a RPC operation (close editor by Ctrl-D):
<toaster:make-toast xmlns:toaster="http://netconfcentral.org/ns/toaster"/>


libnetconf DEBUG: Writing message (session 22957): <?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<toaster:make-toast xmlns:toaster="http://netconfcentral.org/ns/toaster"/>
</rpc>

libnetconf DEBUG: Received message (session 22957): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<rpc-error>
<error-type>application</error-type>
<error-tag>operation-not-supported</error-tag>
<error-severity>error</error-severity>
<error-message>Request could not be completed because the requested operation is not supported by this implementation.</error-message>
</rpc-error>
</rpc-reply>

DEBUGS ON SERVER SIDE:
netopeer-server[22626]: Some message received
netopeer-server[22626]: Request <?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
<toaster:make-toast xmlns:toaster="http://netconfcentral.org/ns/toaster"/>
</rpc>
netopeer-server[22626]: ncds_apply_rpc2all: unsupported NETCONF operation (make-toast) requested.

Toaster module installed:
root@osboxes:/home/osboxes/laxman# netopeer-manager list
List of startup Netopeer modules:
toaster (enabled)

Why doesnt RPC for make-toast is not getting invoked?

Michal Vasko

unread,
Nov 24, 2014, 7:53:29 AM11/24/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Hi,

it seems that the toaster module is not being loaded after all. If it is, you should see server debug messages informing about it, during startup. In case you are unsure, please include the whole netopeer-server debug output.

Regards,
Michal

PS: Please do not duplicate your emails and do not respond to finished topics, thank you.

laxman.v...@gmail.com

unread,
Nov 24, 2014, 8:45:39 AM11/24/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Thanks a ton for the reply Michal.
I have attached the server log. I am not sure on how to verify whether toaster module is loaded or not. Incase it is not loaded then please let me know on how to load it.

I am ensuring toaster module has been enabled.
server_log.txt

Michal Vasko

unread,
Nov 24, 2014, 9:20:15 AM11/24/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Hi,

the toaster module is indeed not loaded. It seems you have several server installations, which is causing the configuration confusion. So, you have to repeat some portion of the installation process to have the correct paths in all the tools. Of course, the safest way would be to remove it all, especially the configuration directory (default /usr/local/etc/netopeer) and install it again.

Regards,
Michal

laxman.v...@gmail.com

unread,
Nov 25, 2014, 1:01:54 AM11/25/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Hi Michal,

As suggested, deleted the default netopeer installation and installed again.

I have created new_datastore in following path:
/var/lib/libnetconf/server/

I enabled debug at cli and I tried to run edit-config and user-rpc. Log is attached.

Let me know
1. why Result: is always empty though am able to see the reply from Netconf server.

2. incase of user-rpc, server logs stops at calling make-toast RFC function.

3. What is message toaster is turned off signifies? How to make it ON.

Thanks,
Laxman V


temp.txt

Michal Vasko

unread,
Nov 25, 2014, 8:30:43 AM11/25/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Hello,

I will try to explain what was happening based on your cli log.

edit-config running:
You tried to create the root node "toaster", which is the natural first step as this node's presence means that the toaster is on (refer to the YANG model). However, server responds that you are not authorized to do it. The easiest way to give yourself access would be to use netopeer-configurator and add the username you use for connecting to the server to the "almighty" group.

get-config --filter running:
You tried to retrieve the running configuration filtering out everything except for the "toaster" subtree. Seems fine to me, so it did to the server and it responded with an empty configuration. This is correct, since you failed to add this node in the previous step.

user-rpc:
You finally decided to make a toast, the RPC is correct. However, you did not have the "toaster" node present, so the server correctly responded with an error saying that the toaster is off.

Regards,
Michal

laxman.v...@gmail.com

unread,
Nov 28, 2014, 5:55:26 AM11/28/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Hi Michal,

Thanks for the analysis:
I have overcome the access-denied problem by compiling libnetconf with --with-nacm-recovery-uid option.

I am running my setup on Ubuntu 12.04 installed in VirtualBox.
When I try to modify the permissions using netopeer-configurator and press F10, the command doesn't work. Please check the image attached.

I have made a document with complete list of steps followed along with issues face and workaround did to overcome them.

Please let me know if am missing any procedure.
Finally my purpose of doing this is to write my own module and implement the user-rpc.

Thanks & Regards,
Laxman Valladnas
commands.txt
IMG_20141128_155232(1).jpg

laxman.v...@gmail.com

unread,
Nov 29, 2014, 5:56:01 AM11/29/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Hi Michal,

The server logs clearly says toaster modules does not have callbacks. I have compiled libnetconf and netconf with the default options. I did not specify any specific paths. I am unclear on how to link callbacks to toaster module.

Please find the debug logs on server:
netopeer-server[13487]: File /home/osboxes/laxman/netopeer/server/manager/datastore.xml was empty. Basic structure created.
netopeer-server[13487]: Datastore toaster initiated with ID 626108791.
netopeer-server[13487]: transAPI module for the model "toaster" does not have any callbacks.
Toaster initialized1!
netopeer-server[13487]: Transapi calling callback /A:netopeer with op CHAIN | ADD.
netopeer-server[13487]: Netopeer server successfully initialized.

laxman.v...@gmail.com

unread,
Dec 1, 2014, 5:40:29 AM12/1/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Hi,

I did not see any issue in testing with single-level server.

But the problem is with the multi-level server. Since there is not toaster module inside the server. I have created my own.
Can you help in explaining on how to link the toaster module with libnetconf.

Thanks,

Michal Vasko

unread,
Dec 1, 2014, 6:41:02 AM12/1/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Hi Laxman,

Regarding netopeer-configurator, in the image it seems you are still editing your name to add. Just press enter and then saving and everything else should work normally.

Concerning everything else, pull updated master versions of both libnetconf and netopeer and do a complete reinstall, the errors encountered during configuration and compilation should be solved.

As for toaster, the tutorial you mentioned is just a guide and the actual working toaster implementation is included in netopeer/server-sl/toaster. I suggest you try to work with that one first, then maybe try to edit it and lastly, write your own module. To install it into the full netopeer-server, use netopeer-manager, just like you did on your toaster implementation (make install is good only for server-sl).

Michal Vasko

unread,
Dec 1, 2014, 6:46:11 AM12/1/14
to neto...@googlegroups.com, laxman.v...@gmail.com
Hi Laxman,

this message is shown if a module does not implement any callbacks. It is fine, if you only implement RPC callbacks. However, you probably implemented some callbacks as well, but libnetconf is unable to find them. This is likely due to some mistake in the implemenation. For solution, refer to my previous reply.

Regards,
Michal
Reply all
Reply to author
Forward
0 new messages