cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1508
Views
2
Helpful
7
Replies

CRUD read error on Cisco_IOS_XR_ip_rib_ipv4_oper

Hi, while trying to check data in Cisco_IOS_XR_ip_rib_ipv4_oper modul getting error ydk.errors.YPYModelError: 0 already in list. Logs and sample code in attachment. Any idea pls if doing something wrong?

Traceback (most recent call last):

  File "rib_oper.py", line 40, in <module>

    rib_read = crud.read(provider, rib_oper)

  File "/usr/local/lib/python3.5/dist-packages/ydk/services/crud_service.py", line 152, in read

    return provider.decode(payload, read_filter)

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/netconf_provider.py", line 91, in decode

    return self.sp_instance.decode(payload, read_filter)

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_provider_plugin.py", line 132, in decode

    XmlDecoder._bind_to_object(payload, entity, self._get_capabilities())

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 65, in _bind_to_object

    XmlDecoder._bind_to_object_helper(curr_rt, top_entity, active_deviation_tables, pretty_p='|-')

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 91, in _bind_to_object_helper

    XmlDecoder._bind_to_object_helper(rt[0], instance, deviation_tables, pretty_p + '-|')

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 103, in _bind_to_object_helper

    XmlDecoder._bind_to_object_helper(rtchild, child, deviation_tables, pretty_p + '-l')

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 91, in _bind_to_object_helper

    XmlDecoder._bind_to_object_helper(rt[0], instance, deviation_tables, pretty_p + '-|')

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 103, in _bind_to_object_helper

    XmlDecoder._bind_to_object_helper(rtchild, child, deviation_tables, pretty_p + '-l')

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 103, in _bind_to_object_helper

    XmlDecoder._bind_to_object_helper(rtchild, child, deviation_tables, pretty_p + '-l')

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 91, in _bind_to_object_helper

    XmlDecoder._bind_to_object_helper(rt[0], instance, deviation_tables, pretty_p + '-|')

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 103, in _bind_to_object_helper

    XmlDecoder._bind_to_object_helper(rtchild, child, deviation_tables, pretty_p + '-l')

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 84, in _bind_to_object_helper

    entity.__dict__[member.presentation_name] = XmlDecoder._to_real_list_type(rt, member, entity)

  File "/usr/local/lib/python3.5/dist-packages/ydk/providers/_decoder.py", line 149, in _to_real_list_type

    results.append(result)

  File "/usr/local/lib/python3.5/dist-packages/ydk/types.py", line 319, in append

    raise YPYModelError("{} already in list".format(item))

ydk.errors.YPYModelError: 0 already in list

thanks

1 Accepted Solution

Accepted Solutions

einarnn
Cisco Employee
Cisco Employee

Michal,

Could you clarify which version of the YDK you are using?

As to what is happening, I don’t think you are doing anything wrong. I think this is an issue in terms of how the YANG model is defined for the “labelstk” element of ipv4-rib-edm-path. This is defined as:

leaf-list labelstk {

type uint32;

max-elements "3";

description "Labels for this path";

}

However, if you look at the raw XML, you will see:

Even though it has no labels, IOS-XR is outputting the elements of an internal array. This set of values is illegal as a leaf-list must have only unique values on it. I will take this to the relevant development team and see if there is a workaround that can be applied to the YDK to

I don’t believe that this is the same issue as Anton points to in his response (https://github.com/CiscoDevNet/ydk-gen/issues/150), which is a YDK issue.

Cheers,

Einar

View solution in original post

7 Replies 7

Anton Abik
Level 4
Level 4

Seems similar as https://github.com/CiscoDevNet/ydk-gen/issues/150 but that one was fixed in June last year.

einarnn
Cisco Employee
Cisco Employee

Michal,

Could you clarify which version of the YDK you are using?

As to what is happening, I don’t think you are doing anything wrong. I think this is an issue in terms of how the YANG model is defined for the “labelstk” element of ipv4-rib-edm-path. This is defined as:

leaf-list labelstk {

type uint32;

max-elements "3";

description "Labels for this path";

}

However, if you look at the raw XML, you will see:

Even though it has no labels, IOS-XR is outputting the elements of an internal array. This set of values is illegal as a leaf-list must have only unique values on it. I will take this to the relevant development team and see if there is a workaround that can be applied to the YDK to

I don’t believe that this is the same issue as Anton points to in his response (https://github.com/CiscoDevNet/ydk-gen/issues/150), which is a YDK issue.

Cheers,

Einar

Hi,

we are using 0.5.3. I am getting same error also for Cisco_IOS_XR_ipv4_bgp_oper model for different XR versions(5.3.4 and 6.1.2). Seems there is again some repeating af-array in bpm-nistance-table.bpm-instances.instance. Seems like some XR issue but would be great to address in YDK if it's issue of more models.

thanks

Hi, for now i workaround it by removing that if condition from types.py append method.

    def append(self, item):

      #  if item in self:

      #      raise YPYModelError("{} already in list".format(item))

        lst_item = YListItem(item, self.parent, self.name)

        super(YLeafList, self).append(lst_item)

Michael,

I meant to suggest that as a workaround, sorry for forgetting

Cheers,

Einar

Michal,

We shall consider this introducing a workaround to the YDK.

Cheers,

Einar

saalvare
Cisco Employee
Cisco Employee

You're running into an IOS XR defect in the RIB model (CSCvd43804).  Similar issues have been found in BGP (CSCvb93609) and ISIS (CSCva02506) oper models.  The latter already fixed in 6.1.2.  The former will be fixed in 6.2.1 which should be available in a couple of week.  We're tracking a YDK enhancement to facilitate access to the XML payload when invalid data is detected.  See Include additional data in ydk exception · Issue #381 · CiscoDevNet/ydk-gen · GitHub.

Getting Started

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: