RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1367038 - firewall-cmd crashes if /run/dbus/system_bus_socket does not exist
Summary: firewall-cmd crashes if /run/dbus/system_bus_socket does not exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: firewalld
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Thomas Woerner
QA Contact: Tomas Dolezal
URL:
Whiteboard:
Depends On: 1358380
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-15 11:14 UTC by Thomas Woerner
Modified: 2016-11-03 21:04 UTC (History)
4 users (show)

Fixed In Version: firewalld-0.4.3.2-5.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1358380
Environment:
Last Closed: 2016-11-03 21:04:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2597 0 normal SHIPPED_LIVE Moderate: firewalld security, bug fix, and enhancement update 2016-11-03 12:11:47 UTC

Description Thomas Woerner 2016-08-15 11:14:28 UTC
+++ This bug was initially created as a clone of Bug #1358380 +++

Description of problem:

If /run/dbus/system_bus_socket does not exist (e.g. chrooting environment), firewall-cmd crashes as follows.
=====================
[root@localhost ~]# firewall-cmd --reload
Not using slip
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/firewall/client.py", line 2200, in __init__
    self.bus = slip.dbus.SystemBus()
  File "<string>", line 2, in SystemBus
  File "/usr/lib64/python3.5/site-packages/dbus/_dbus.py", line 194, in __new__
    private=private)
  File "/usr/lib64/python3.5/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib64/python3.5/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/firewall-cmd", line 913, in <module>
    fw = FirewallClient()
  File "<decorator-gen-615>", line 2, in __init__
  File "/usr/lib/python3.5/site-packages/firewall/client.py", line 53, in handle_exceptions
    return func(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/firewall/client.py", line 2204, in __init__
    self.bus = dbus.SystemBus()
  File "/usr/lib64/python3.5/site-packages/dbus/_dbus.py", line 194, in __new__
    private=private)
  File "/usr/lib64/python3.5/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib64/python3.5/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
=====================

This affects, e.g. when we run the following command:
# dnf --releasever=24 --installroot=/tmp/newsysimage install systemd-journal-remote

Version-Release number of selected component (if applicable):

firewalld-0.4.3.2-1.fc24.noarch
firewalld-0.4.3.2-1.fc25.noarch

How reproducible:

always

Steps to Reproduce:
1. dnf --releasever=24 --installroot=/tmp/newsysimage install systemd-journal-remote

Actual results:

crash with the above report.

Expected results:

firewall-cmd safely fails, that is, just output error message and exit.

Additional info:

firewall-cmd --reload is used in %firewalld_reload rpm macro.
So, when we install software which use the macro in their post scripts to chrooting environment, the above crash always occurs.
Fortunately, the crash does not cause any actual problem as we do not need to reload in such cases.

--- Additional comment from Thomas Woerner on 2016-08-15 06:52:24 EDT ---

Fixed upstream:

https://github.com/t-woerner/firewalld/commit/d9579e983f5a196e7ed155035c0e8283c4f9f904
https://github.com/t-woerner/firewalld/commit/937eb926a1ec6f09a3ff825296927e9964232204

Related to this is also the following upstream fix:

https://github.com/t-woerner/firewalld/commit/63f4f46180d5fe26a68ef6517d2f612fb74a3254

Comment 5 errata-xmlrpc 2016-11-03 21:04:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2597.html


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