Bug 2361082

Summary: firewall-config: firewall.errors.FirewallError: INVALID_RULE: unknown element ipv4
Product: [Fedora] Fedora Reporter: Sam Varshavchik <mrsam>
Component: firewalldAssignee: Eric Garver <egarver>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: egarver, psutter, thaller, xzhou
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: firewalld-2.3.1-1.fc42 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-06-12 01:29:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sam Varshavchik 2025-04-19 02:06:30 UTC
firewall-config in F42 is having trouble with rich rules.

The existing rules, in the "Rich Rules" tab, are listed, but clicking "Edit" on each one does nothing.

If firewall-config is run in the console, clicking "Edit" produces this traceback:

Traceback (most recent call last):
  File "/usr/bin/firewall-config", line 3136, in onEditRichRule
    self.add_edit_rich_rule(False)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/usr/bin/firewall-config", line 3365, in add_edit_rich_rule
    self.on_richRuleDialog_changed()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/bin/firewall-config", line 3991, in on_richRuleDialog_changed
    rule = self.richRuleDialog_getRule()
  File "/usr/bin/firewall-config", line 3705, in richRuleDialog_getRule
    rule = rich.Rich_Rule("ipv4")  # ipv4 rule
  File "<string>", line 11, in __init__
  File "/usr/lib/python3.13/site-packages/firewall/core/rich.py", line 660, in __post_init__
    self._import_from_string(rule_str)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/firewall/core/rich.py", line 817, in _import_from_string
    raise FirewallError(
        errors.INVALID_RULE, "unknown element %s" % current_element
    )
firewall.errors.FirewallError: INVALID_RULE: unknown element ipv4


Reproducible: Always

Steps to Reproduce:
Run firewall-config in a terminal window, and let's try to add a simple rich rule. In the rich rule tab.

1. Click "Add"
2. For "Family" select "ipv4".
3. Click the "Action" checkbox, leaving the default action to "Accept"
4. Leave default "Source" as "IP", click on the field next to it, and enter an IP address. 192.168.0.1 will do just fine.

Actual Results:
This is now a complete rich rule, but the "Ok" button remains grayed out.

Expected Results:
The "Ok" button is enabled, and adds a new rich rule.

Additional Information:
firewall-config-2.3.0-4.fc42.noarch

Executing steps 2, 3, and 4 results in the following traceback on the console:

Traceback (most recent call last):
  File "/usr/bin/firewall-config", line 3991, in on_richRuleDialog_changed
    rule = self.richRuleDialog_getRule()
  File "/usr/bin/firewall-config", line 3705, in richRuleDialog_getRule
    rule = rich.Rich_Rule("ipv4")  # ipv4 rule
  File "<string>", line 11, in __init__
  File "/usr/lib/python3.13/site-packages/firewall/core/rich.py", line 660, in __post_init__
    self._import_from_string(rule_str)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/firewall/core/rich.py", line 817, in _import_from_string
    raise FirewallError(
        errors.INVALID_RULE, "unknown element %s" % current_element
    )
firewall.errors.FirewallError: INVALID_RULE: unknown element ipv4

Comment 1 Eric Garver 2025-05-30 18:22:39 UTC
Fixed upstream:
 https://github.com/firewalld/firewalld/pull/1440

Comment 2 Fedora Update System 2025-06-10 19:56:14 UTC
FEDORA-2025-8b41471a05 (firewalld-2.3.1-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-8b41471a05

Comment 3 Fedora Update System 2025-06-11 04:01:20 UTC
FEDORA-2025-8b41471a05 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-8b41471a05`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-8b41471a05

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2025-06-12 01:29:47 UTC
FEDORA-2025-8b41471a05 (firewalld-2.3.1-1.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.