cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
932
Views
5
Helpful
3
Replies

ydk.errors.YModelError: Invalid value "192.168.1.1" in "neighbor-address" element. Path: /openconfig-bgp:bgp

magedahmed
Level 1
Level 1

I tried to run sample code for openconfig BGP and got the below error, this error received even when run the same sample code from vagrant virtual vm

 

auto@yang-vm:~/ydk-py-samples/samples/basic/codec/models/openconfig/openconfig-bgp$ python3 cd-encode-oc-bgp-44-ydk.py
Traceback (most recent call last):
  File "cd-encode-oc-bgp-44-ydk.py", line 99, in <module>
    print(codec.encode(provider, bgp))
  File "/home/auto/.local/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 112, in helper
    return func(self, provider, entity, *args, **kwargs)
  File "/home/auto/.local/lib/python3.6/site-packages/ydk/services/codec_service.py", line 78, in encode
    return self._encode(provider, entity_holder, pretty, subtree)
  File "/home/auto/.local/lib/python3.6/site-packages/ydk/services/codec_service.py", line 110, in _encode
    return result
  File "/usr/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/auto/.local/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
    _raise(_exc)
  File "/home/auto/.local/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 54, in _raise
    exec("raise exc from None")
  File "<string>", line 1, in <module>
ydk.errors.YModelError:  Invalid value "192.168.1.1" in "neighbor-address" element. Path: /openconfig-bgp:bgp/neighbors/neighbor[neighbor-address='192.168.1.1']/neighbor-address

1 Accepted Solution

Accepted Solutions

ygorelik
Cisco Employee
Cisco Employee
This is known issue in openconfig Yang models, which uses non-standard string pattern regular expression. See https://github.com/openconfig/public/issues/175 for details. It is not clear for how long it is going to take for Google to fix the models, it might not happen at all. Therefore, please use Cisco native models in your application. Another option would be download openconfig models, manually fix all the pattern definitions and generate YDK bundle.

View solution in original post

3 Replies 3

ygorelik
Cisco Employee
Cisco Employee
This is known issue in openconfig Yang models, which uses non-standard string pattern regular expression. See https://github.com/openconfig/public/issues/175 for details. It is not clear for how long it is going to take for Google to fix the models, it might not happen at all. Therefore, please use Cisco native models in your application. Another option would be download openconfig models, manually fix all the pattern definitions and generate YDK bundle.

Many thanks for your support, I fixed for bgp and it is working fine, below link for the fixed yang, json, and source distribution.