Python traceback with show firewall (for bridge firewall)

If I define a bridge output firewall filter default action, then show firewall has an error. If I remove the bridge output firewall filter default action, then there is no error.

vyos@vyos:~$ show version
Version:          VyOS 1.5-rolling-202408230022
Release train:    current
Release flavor:   generic

Built by:         autobuild@vyos.net
Built on:         Fri 23 Aug 2024 00:22 UTC
Build UUID:       0e1932fe-805c-4b46-9dde-486cbc0b38a5
Build commit ID:  c5c6a1347c1533

Architecture:     x86_64
Boot via:         installed image
System type:      Unknown hypervisor guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (Q35 + ICH9, 2009)
Hardware S/N:
Hardware UUID:    0d148253-6ecc-4f38-9477-e42bcddf8a74

Copyright:        VyOS maintainers and contributors
vyos@vyos# show firewall
 bridge {
     forward {
         filter {
             default-action accept
         }
     }
     input {
         filter {
             default-action accept
         }
     }
     output {
         filter {
             default-action accept
         }
     }
     prerouting {
         filter {
             default-action accept
         }
     }
 }
[edit]
vyos@vyos# exit
exit
vyos@vyos:~$ show firewall
Rulesets Information

---------------------------------
bridge Firewall "forward filter"

Rule     Action    Protocol      Packets    Bytes
-------  --------  ----------  ---------  -------
default  accept    all                 0        0

---------------------------------
bridge Firewall "input filter"

Rule     Action    Protocol      Packets    Bytes
-------  --------  ----------  ---------  -------
default  accept    all              2694   242658

---------------------------------
bridge Firewall "output filter"
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/firewall.py", line 720, in <module>
    show_firewall()
  File "/usr/libexec/vyos/op_mode/firewall.py", line 373, in show_firewall
    output_firewall_name(family, hook, prior, prior_conf)
  File "/usr/libexec/vyos/op_mode/firewall.py", line 186, in output_firewall_name
    rule_details = details['default-action']
                   ~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'default-action'

Can you check newer version? A typo on firewall bridge output template was fixed in this commit: T6647: firewall. Introduce patch for accepting ARP and DHCP replies o… · vyos/vyos-1x@8e0e1a9 · GitHub
So most probably that bug was fixed there.

I confirmed with 1.5-rolling-202410052321 that the error is fixed. Sorry for reporting with such an old version.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.