trex-core icon indicating copy to clipboard operation
trex-core copied to clipboard

Deleting bird namespace fails sometimes with the error `namespace wasn't created by TRex!"`

Open hprem opened this issue 1 year ago • 0 comments

I am using TRex (v3.02) in a ubuntu VM for bgp peering (using Bird) and pumping traffic over bgp advertised prefixes

After my tests, during the cleanup, the bird namespace deletion, fails (about 50% of the time) with the error message trex.common.trex_exceptions.TRexError: ["namespace 'trex-a-bird-ns' wasn't created by TRex!"]

Most of the time, restarting TRex process fixes the issue. But very rarely, even that seems to fail.

>>> t.set_namespace(0, 'get_nodes')
{'result': {'nodes': ['b2:de:ad:be:ef:00', 'b0:de:ad:be:ef:0d', 'b0:de:ad:be:ef:0c']}}
>>>
>>> t.set_namespace(0, 'get_nodes_info', macs_list=['b2:de:ad:be:ef:00'])
{'result': {'nodes': [{'bpf': '', 'ether': {'src': 'b2:de:ad:be:ef:00'}, 'ipv4': {'src': '10.1.1.2', 'subnet': 24}, 'ipv6': {'enabled': True, 'src': '2001:10:1:1::2', 'subnet': 64}, 'is-shared-ns': True, 'is_bird': True, 'linux-ns': 'trex-a-bird-ns', 'l
inux-veth-external': 'bird-0-0-T', 'linux-veth-internal': 'bird-0-0-L', 'vlan': {'tags': [], 'tpids': []}, 'vlan_filter': 'all'}]}}
>>>
>>> t.set_namespace(0, 'remove_shared_ns', shared_ns='trex-a-bird-ns')
Traceback (most recent call last):
  File "/usr/lib/python3.9/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<console>", line 1, in <module>
  File "/home/hprem/trex_client/trex_client_v3.02/interactive/trex/common/trex_api_annotators.py", line 51, in wrap2
    ret = f(*args, **kwargs)                                                                                                                                                                                                                                   File "/home/hprem/trex_client/trex_client_v3.02/interactive/trex/common/trex_client.py", line 1523, in set_namespace
    rc = self.wait_for_async_results(port)
  File "/home/hprem/trex_client/trex_client_v3.02/interactive/trex/common/trex_api_annotators.py", line 51, in wrap2
    ret = f(*args, **kwargs)
  File "/home/hprem/trex_client/trex_client_v3.02/interactive/trex/common/trex_client.py", line 1479, in wait_for_async_results
    raise TRexError(nc.errors())
trex.common.trex_exceptions.TRexError: ["namespace 'trex-a-bird-ns' wasn't created by TRex!"]
>>>

TRex is running in a VM and all namespaces in the VM are managed only through trex. There is no other user manually creating/removing namespaces on the VM. Bird is being driven programatically via TRex apis

So this error doesn't seem to make any sense. May be I am failing to understand what this error actually means. And is there a way to force delete the namespace, even if TRex thinks it didn't create the namespace?

hprem avatar Mar 30 '23 09:03 hprem