05-25-2018 03:20 PM
YDKpy 071 and XRv9K version 632
Trying persistent confirmed commit with Netconf service and facing some strange behaviour.
With this code section it works like charm:
netconf.edit_config(provider, datastore_candidate, rpm)
netconf.commit(provider, confirmed = True)
netconf.commit(provider)
If I make it persistent I got error (attachment) that the datastore is locked (I did check before if the datastore is locked on the device). Seems the error appears on the second commit - when commiting confirmed commit:
netconf.edit_config(provider, datastore_candidate, rpm)
netconf.commit(provider, confirmed = True, confirm_timeout = 10 persist = 666)
netconf.commit(provider, persist_id = 666)
I tried several combinations of persist, persist_id in the commit but no luck so far. Strange is that from the debug output I can see second commit RPC is sending the "persist" xml tag not "persist_id" although I specified in the second commit persist_id.
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
<commit>
<persist>666</persist>
</commit>
</rpc>
2018-05-26 01:10:25,840 - ydk - DEBUG - Netconf SSH Client: receiving rpc
2018-05-26 01:10:26,088 - ydk - DEBUG - Trace: Received message (session 2220685058): <?xml version="1.0"?>
<rpc-reply message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>application</error-type>
<error-tag>in-use</error-tag>
<error-severity>error</error-severity>
<error-message xml:lang="en">'YANG framework' detected the 'fatal' condition 'Datastore locked'</error-message>
</rpc-error>
</rpc-reply>
Also I wanted to look at the YDK code if there is some issue and fix it, but seems I cannot find the main YDK API files. There is some deadly exthook.py class hiding it
Thanks for any help
Solved! Go to Solution.
06-05-2018 07:20 AM
Thanks for the update. The code is here: https://github.com/CiscoDevNet/ydk-gen/blob/master/sdk/cpp/core/src/netconf_service.cpp#L108
Feel free to submit a pull request for this
Opened an issue for this: https://github.com/CiscoDevNet/ydk-gen/issues/796
05-29-2018 08:18 AM
Looks like this error is coming from XR device. I will forward this query to the concerned team.
The YDK-Py code uses pybind11 to create python bindings. The core is written in c++. See: https://github.com/CiscoDevNet/ydk-gen#overview
05-29-2018 08:26 AM
I am able to reproduce this error on XR 6.3.2. However, it seems to be fixed in the newer release after 6.3.2. Is it possible for you to try with a newer XR?
06-05-2018 05:14 AM
Tried with XRv641 and still the exact same error as posted above.
I tried against XRv614 and ydk055 and I see that confirmed commit generate the "persist-id" tag:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:26078be1-3e5f-427f-9058-c953e842054a">
<commit>
<persist>1243</persist>
<persist-id>1234</persist-id>
</commit>
</rpc>
2018-06-05 07:07:51,717 - ydk.providers._provider_plugin - DEBUG -
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:26078be1-3e5f-427f-9058-c953e842054a">
<ok/>
</rpc-reply>
But in YKD071 and XRv641 combination the confirmed commit does not generate "persist-id" tag as required per RFC. It generates just the "persist" tag:
2018-06-05 14:58:33,135 - ydk - DEBUG - Trace: Missing message-id in rpc.
2018-06-05 14:58:33,136 - ydk - DEBUG - Netconf SSH Client: sending rpc
2018-06-05 14:58:33,136 - ydk - DEBUG - Trace: Writing message (session 2292223149): <?xml version="1.0"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
<commit>
<persist>1234</persist>
</commit>
</rpc>
2018-06-05 14:58:33,136 - ydk - DEBUG - Netconf SSH Client: receiving rpc
2018-06-05 14:58:33,391 - ydk - DEBUG - Trace: Received message (session 2292223149): <?xml version="1.0"?>
<rpc-reply message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>application</error-type>
<error-tag>in-use</error-tag>
<error-severity>error</error-severity>
<error-message xml:lang="en">'YANG framework' detected the 'fatal' condition 'Datastore locked'</error-message>
</rpc-error>
</rpc-reply>
If I want to fix it which CPP file can I edit? I am lost in that pybind11 :-)
Thanks a lot for your assistance
06-05-2018 07:20 AM
Thanks for the update. The code is here: https://github.com/CiscoDevNet/ydk-gen/blob/master/sdk/cpp/core/src/netconf_service.cpp#L108
Feel free to submit a pull request for this
Opened an issue for this: https://github.com/CiscoDevNet/ydk-gen/issues/796
06-06-2018 06:35 AM
Pull request has been created for this issue. Using mostly gitlab not github so hopefully its done correctly :-)
https://github.com/CiscoDevNet/ydk-gen/pull/797
Meanwhile for others if want to fix the issue by yourself:
just clone the repo abhirame sent link above, edit the code and recompile.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide