cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2150
Views
5
Helpful
17
Replies

YDK not working 17.06.04 - Path is invalid: Cisco-IOS-XE-native:native

vaniat
Level 1
Level 1

On IOS versions 17.06.04 or 17.10.01 I am not able to load the yang modules, I get the following error:

ydk.errors.YInvalidArgumentError:  Path is invalid: Cisco-IOS-XE-native:native

However, version 16.12.08 works without any issues. Seems that Yang models are placed in /root/.ydk/192.168.1.142. If this folder exists and has yang models from 16.12.08 version, and switch gets upgraded to 17.06.04, YDK works as "old" models are kept and not overwritten. If I however remove the folder and start from scratch, I get error. I tested also with 17.10.01 which exhibits the same issue...

I am generating python bindings using ydk-gen, however this seems to be an issue of specific version of models. 

Here are relevant logs (I removed what seemed to be irrelevant):

[INFO    ] Path where models are to be downloaded: /root/.ydk/192.168.1.142
[DEBUG   ] Creating libyang context in path: /root/.ydk/192.168.1.142
[ERROR   ] Data is invalid according to the yang model. Libyang error: Invalid keyword "+".
[ERROR   ] Data is invalid according to the yang model. Libyang error: Module "Cisco-IOS-XE-native" parsing failed.
[ERROR   ] Data is invalid according to the yang model. Libyang error: Importing "Cisco-IOS-XE-native" module into "Cisco-IOS-XE-vrrp-deviation" failed.
[ERROR   ] Data is invalid according to the yang model. Libyang error: Module "Cisco-IOS-XE-vrrp-deviation" parsing failed.
[DEBUG   ] Creating root data node with path '/Cisco-IOS-XE-native:native'
[ERROR   ] Data is invalid according to the yang model. Libyang error: Module not found. Path: '/Cisco-IOS-XE-native'
[ERROR   ] Path 'Cisco-IOS-XE-native:native' is invalid
[CRITICAL] Failed to load grains defined in grain file cisco_ydk.cisco_ydk in function <LoadedFunc name='cisco_ydk.cisco_ydk'>, error:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/ydk/errors/error_handler.py", line 50, in handle_runtime_error
    yield
  File "/usr/local/lib/python3.8/dist-packages/ydk/services/crud_service.py", line 88, in _crud_read
    read_top_entity = crud_call(provider, top_filters)
RuntimeError: YInvalidArgumentError: Path is invalid: Cisco-IOS-XE-native:native

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/loader/__init__.py", line 943, in grains
    ret = funcs[key](**kwargs)
  File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1201, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1216, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/var/cache/salt/proxy/extmods/1009-cisco/grains/cisco_ydk.py", line 37, in cisco_ydk
    return {"cisco_ydk": proxy["cisco_ydk.get_facts"]()}
  File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 149, in __call__
    return self.loader.run(run_func, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1201, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1216, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/var/cache/salt/proxy/extmods/1009-cisco/proxy/cisco_ydk.py", line 316, in get_facts
    result = crud_service.read(dev, read_filter)
  File "/usr/local/lib/python3.8/dist-packages/ydk/services/crud_service.py", line 60, in read
    return _crud_read(provider, read_filter, False, self._crud.read)
  File "/usr/local/lib/python3.8/dist-packages/ydk/services/crud_service.py", line 88, in _crud_read
    read_top_entity = crud_call(provider, top_filters)
  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.8/dist-packages/ydk/errors/error_handler.py", line 69, in handle_runtime_error
    raise _exc
ydk.errors.YInvalidArgumentError:  Path is invalid: Cisco-IOS-XE-native:native

 

17 Replies 17

vaniat
Level 1
Level 1

That worked! Thanks! Is this something that is due to ydk-gen or is it due to yang models in the Cisco switch? Will this be fixed at some point?

ygorelik
Cisco Employee
Cisco Employee

It is definitely not YDK issue. The failure appears in libyang library when processing YANG statement 'enum +;'. Based on YANG-1.1 RFC-7950:

The "enum" statement, which is a substatement to the "type"
   statement, MUST be present if the type is "enumeration".  It is
   repeatedly used to specify each assigned name of an enumeration type.
   It takes as an argument a string that is the assigned name. 

the enum argument must be a string and libyang expects that the string value is enclosed in double quotes. For some reason the XE YANG model developers starting from release 17.2.x dropped the double quotes in enum statements, which basically violates the RFC.

vaniat
Level 1
Level 1

I was afraid that will be a case. Can we open the bug with Cisco YANG model developers?