10-24-2017 11:32 AM
Getting the following error if I try to read IETF interface model. IOS-XR 6.1.2.
[root@nclinux ydk]# rpm -qa | grep ydk
libydk-0.6.1-1.x86_64
libydk-ietf-0.1.3-1.x86_64
libydk-openconfig-0.1.4-1.x86_64
[root@nclinux ydk]# ./a.out ssh://packet:packet@10.66.4.203:830 -v
[2017-10-24 14:26:00.191] [ydk] [info] Path where models are to be downloaded: /root/.ydk/10.66.4.203:830
[2017-10-24 14:26:00.199] [ydk] [info] Connected to 10.66.4.203 on port 830 using ssh with timeout of -1
[2017-10-24 14:26:00.199] [ydk] [info] Connected to 10.66.4.203 on port 830 using ssh with timeout of -1
[2017-10-24 14:26:00.199] [ydk] [info] Executing CRUD config read operation
[2017-10-24 14:26:00.199] [ydk] [error] Libyang ERROR: Module not found. Path: '/ietf-interfaces'
[2017-10-24 14:26:00.199] [ydk] [error] Path 'ietf-interfaces:interfaces' is invalid
terminate called after throwing an instance of 'ydk::YCPPInvalidArgumentError'
what(): YCPPInvalidArgumentError: Path is invalid: ietf-interfaces:interfaces
Aborted
[root@nclinux ydk]# vi ietf_interface_read.cpp
code snippet:
-------------------
NetconfServiceProvider provider{host, username, password, port};
CrudService crud{};
auto interface_filter = make_unique<ietf_interfaces::Interfaces>();
auto interfaces_read = crud.read(provider, *interface_filter);
if (interfaces_read == nullptr) {
cout << "No entries found" << endl;
return 0;
}
ietf_interfaces::Interfaces* interfaces_read_ptr = dynamic_cast<ietf_interfaces::Interfaces*>(interfaces_read.get());
for(size_t index = 0; index < interfaces_read_ptr->interface.size(); index++) {
ietf_interfaces::Interfaces::Interface& interface = *(interfaces_read_ptr->interface[index]);
cout << "Name: " << interface.name << endl;
}
Solved! Go to Solution.
10-24-2017 01:59 PM
Guys,
The ietf-interfaces model is downloadable from XR only because it is a dependency of the openconfig-interfaces model. You will see that ietf-interfaces is NOT advertised as a capability (or if it is, it will be accompanied by a deviation file deviating all its data nodes to be "not-supported"), and XR doesn't support any of its data nodes.
Cheers,
Einar
10-24-2017 12:16 PM
Hi Hari,
Looking at the error, it appears that the ietf-interfaces.yang model could be somehow not available for download from your netconf server. Can you please enable the log level of “debug” and post the output? This will indicate whether the model was successfully downloaded
10-24-2017 12:28 PM
Here it is..
[root@nclinux ydk]# ./a.out ssh://packet:packet@10.66.4.203:830 -v
[2017-10-24 15:26:46.293] [ydk] [debug] libnetconf TRACE: Password authentication (host 10.66.4.203, user packet)
[2017-10-24 15:26:46.414] [ydk] [debug] libnetconf TRACE: Writing message (session ): <?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
<capability>urn:ietf:params:netconf:base:1.1</capability>
<capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability>
<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:startup:1.0</capability>
<capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability>
</capabilities>
</hello>
[2017-10-24 15:26:46.488] [ydk] [debug] libnetconf TRACE: Received message (session ): <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.1</capability>
<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.1</capability>
<capability>urn:ietf:params:netconf:capability:confirmed-commit:1.1</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-lib-cfg?module=Cisco-IOS-XR-aaa-lib-cfg&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-locald-admin-cfg?module=Cisco-IOS-XR-aaa-locald-admin-cfg&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-locald-cfg?module=Cisco-IOS-XR-aaa-locald-cfg&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-locald-oper?module=Cisco-IOS-XR-aaa-locald-oper&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-protocol-radius-cfg?module=Cisco-IOS-XR-aaa-protocol-radius-cfg&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-protocol-radius-oper?module=Cisco-IOS-XR-aaa-protocol-radius-oper&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-tacacs-cfg?module=Cisco-IOS-XR-aaa-tacacs-cfg&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-tacacs-oper?module=Cisco-IOS-XR-aaa-tacacs-oper&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-bundlemgr-cfg?module=Cisco-IOS-XR-bundlemgr-cfg&revision=2016-05-12</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-bundlemgr-oper?module=Cisco-IOS-XR-bundlemgr-oper&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-cdp-cfg?module=Cisco-IOS-XR-cdp-cfg&revision=2015-07-30</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-cdp-oper?module=Cisco-IOS-XR-cdp-oper&revision=2015-07-30</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-cfgmgr-rollback-act?module=Cisco-IOS-XR-cfgmgr-rollback-act&revision=2016-04-17</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-clns-isis-cfg?module=Cisco-IOS-XR-clns-isis-cfg&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-clns-isis-datatypes?module=Cisco-IOS-XR-clns-isis-datatypes&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-clns-isis-oper?module=Cisco-IOS-XR-clns-isis-oper&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-common-acl-datatypes?module=Cisco-IOS-XR-common-acl-datatypes&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-config-cfgmgr-exec-oper?module=Cisco-IOS-XR-config-cfgmgr-exec-oper&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-config-mda-cfg?module=Cisco-IOS-XR-config-mda-cfg&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-config-mibs-cfg?module=Cisco-IOS-XR-config-mibs-cfg&revision=2015-01-07</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-controller-optics-cfg?module=Cisco-IOS-XR-controller-optics-cfg&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-controller-optics-oper?module=Cisco-IOS-XR-controller-optics-oper&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-controller-otu-cfg?module=Cisco-IOS-XR-controller-otu-cfg&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-controller-otu-oper?module=Cisco-IOS-XR-controller-otu-oper&revision=2015-11-09</capability>
<capability>http://cisco.com/ns/yang/Cisco-IOS-XR-crypto-sam-cfg?module=Cisco-IOS-XR-crypto-sam-cfg&revision=2015-01-07</capability>
<capability>http://c
[2017-10-24 15:26:46.490] [ydk] [info] Path where models are to be downloaded: /root/.ydk/10.66.4.203:830
[2017-10-24 15:26:46.490] [ydk] [debug] Creating libyang context in path: /root/.ydk/10.66.4.203:830
[2017-10-24 15:26:46.493] [ydk] [debug] Module 'ydk' Revision '2016-02-26'
[2017-10-24 15:26:46.493] [ydk] [debug] Getting module ydk submodule none
[2017-10-24 15:26:46.493] [ydk] [debug] Looking for file in folder: /root/.ydk/10.66.4.203:830
[2017-10-24 15:26:46.493] [ydk] [debug] Opening file /root/.ydk/10.66.4.203:830/ydk@2016-02-26.yang
[2017-10-24 15:26:46.493] [ydk] [debug] Path found with rev: true. Path without rev: false
[2017-10-24 15:26:46.495] [ydk] [debug] Module 'ietf-netconf' Revision '2011-06-01'
[2017-10-24 15:26:46.495] [ydk] [debug] Getting module ietf-netconf submodule none
[2017-10-24 15:26:46.495] [ydk] [debug] Looking for file in folder: /root/.ydk/10.66.4.203:830
[2017-10-24 15:26:46.495] [ydk] [debug] Opening file /root/.ydk/10.66.4.203:830/ietf-netconf@2011-06-01.yang
[2017-10-24 15:26:46.495] [ydk] [debug] Path found with rev: true. Path without rev: false
[2017-10-24 15:26:46.498] [ydk] [debug] Populating new module schema 'yang'
[2017-10-24 15:26:46.498] [ydk] [debug] Populating new module schema 'ietf-inet-types'
[2017-10-24 15:26:46.498] [ydk] [debug] Populating new module schema 'ietf-yang-types'
[2017-10-24 15:26:46.498] [ydk] [debug] Populating new module schema 'ietf-yang-library'
[2017-10-24 15:26:46.498] [ydk] [debug] Populating new module schema 'ydk'
[2017-10-24 15:26:46.498] [ydk] [debug] Populating new module schema 'ietf-netconf'
[2017-10-24 15:26:46.498] [ydk] [info] Connected to 10.66.4.203 on port 830 using ssh with timeout of -1
[2017-10-24 15:26:46.498] [ydk] [info] Connected to 10.66.4.203 on port 830 using ssh with timeout of -1
[2017-10-24 15:26:46.498] [ydk] [info] Executing CRUD read operation
[2017-10-24 15:26:46.498] [ydk] [debug] Encoding the subtree filter request using XML subtree codec
[2017-10-24 15:26:46.498] [ydk] [debug] Creating root data node with path '/ietf-interfaces:interfaces'
[2017-10-24 15:26:46.498] [ydk] [error] Libyang ERROR: Module not found. Path: '/ietf-interfaces'
[2017-10-24 15:26:46.498] [ydk] [error] Path 'ietf-interfaces:interfaces' is invalid
terminate called after throwing an instance of 'ydk::YCPPInvalidArgumentError'
what(): YCPPInvalidArgumentError: Path is invalid: ietf-interfaces:interfaces
Aborted
[root@nclinux ydk]#
10-24-2017 01:59 PM
Guys,
The ietf-interfaces model is downloadable from XR only because it is a dependency of the openconfig-interfaces model. You will see that ietf-interfaces is NOT advertised as a capability (or if it is, it will be accompanied by a deviation file deviating all its data nodes to be "not-supported"), and XR doesn't support any of its data nodes.
Cheers,
Einar
10-24-2017 02:10 PM
Thanks Einar. Does this mean, I cant use both ietf-interfaces and openconfig-interfaces model with IOS-XR ?
10-24-2017 02:18 PM
Hari,
Indeed, you can only use the Cisco-IOS-XR native models and the openconfig-interfaces model. IOS-XR doesn't currently support ANY IETF models, just typedefs used by native and openconfig models.
Cheers,
Einar
10-24-2017 02:50 PM
I wasnt able to use the openconfig-interfaces model too. I am getting segfault which I reported in another thread..
10-24-2017 02:15 PM
Thanks for the clarification, Einar.
BTW this issue has been fixed in ydk in this pull request: Fix issue with ydk not downloading models which are not in capabilities by abhikeshav · Pull Request #588 · CiscoDevNet/…
This fix will be available in the next release of ydk binaries (0.6.2) which should come out by next week.
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