Skip to content

staticroutebfd fails to handle static route del notification #15267

@vivekrnv

Description

@vivekrnv

Description

staticroutebfd throwing exception and restarting bgp container while handling a static route delete.

Steps to reproduce the issue:

  1. config interface ip add Ethernet64 3.3.3.3/24
  2. config route add prefix 50.50.50.0/24 nexthop 3.3.3.4
  3. config route del prefix 50.50.50.0/24 nexthop 3.3.3.4

Describe the results you received:

May 30 22:54:08.017236 r-panther-simx-13 DEBUG bgp#staticroutebfd: Received message : '('default|50.50.50.0/24', 'DEL', ())'
May 30 22:54:08.017236 r-panther-simx-13 DEBUG bgp#bgpcfgd: Received message : '('default|50.50.50.0/24', 'DEL', ())'
May 30 22:54:08.020484 r-panther-simx-13 DEBUG bgp#bgpcfgd: CONFIG_DB Static route default|50.50.50.0/24 is scheduled for updates. ['no ip route 50.50.50.0/24 3.3.3.4 tag 1']
May 30 22:54:08.020484 r-panther-simx-13 CRIT bgp#staticroutebfd: Got an exception 'NoneType' object is not subscriptable: Traceback: Traceback (most recent call last):#012  File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 745, in main#012    do_work()#012  File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 737, in do_work#012    sr_bfd.run()#012  File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 733, in run#012    callback(key, op, dict(fvs))#012  File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 536, in static_route_callback#012    self.static_route_del_handler(key, True)#012  File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 507, in static_route_del_handler#012    nh_vrf = nh_vrf_list[index]#012TypeError: 'NoneType' object is not subscriptable
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd Traceback (most recent call last):
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd   File "/usr/local/bin/staticroutebfd", line 8, in <module>
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd     sys.exit(main())
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd   File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 745, in main
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd     do_work()
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd   File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 737, in do_work
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd     sr_bfd.run()
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd   File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 733, in run
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd     callback(key, op, dict(fvs))
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd   File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 536, in static_route_callback
May 30 22:54:08.020484 r-panther-simx-13 DEBUG bgp#bgpcfgd: execute command '['vtysh', '-f', '/tmp/tmpkldpilww']'.
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd     self.static_route_del_handler(key, True)
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd   File "/usr/local/lib/python3.9/dist-packages/staticroutebfd/main.py", line 507, in static_route_del_handler
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd     nh_vrf = nh_vrf_list[index]
May 30 22:54:08.020484 r-panther-simx-13 INFO bgp#supervisord: staticroutebfd TypeError: 'NoneType' object is not subscriptable

And also restarts the bgp container

Describe the results you expected:

staticroutebfd should handle the del notification gracefully

Output of show version:

master labels built with this #13789

Additional information you deem important (e.g. issue happens only occasionally):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions