20.09: PAPI throwing “TypeError: object of type 'IPv4Address' has no len()” with ip_route_add_del

Bug #1899772 reported by Onong Tayeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-vpp
Fix Released
High
Onong Tayeng

Bug Description

Running tempest_smoke on the latest master causes PAPI to produce the following error:

2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils TypeError: object of type ‘IPv4Address’ has no len()

Passing the next_hop_address in binary format to ip_route_add_del api makes the error disappear but then it begs the question as to what is the correct format that PAPI expects. Needs further investigation and hence creating the bug report to keep track.

Here's the complete backtrace:

2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils [-] router_watcher: etcd threw exception: TypeError: object of type 'IPv4Address' has no len()
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils Traceback (most recent call last):
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/local/lib/python3.6/dist-packages/networking_vpp/etcdutils.py", line 574, in watch_forever
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils self.do_watch()
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/local/lib/python3.6/dist-packages/networking_vpp/etcdutils.py", line 630, in do_watch
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils self.do_work(rv.action, rv.key, rv.value)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/local/lib/python3.6/dist-packages/networking_vpp/etcdutils.py", line 717, in do_work
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils self.key_change(action, key, value)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/local/lib/python3.6/dist-packages/networking_vpp/etcdutils.py", line 744, in key_change
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils self.added(short_key, value)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/local/lib/python3.6/dist-packages/networking_vpp/agent/server.py", line 3351, in added
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils port_id, router_data)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/local/lib/python3.6/dist-packages/networking_vpp/agent/server.py", line 1830, in ensure_router_interface_on_t
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils source_vrf=router_dict['vrf_id'])
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/local/lib/python3.6/dist-packages/networking_vpp/agent/server.py", line 1970, in export_routes_from_tenant_vs
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils is_ipv6=is_ipv6)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/local/lib/python3.6/dist-packages/networking_vpp/agent/vpp.py", line 951, in add_ip_route
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils route=route)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/local/lib/python3.6/dist-packages/networking_vpp/agent/vpp.py", line 243, in call_vpp
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils t = func_call(*args, **kwargs)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_papi.py", line 113, in call
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils return self._func(**kwargs)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_papi.py", line 452, in f
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils return self._call_vpp(i, msg, multipart, **kwargs)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_papi.py", line 679, in _call_vpp
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils b = msgdef.pack(kwargs)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_serializer.py", line 628, in pack
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils b += self.packers[i].pack(arg, kwarg)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_serializer.py", line 630, in pack
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils b += self.packers[i].pack(arg, kwargs)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_serializer.py", line 304, in pack
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils b += self.packer.pack(e)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_serializer.py", line 628, in pack
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils b += self.packers[i].pack(arg, kwarg)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_serializer.py", line 630, in pack
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils b += self.packers[i].pack(arg, kwargs)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_serializer.py", line 457, in pack
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils b = self.packers[k].pack(v, kwargs)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_serializer.py", line 514, in pack
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils return self.packer.pack(data, kwargs)
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils File "/usr/lib/python3/dist-packages/vpp_papi/vpp_serializer.py", line 218, in pack
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils if len(data) > self.num:
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils TypeError: object of type 'IPv4Address' has no len()
2020-10-06 11:17:14.641 41022 ERROR networking_vpp.etcdutils
2020-10-06 11:17:16.648 41022 CRITICAL networking_vpp.agent.server [-] Failed VPP call to sw_interface_set_table(, {'sw_if_index': 18, 'vrf_id': 4, 'is_ipv6': True}): retval is -114

Onong Tayeng (onong)
Changed in networking-vpp:
assignee: nobody → Onong Tayeng (onong)
importance: Undecided → High
Changed in networking-vpp:
status: New → In Progress
Onong Tayeng (onong)
description: updated
Changed in networking-vpp:
milestone: none → 20.09
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-vpp (master)

Reviewed: https://review.opendev.org/758213
Committed: https://git.openstack.org/cgit/x/networking-vpp/commit/?id=41c0220696b9fea7b3a8e54797e038c8a4e7a240
Submitter: Zuul
Branch: master

commit 41c0220696b9fea7b3a8e54797e038c8a4e7a240
Author: Onong Tayeng <email address hidden>
Date: Wed Oct 14 22:02:44 2020 +0530

    Fix bug in IPv6 default route setting

    A buggy if check causes the code to attempt setting the IPv6 default
    route through an IPv4 gateway causing PAPI to produce the following
    error:

        TypeError: object of type 'IPv4Address' has no len()

    Change-Id: Ia455cb983f26f171994e45d30ac0575300fdbdb3
    Closes-Bug: #1899772

Changed in networking-vpp:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.