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 1600694 - DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
Summary: DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.5
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 1600696
TreeView+ depends on / blocked
 
Reported: 2018-07-12 19:21 UTC by John Sefler
Modified: 2018-10-30 10:38 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1600696 (view as bug list)
Environment:
Last Closed: 2018-10-30 10:37:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 1908 0 None closed 1600694: Log dbus exception tracebacks at the debug level 2021-01-05 08:22:49 UTC
Red Hat Product Errata RHBA-2018:3153 0 None None None 2018-10-30 10:38:05 UTC

Description John Sefler 2018-07-12 19:21:49 UTC
Description of problem:
Although benign AFAICT, this traceback is being logged to rhsm.log within the latest container from registry.access.redhat.com/rhel7....

2018-07-12 18:31:14,098 [DEBUG] subscription-manager:26:MainThread @https.py:56 - Using standard libs to provide httplib and ssl
2018-07-12 18:31:14,251 [DEBUG] subscription-manager:26:MainThread @dbus_interface.py:37 - self.has_main_loop=False
2018-07-12 18:31:14,251 [DEBUG] subscription-manager:26:MainThread @dbus_interface.py:53 - Unable to connect to dbus
2018-07-12 18:31:14,251 [ERROR] subscription-manager:26:MainThread @dbus_interface.py:54 - org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/subscription_manager/dbus_interface.py", line 40, in __init__
    self.bus = dbus.SystemBus()
  File "/usr/lib64/python2.7/site-packages/dbus/_dbus.py", line 194, in __new__
    private=private)
  File "/usr/lib64/python2.7/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib64/python2.7/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory


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

[root@988b6164f974 /]# rpm -q subscription-manager
subscription-manager-1.20.11-1.el7_5.x86_64
[root@988b6164f974 /]# 
[root@988b6164f974 /]# systemctl status dbus.service
Failed to get D-Bus connection: Operation not permitted


How reproducible:
occurs on the registry.access.redhat.com/rhel7:latest image


Steps to Reproduce:
On an RHEL7 host with docker installed and registry.access.redhat.com/rhel7:latest pulled....

[root@jsefler-rhel7 ~]# docker images
REPOSITORY                         TAG                 IMAGE ID            CREATED             SIZE
registry.access.redhat.com/rhel6   latest              b8952d1c7180        2 weeks ago         200 MB
registry.access.redhat.com/rhel7   latest              e64297b706b7        3 weeks ago         201 MB
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# docker run -i -t --rm registry.access.redhat.com/rhel7:latest /bin/bash
[root@6be5cc42ce39 /]# 
[root@6be5cc42ce39 /]# truncate --size=0 /var/log/rhsm/rhsm.log 
[root@6be5cc42ce39 /]# 
[root@6be5cc42ce39 /]# subscription-manager status
subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management.

[root@6be5cc42ce39 /]# cat /var/log/rhsm/rhsm.log 
2018-07-12 18:57:12,616 [DEBUG] subscription-manager:14:MainThread @https.py:56 - Using standard libs to provide httplib and ssl
2018-07-12 18:57:12,730 [DEBUG] subscription-manager:14:MainThread @dbus_interface.py:37 - self.has_main_loop=False
2018-07-12 18:57:12,730 [DEBUG] subscription-manager:14:MainThread @dbus_interface.py:53 - Unable to connect to dbus
2018-07-12 18:57:12,730 [ERROR] subscription-manager:14:MainThread @dbus_interface.py:54 - org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/subscription_manager/dbus_interface.py", line 40, in __init__
    self.bus = dbus.SystemBus()
  File "/usr/lib64/python2.7/site-packages/dbus/_dbus.py", line 194, in __new__
    private=private)
  File "/usr/lib64/python2.7/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib64/python2.7/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
2018-07-12 18:57:12,776 [DEBUG] subscription-manager:14:MainThread @ga_loader.py:91 - ga_loader GaImporterGtk3
2018-07-12 18:57:12,777 [DEBUG] subscription-manager:14:MainThread @plugins.py:569 - loaded plugin modules: []
2018-07-12 18:57:12,778 [DEBUG] subscription-manager:14:MainThread @plugins.py:570 - loaded plugins: {}
2018-07-12 18:57:12,778 [DEBUG] subscription-manager:14:MainThread @identity.py:137 - Loading consumer info from identity certificates.
2018-07-12 18:57:12,778 [ERROR] subscription-manager:14:MainThread @identity.py:145 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
[root@6be5cc42ce39 /]# 
[root@6be5cc42ce39 /]# exit
exit
[root@jsefler-rhel7 ~]# 



Actual results:
  above you see that a failed attempt to connect to dbus logs a Traceback in rhsm.log

Expected results:
  Either...
   A) When running within a container, there should be no need for subscription-manager to attempt a connection to dbus.
   B) Regardless of what environment subscription-manager is running, all failed attempts to connect to dbus could be swallowed.

Need help from subscription-manager developers to decide the most graceful way to handle a failed attempt to connect to dbus and what the ramifications are to the customer experience when dbus is not running.

Additional info:

Comment 1 Kevin Howell 2018-07-16 14:06:17 UTC
Dev, let's implement both A) and B).

When we swallow the d-bus connection attempt failure we can continue logging at debug level that we're not connected to D-Bus. ("Unable to connect to dbus" above).

Comment 6 Shwetha Kallesh 2018-09-10 14:31:21 UTC
Reproducer:
[root@hp-dl380pgen8-02-vm-9 ~]# docker pull rhel7
Using default tag: latest
Trying to pull repository registry.access.redhat.com/rhel7 ... 
latest: Pulling from registry.access.redhat.com/rhel7
367d84554057: Pull complete 
b82a357e4f15: Pull complete 
Digest: sha256:9d3a75b364209190f372645855801d007e7b4f5a4fbff0da83dc64879a808c90
Status: Downloaded newer image for registry.access.redhat.com/rhel7:latest
[root@hp-dl380pgen8-02-vm-9 ~]# docker run -i -t --rm registry.access.redhat.com/rhel7:latest /bin/bash
[root@ee6ff8ecfa83 /]# truncate --size=0 /var/log/rhsm/rhsm.log 
[root@ee6ff8ecfa83 /]# subscription-manager status
subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management.

[root@ee6ff8ecfa83 /]# cat /var/log/rhsm/rhsm.log
2018-09-05 09:22:38,139 [ERROR] subscription-manager:14:MainThread @dbus_interface.py:54 - org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/subscription_manager/dbus_interface.py", line 40, in __init__
    self.bus = dbus.SystemBus()
  File "/usr/lib64/python2.7/site-packages/dbus/_dbus.py", line 194, in __new__
    private=private)
  File "/usr/lib64/python2.7/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib64/python2.7/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
2018-09-05 09:22:38,201 [ERROR] subscription-manager:14:MainThread @identity.py:145 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
[root@ee6ff8ecfa83 /]# rpm -qa | grep subscription-manager
subscription-manager-rhsm-certificates-1.20.11-1.el7_5.x86_64
subscription-manager-1.20.11-1.el7_5.x86_64
subscription-manager-rhsm-1.20.11-1.el7_5.x86_64




Verification:

[root@2fc2f8adcf74 /]# rpm -qa | grep subscription-manager 
subscription-manager-rhsm-certificates-1.21.10-2.el7.x86_64
subscription-manager-1.21.10-2.el7.x86_64
subscription-manager-rhsm-1.21.10-2.el7.x86_64


[root@hp-dl120gen9-01 ~]# docker run -i -t --rm registry.access.redhat.com/rhel7:latest /bin/bash

[root@2fc2f8adcf74 /]# truncate --size=0 /var/log/rhsm/rhsm.log 
[root@2fc2f8adcf74 /]# subscription-manager status
subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management.

[root@2fc2f8adcf74 /]# cat /var/log/rhsm/rhsm.log

Comment 8 errata-xmlrpc 2018-10-30 10:37:37 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://access.redhat.com/errata/RHBA-2018:3153


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