Bug 2361082 - firewall-config: firewall.errors.FirewallError: INVALID_RULE: unknown element ipv4
Summary: firewall-config: firewall.errors.FirewallError: INVALID_RULE: unknown element...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: firewalld
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Eric Garver
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-04-19 02:06 UTC by Sam Varshavchik
Modified: 2025-06-12 01:29 UTC (History)
4 users (show)

Fixed In Version: firewalld-2.3.1-1.fc42
Clone Of:
Environment:
Last Closed: 2025-06-12 01:29:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github firewalld firewalld issues 1463 0 None open firewall-config: errors.INVALID_RULE, "unknown element %s" % current_element 2025-04-21 13:53:54 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.