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 1478118 - system update blocked by PREIN error in setroubleshoot-server
Summary: system update blocked by PREIN error in setroubleshoot-server
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: setroubleshoot
Version: 7.4
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Vit Mojzis
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-03 15:41 UTC by Przemek Klosowski
Modified: 2018-10-30 09:47 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:47:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3100 0 None None None 2018-10-30 09:47:58 UTC

Description Przemek Klosowski 2017-08-03 15:41:54 UTC
Description of problem:
system update blocked by PREIN error in setroubleshoot-server

Version-Release number of selected component (if applicable):
setroubleshoot-server.x86_64 0:3.2.27.2-3.el7

How reproducible: every time

Steps to Reproduce:
1.yum update

Actual results:
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package setroubleshoot-server.x86_64 0:3.2.27.2-3.el7 will be updated
---> Package setroubleshoot-server.x86_64 0:3.2.28-3.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================
 Package                                             Arch                                 Version                                       Repository                                        Size
===============================================================================================================================================================================================
Updating:
 setroubleshoot-server                               x86_64                               3.2.28-3.el7                                  rhel-7-server-rpms                               384 k

Transaction Summary
===============================================================================================================================================================================================
Upgrade  1 Package

Total download size: 384 k
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for rhel-7-server-rpms
setroubleshoot-server-3.2.28-3.el7.x86_64.rpm                                                                                                                           | 384 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
useradd: group setroubleshoot exists - if you want to add this user to that group, use -g.
error: %pre(setroubleshoot-server-3.2.28-3.el7.x86_64) scriptlet failed, exit status 9
Error in PREIN scriptlet in rpm package setroubleshoot-server-3.2.28-3.el7.x86_64
setroubleshoot-server-3.2.27.2-3.el7.x86_64 was supposed to be removed but is not!
  Verifying  : setroubleshoot-server-3.2.27.2-3.el7.x86_64                                                                                                                                 1/2 
  Verifying  : setroubleshoot-server-3.2.28-3.el7.x86_64                                                                                                                                   2/2 

Failed:
  setroubleshoot-server.x86_64 0:3.2.27.2-3.el7                                                   setroubleshoot-server.x86_64 0:3.2.28-3.el7                                                  

Complete!


Expected results: successful update without errors

Comment 2 Przemek Klosowski 2017-08-03 15:47:17 UTC
A workaround is to delete the packages and group setroubleshoot, and reinstall:
yum erase setroubleshoot*
groupdel setroubleshoot
yum install setroubleshoot*

Comment 3 Milos Malik 2017-08-04 09:14:35 UTC
I managed to reproduce the situation you described, but I had to delete the setroubleshoot user and then create the setroubleshoot group manually.

Could you run following commands before "yum update" on the machine where the situation still happens?

# getent passwd setroubleshoot
# getent group setroubleshoot

Thank you!

Comment 4 Petr Lautrbach 2017-08-04 12:45:12 UTC
We could be more defensive and check for the existence of setroubleshoot group first:

diff --git a/setroubleshoot.spec b/setroubleshoot.spec
index 98cff01..608df0d 100644
--- a/setroubleshoot.spec
+++ b/setroubleshoot.spec
@@ -124,7 +124,8 @@ about the problem and help track its resolution. Alerts can be configured
 to user preference. The same tools can be run on existing log files.
 
 %pre server
-getent passwd %{username} >/dev/null || useradd -r -U -s /sbin/nologin -d %{pkgvardatadir} %{username}
+getent group %{username} >/dev/null || groupadd -r %{username}
+getent passwd %{username} >/dev/null || useradd -r -g %{username} -s /sbin/nologin -d %{pkgvardatadir} %{username}
 
 %post server
 %systemd_post auditd.service

Comment 5 Przemek Klosowski 2017-08-04 14:18:12 UTC
sorry, I don't have a machine with this problem any more. I did check that when the problem was appearing, the group 'setroubleshoot' existed in /etc/group (IIRC group number was 993) but the user 'setroubleshoot' did not appear in /etc/passwd
After I executed my workaround, the group and user were created.

[root@comsolcalc comsol]#  getent passwd setroubleshoot
setroubleshoot:x:994:989::/var/lib/setroubleshoot:/sbin/nologin
[root@comsolcalc comsol]# getent group setroubleshoot
setroubleshoot:x:989:

This may be related to the fact that we are trying to apply CIS hardening guidelines, which include removing setroubleshoot. Now, the root cause of this may be some RPM packaging issues: I noticed that erasing setroubleshoot does not affect setroubleshoot{-plugins,-server}, so there may be some cleanup issues. We may have removed and reinstalled setroubleshoot while messing with the CIS ansible rules. Please take a look at the pre/postinst scripts: perhaps they mess up group/user creation and/or detection when the package is installed/removed.

Comment 9 errata-xmlrpc 2018-10-30 09:47:31 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:3100


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