04-26-2018 07:52 AM
Hi,
Noob here. Installing YDK first time around.
I have installed ydk but there are a bunch of errors that i am hitting and unable to understand.
If there is documentation which talks about these generic errors,please do let me know
To begin with, this is the pip list for ydk
(openconfig) [root@zion-lnx1 ydk-py-samples]# pip list | grep ydk
ydk 0.7.1
ydk-models-cisco-ios-xr 6.3.2
ydk-models-ietf 0.1.5
ydk-models-openconfig 0.1.5
I have a NCS6k router on which i have configured the following
netconf agent tty
netconf-yang agent
ssh
ssh server logging
ssh server rate-limit 600
ssh server session-limit 16
ssh server v2
ssh server netconf vrf default
1. ydk-py/core/samples/bgp.py
(openconfig) [root@zion-lnx1 samples]# ./bgp.py -u root -p lab --host=1.80.33.13 --port=830
Establishing connection with device 1.80.33.13:830 using ssh :
Path where models are to be downloaded: /root/.ydk/1.80.33.13_830
Connected to 1.80.33.13 on port 830 using ssh with timeout of -1
connection established...
Executing CRUD delete operation on [openconfig-bgp:bgp]
Data is invalid according to the yang model. Error details: Data model "http://openconfig.net/yang/bgp" not found.
=============Generating payload to send to device=============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<target>
<candidate/>
</target>
<error-option>rollback-on-error</error-option>
<config><bgp xmlns="http://openconfig.net/yang/bgp" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="delete"/>
</config>
</edit-config>
</rpc>
=============Reply payload received from device=============
<?xml version="1.0"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
<rpc-error>
<error-type>protocol</error-type>
<error-tag>unknown-namespace</error-tag>
<error-severity>error</error-severity>
<error-info>
<bad-element>bgp</bad-element>
<bad-namespace>http://openconfig.net/yang/bgp</bad-namespace>
</error-info>
</rpc-error>
</rpc-reply>
Did not receive OK reply from the device -------------> Irrespective of whether or not i have bgp configured, i get this error
BGP config does not exist!
Executing CRUD delete operation on [openconfig-routing-policy:routing-policy]
=============Generating payload to send to device=============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<target>
<candidate/>
</target>
<error-option>rollback-on-error</error-option>
<config><routing-policy xmlns="http://openconfig.net/yang/routing-policy" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="delete"/>
</config>
</edit-config>
</rpc>
=============Reply payload received from device=============
<?xml version="1.0"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
<rpc-error>
<error-type>application</error-type>
<error-tag>data-missing</error-tag>
<error-severity>error</error-severity>
<error-path xmlns:ns1="http://cisco.com/ns/yang/Cisco-IOS-XR-policy-repository-cfg">ns1:routing-policy</error-path>
</rpc-error>
</rpc-reply>
Did not receive OK reply from the device
Routing policy does not exist!
Traceback (most recent call last):
File "./bgp.py", line 198, in <module>
bgp_run(crud_service, provider)
File "./bgp.py", line 109, in bgp_run
ipv4_afsf.afi_safi_name = openconfig_bgp_types.Ipv4Unicast()
AttributeError: 'module' object has no attribute 'Ipv4Unicast'
2. oc-interfaces.py resulting in the error
(openconfig) [root@zion-lnx1 samples]# ./oc-interfaces.py
Traceback (most recent call last):
File "./oc-interfaces.py", line 28, in <module>
from ydk.types import Empty, DELETE, Decimal64
ImportError: cannot import name 'DELETE'
3. ./ietf_system returning "cannot import name"
(openconfig) [root@zion-lnx1 samples]# ./ietf_system.py
Path where models are to be downloaded: /root/.ydk/1.80.33.13_830
Connected to 1.80.33.13 on port 830 using ssh with timeout of -1
==============
CRUD SERVICE
==============
Traceback (most recent call last):
File "./ietf_system.py", line 156, in <module>
ietf_run(crud_service, provider)
File "./ietf_system.py", line 137, in ietf_run
from ydk.models.ietf import ietf_system
ImportError: cannot import name 'ietf_system'
Disconnected from device
Solved! Go to Solution.
04-27-2018 07:46 AM
For all 3 issues, it looks like some of those samples are out of date and need to be updated to work with the latest API. Can you try some of the samples here?
https://github.com/CiscoDevNet/ydk-py-samples/tree/master/samples/basic
For the "bad-namespace" error for openconfig-bgp, it looks like the device does not support this model.
04-27-2018 07:46 AM
For all 3 issues, it looks like some of those samples are out of date and need to be updated to work with the latest API. Can you try some of the samples here?
https://github.com/CiscoDevNet/ydk-py-samples/tree/master/samples/basic
For the "bad-namespace" error for openconfig-bgp, it looks like the device does not support this model.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: