06-02-2020 08:19 AM - edited 06-02-2020 08:34 AM
Hi there,
I'm using the YDK docker image, so I'm assuming that the software versions are correct, but regardless of the code that I write I get the following bunch of errors:
2020-06-02 15:05:58,515 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Invalid keyword "[1-9][0-9]{1,2}|[1-9])\.\.(409[0-4]|"". 2020-06-02 15:05:58,516 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-vlan-types" parsing failed. 2020-06-02 15:05:58,517 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Importing "openconfig-vlan-types" module into "openconfig-vlan" failed. 2020-06-02 15:05:58,518 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-vlan" parsing failed. 2020-06-02 15:05:58,519 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Importing "openconfig-vlan" module into "cisco-xe-openconfig-interfaces-deviation" failed. 2020-06-02 15:05:58,520 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "cisco-xe-openconfig-interfaces-deviation" parsing failed. 2020-06-02 15:05:58,527 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Invalid keyword "[1-9][0-9]{1,2}|[1-9])\.\.(409[0-4]|"". 2020-06-02 15:05:58,528 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-vlan-types" parsing failed. 2020-06-02 15:05:58,529 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Importing "openconfig-vlan-types" module into "openconfig-vlan" failed. 2020-06-02 15:05:58,529 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-vlan" parsing failed. 2020-06-02 15:05:58,530 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Importing "openconfig-vlan" module into "openconfig-if-ip" failed. 2020-06-02 15:05:58,530 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-if-ip" parsing failed. 2020-06-02 15:05:58,533 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Invalid keyword "[1-9][0-9]{1,2}|[1-9])\.\.(409[0-4]|"". 2020-06-02 15:05:58,533 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-vlan-types" parsing failed. 2020-06-02 15:05:58,534 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Importing "openconfig-vlan-types" module into "openconfig-vlan" failed. 2020-06-02 15:05:58,535 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-vlan" parsing failed. 2020-06-02 15:05:58,536 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Importing "openconfig-vlan" module into "openconfig-if-ip" failed. 2020-06-02 15:05:58,536 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-if-ip" parsing failed. 2020-06-02 15:05:58,536 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Importing "openconfig-if-ip" module into "cisco-xe-openconfig-if-ip-deviation" failed. 2020-06-02 15:05:58,537 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "cisco-xe-openconfig-if-ip-deviation" parsing failed. 2020-06-02 15:05:58,538 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Invalid keyword "[1-9][0-9]{1,2}|[1-9])\.\.(409[0-4]|"". 2020-06-02 15:05:58,539 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-vlan-types" parsing failed. 2020-06-02 15:05:58,540 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Importing "openconfig-vlan-types" module into "openconfig-vlan" failed. 2020-06-02 15:05:58,540 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "openconfig-vlan" parsing failed. 2020-06-02 15:05:58,541 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Importing "openconfig-vlan" module into "cisco-xe-openconfig-interfaces-deviation" failed. 2020-06-02 15:05:58,541 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Module "cisco-xe-openconfig-interfaces-deviation" parsing failed.
The code I'm using as a test case is really simple:
from ydk.models.openconfig import openconfig_interfaces as oc_if from ydk.models.cisco_ios_xe import Cisco_IOS_XE_interfaces_oper as xe_if from ydk.services import CRUDService from ydk.providers import NetconfServiceProvider provider = NetconfServiceProvider(address="192.168.121.231",port=830,username="root",password="foobar") crud = CRUDService() oc_ints = crud.read(provider, oc_if.Interfaces()) xe_ints = crud.read(provider, xe_if.Interfaces())
It doesn't really matter what I do after that, it seems to fail to populate the binding regardless, and if I look at the verbose logging output I see the errors listed above, but I also see the netconf data coming back from the device. So, it's definitely getting the right data from the device, it's just not able to populate the binding.
I've tried against XE versions 16.12.3, 16.9.3, and 16.8.1.
Does anybody have any feedback for me? My code could definitely be faulty too, but just looking for another set of eyes.
Solved! Go to Solution.
06-02-2020 11:49 AM
This issue and solution were discussed in this post. In short, you need reinstall libydk and python core package.
06-02-2020 11:49 AM
This issue and solution were discussed in this post. In short, you need reinstall libydk and python core package.
06-02-2020 12:28 PM
Thanks for the feedback. I did see that post, but I'm using the docker image, so I figured it was using the updated version already, and I checked the installed version, which appears to be 0.8.4:
root@1b823eb0ee13:~# pip freeze | grep ydk ydk==0.8.4 ydk-models-cisco-ios-xe==16.9.3 ydk-models-cisco-ios-xr==6.6.2 ydk-models-cisco-nx-os==9.2.3 ydk-models-ietf==0.1.5.post2 ydk-models-openconfig==0.1.8 ydk-service-gnmi==0.4.0.post1 root@1b823eb0ee13:~#
In any case, I did try going through the instructions in that post, but the ./generate step fails on a number of module imports. I tried pip installing them, but it appears that pip defaults to pip3, but python defaults to 2.7, so they weren't showing up. I ran the generate.py script with python3 after installing the missing modules which worked. Finally, I realized that my python script was also using 2.7, so after running that with 3 it works now.
Thank you!
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