Bug 1717925

Summary: Installing of dbus-broker fails in OpenBuildService Fedora Rawhide buildroot
Product: [Fedora] Fedora Reporter: Jonathan Brielmaier <jbrielmaier>
Component: dbus-brokerAssignee: Tom Gundersen <tgunders>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: daherrma, dh.herrmann, tgunders, yaneti
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-17 16:54:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Brielmaier 2019-06-06 13:18:43 UTC
Description of problem:
I'll try to build kanku also for Fedora:
https://build.opensuse.org/package/show/devel:kanku:staging/kanku
but it fails while installing the build dependencies.

Version-Release number of selected component (if applicable):
dbus-broker-21-3.fc31

How reproducible:
100%: on my local machine as well as on the build service.

The build log is the following:
[  168s] [817/952] installing dbus-broker-21-3.fc31
[  168s] groupadd: group 'dbus' already exists
[  168s] useradd: group '81' does not exist
[  168s] error: %prein(dbus-broker-21-3.fc31.x86_64) scriptlet failed, exit status 6
[  168s] error: dbus-broker-21-3.fc31.x86_64: install failed
[  168s] exit ...

Steps to reproduce:
osc checkout devel:kanku:staging/kanku
osc build Fedora_Rawhide --no-verify --clean
With `osc chroot Fedora_Rawhide -r` you can look around in the buildroot.

The problem is that while installing dbus-broker there exists already a dbus group with id 996 and not with id 81, which is the assumption dbus-broker has (%global dbus_user_id 81):
`cat /etc/group`:
[...]
systemd-coredump:x:997:
systemd-network:x:192:
systemd-resolve:x:193:
radvd:x:75:
dbus:x:996:
dnsmasq:x:995:
[...]

When assuming that /etc/group is filled chronological we get those packages who have maybe created the dbus group:
[759/952] installing radvd-2.17-19.fc31 -> creates radvd group
[760/952] installing systemd-pam-242-3.git7a6d834.fc31
[761/952] installing device-mapper-1.02.158-1.fc31
[762/952] installing perl-HTTP-Cookies-6.04-5.fc30
[763/952] installing gpm-1.20.7-18.fc31
[764/952] installing perl-CGI-Emulate-PSGI-0.23-8.fc30
[765/952] installing perl-Getopt-Long-1:2.50-418.fc30
[766/952] installing dnsmasq-2.80-4.fc31 -> creates dnsmasq
But none of them does, as well as any other RPM. I greped through them all, but couldn't find any hint which package creates the dbus group in the first place.

I have a simple patch, which might solve the problem. It only eliminates the symptom and not the root case of the problem. What creates the dbus group with id 996?

diff --git a/dbus-broker.spec b/dbus-broker.spec
index ac8d186..c11dd5c 100644
--- a/dbus-broker.spec
+++ b/dbus-broker.spec
@@ -56,11 +56,11 @@ recent Linux kernel releases.
 
 %pre
 # create dbus user and group
-getent group %{dbus_user_id} >/dev/null || \
+getent group dbus >/dev/null || \
         /usr/sbin/groupadd \
                 -g %{dbus_user_id} \
                 -r dbus
-getent passwd %{dbus_user_id} >/dev/null || \
+getent passwd dbus >/dev/null || \
         /usr/sbin/useradd \
                 -c 'System message bus' \
                 -u %{dbus_user_id} \

Additional links:
Online build log: https://build.opensuse.org/package/live_build_log/devel:kanku:staging/kanku/Fedora_Rawhide/x86_64
Config of Fedora Rawhide: https://build.opensuse.org/project/prjconf/Fedora:Rawhide
Config of the kanku project: https://build.opensuse.org/projects/devel:kanku:staging/meta

Comment 1 Jonathan Brielmaier 2019-06-06 16:15:58 UTC
I found a more minimal reproducer for the problem. I just created a package with only one BuildRequire:
BuildRequire: libvirt-daemon-driver-qemu

This leads to the described error. The following dbus packages are installed at the moment when dbus-broker will be installed:
buildroot: rpm -qa | grep dbus
dbus-libs-1.12.14-1.fc31.x86_64
dbus-common-1.12.14-1.fc31.noarch

A minimal working buildroot without any BuildRequire has this:
rpm -qa | grep dbus
dbus-common-1.12.14-1.fc31.noarch
dbus-1.12.14-1.fc31.x86_64
dbus-broker-21-3.fc31.x86_64

Comment 2 Jonathan Brielmaier 2019-06-11 08:07:07 UTC
I opened a pull request at dbus-broker:
https://src.fedoraproject.org/rpms/dbus-broker/pull-request/2

Comment 3 Ben Cotton 2019-08-13 17:11:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 4 Ben Cotton 2019-08-13 19:12:20 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 5 David Rheinsberg 2020-02-17 16:54:47 UTC
This is fixed in dbus-broker-21-4. Thanks for attending to this!