Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staticroutebfd fails to handle static route del notification #15267

Closed
vivekrnv opened this issue May 30, 2023 · 2 comments · Fixed by #15269
Closed

staticroutebfd fails to handle static route del notification #15267

vivekrnv opened this issue May 30, 2023 · 2 comments · Fixed by #15269

Comments

@vivekrnv
Copy link
Contributor

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):

@prsunny
Copy link
Contributor

prsunny commented May 30, 2023

Looking into this!

@prsunny
Copy link
Contributor

prsunny commented Jun 1, 2023

Fix PR - #15269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants