Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1367038 - firewall-cmd crashes if /run/dbus/system_bus_socket does not exist
firewall-cmd crashes if /run/dbus/system_bus_socket does not exist
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: firewalld (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Thomas Woerner
Tomas Dolezal
:
Depends On: 1358380
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-15 07:14 EDT by Thomas Woerner
Modified: 2016-11-03 17:04 EDT (History)
4 users (show)

See Also:
Fixed In Version: firewalld-0.4.3.2-5.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1358380
Environment:
Last Closed: 2016-11-03 17:04:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2597 normal SHIPPED_LIVE Moderate: firewalld security, bug fix, and enhancement update 2016-11-03 08:11:47 EDT

  None (edit)
Description Thomas Woerner 2016-08-15 07:14:28 EDT
+++ 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 17:04:12 EDT
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.