cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1612
Views
0
Helpful
4
Replies

YdkGenerator error

MahdiR
Level 1
Level 1

I'm trying to generate a bundle profile for Cisco IOS XE 17.2.1, however ydk-gen gives me some errors that I don't know how to solve. pyang gives the same error when I run it on the Cisco-IOS-XE-native.yang model.

I'm guessing there is something wrong with the yang model, however I'm not sure what I can do to solve it.

Any help will be appreciated.

 

Here is my profile:

{
   "name":"cisco-ios-xe",
   "version":"17.2.1",
   "ydk_version":"0.8.5",
   "Author":"Cisco",
   "Copyright":"Cisco",
   "description":"Cisco IOS-XE 17.2.1 Models",
   "models":{
      "git":[
         {
            "url":"https://github.com/YangModels/yang.git",
            "commits":[
               {
                  "file":[
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-native.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-interfaces-oper.yang",
                        "vendor/cisco/xe/1721/cisco-semver.yang",
                        "vendor/cisco/xe/1721/ietf-inet-types.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-types.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-features.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-interface-common.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-parser.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-license.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-line.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-logging.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-ip.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-ipv6.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-interfaces.yang",
                        "vendor/cisco/xe/1721/Cisco-IOS-XE-ios-common-oper.yang",
                        "vendor/cisco/xe/1721/ietf-yang-types.yang"
                  ]
               }
            ]
         }
      ]
   }
}

And here is the output of ydk-gen generator:

error.PNG

1 Accepted Solution

Accepted Solutions

Hi Mahdir

If you are a Cisco employee, you can open a bug against XE-17.2.1/17.3.1 YANG model.

Regarding workaround. If it is not critical, you can try for your tests to use XE-17.1.1 model, which passes well both pyang and libyang validations:

 Yakovs-Air:1711 ygorelik$ ~/libyang/build/yanglint Cisco-IOS-XE-native.yang

(venv) Yakovs-Air:1711 ygorelik$ pyang Cisco-IOS-XE-native.yang
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1175): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1178): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1190): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1331): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1495): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:3433): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:3532): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2185 (at Cisco-IOS-XE-ip.yang:1139): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2185 (at Cisco-IOS-XE-ip.yang:2394): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2185 (at Cisco-IOS-XE-ip.yang:2450): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2207 (at Cisco-IOS-XE-ipv6.yang:335): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ipv6"
Cisco-IOS-XE-native.yang:2207 (at Cisco-IOS-XE-ipv6.yang:360): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ipv6" 

 

Yan Gorelik
YDK Solutions

View solution in original post

4 Replies 4

yangorelik
Spotlight
Spotlight

Hi Mahdi

Based on my investigation, it looks like there is a bug in the pyang utility. I suggest you to open an issue on the pyang GitHub. Please attach full output like this one:

Yakovs-Air:1721 ygorelik$ pyang Cisco-IOS-XE-native.yang 
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:1435): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:1438): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:1450): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:1591): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:1594): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:1758): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:2064): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:3704): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:3828): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:5157): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:5160): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:5173): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:5352): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:5355): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:5542): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2253 (at Cisco-IOS-XE-interfaces.yang:5911): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1310): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1447): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1450): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1453): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1456): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1459): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1462): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1465): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1468): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1471): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1474): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1477): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1480): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1483): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1486): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1489): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1492): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:1495): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:2638): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:2694): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:3162): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-ip.yang:3180: error: "Cisco-IOS-XE-native:interface" in the path for Tunnel at Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:3176) is not found
Cisco-IOS-XE-ip.yang:3188: error: "Cisco-IOS-XE-native:interface" in the path for Tunnel at Cisco-IOS-XE-native.yang:2204 (at Cisco-IOS-XE-ip.yang:3184) is not found
Cisco-IOS-XE-native.yang:2226 (at Cisco-IOS-XE-ipv6.yang:351): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ipv6"
Cisco-IOS-XE-native.yang:2226 (at Cisco-IOS-XE-ipv6.yang:376): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ipv6"
Cisco-IOS-XE-native.yang:2522 (at Cisco-IOS-XE-logging.yang:218): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-logging"
Cisco-IOS-XE-native.yang:2522 (at Cisco-IOS-XE-logging.yang:227): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-logging"
Cisco-IOS-XE-native.yang:2522 (at Cisco-IOS-XE-logging.yang:933): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-logging"
Cisco-IOS-XE-native.yang:2522 (at Cisco-IOS-XE-logging.yang:948): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-logging"
Cisco-IOS-XE-native.yang:2522 (at Cisco-IOS-XE-logging.yang:981): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-logging"
Cisco-IOS-XE-native.yang:2522 (at Cisco-IOS-XE-logging.yang:996): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-logging"

The YDK uses Libyang library to load/verify/process YANG models. Simple verification test on xe/1721/Cisco-IOS-XE-native.yang shows that model is invalid, but lists different errors:

Yakovs-Air:1721 ygorelik$ ~/libyang/build/yanglint Cisco-IOS-XE-native.yang 
err : A current definition "fwd" references obsolete definition "TwentyFiveGigabitEthernet". (/Cisco-IOS-XE-native:native/ip/route/ip-route-interface-forwarding-list/fwd-list/fwd)
err : A current definition "fwd" references obsolete definition "TwentyFiveGigabitEthernet". (/Cisco-IOS-XE-native:native/ip/route/topology/ip-route-interface-forwarding-list/fwd-list/fwd)

That tells me that there are issues in the model as well.

Yan Gorelik
YDK Solutions

Thank you Yan!

 

I've opened an issue in pyang's Github repository.

Is there something I can do about the issues in the yang models?

Hi Mahdir

If you are a Cisco employee, you can open a bug against XE-17.2.1/17.3.1 YANG model.

Regarding workaround. If it is not critical, you can try for your tests to use XE-17.1.1 model, which passes well both pyang and libyang validations:

 Yakovs-Air:1711 ygorelik$ ~/libyang/build/yanglint Cisco-IOS-XE-native.yang

(venv) Yakovs-Air:1711 ygorelik$ pyang Cisco-IOS-XE-native.yang
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1175): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1178): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1190): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1331): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:1495): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:3433): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2234 (at Cisco-IOS-XE-interfaces.yang:3532): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-interfaces"
Cisco-IOS-XE-native.yang:2185 (at Cisco-IOS-XE-ip.yang:1139): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2185 (at Cisco-IOS-XE-ip.yang:2394): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2185 (at Cisco-IOS-XE-ip.yang:2450): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ip"
Cisco-IOS-XE-native.yang:2207 (at Cisco-IOS-XE-ipv6.yang:335): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ipv6"
Cisco-IOS-XE-native.yang:2207 (at Cisco-IOS-XE-ipv6.yang:360): warning: node "Cisco-IOS-XE-native::native" is not found in module "Cisco-IOS-XE-ipv6" 

 

Yan Gorelik
YDK Solutions

XE-17.1.1 worked! Thank you.

I'm not a Cisco employee and not able to report the bug.