cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1545
Views
2
Helpful
5
Replies

Persistent Confirmed Commit with Netconf service

Anton Abik
Level 4
Level 4

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

1 Accepted Solution

Accepted Solutions

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

View solution in original post

5 Replies 5

abhirame
Cisco Employee
Cisco Employee

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

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?

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

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

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.