Bug 1449107

Summary: error: %pre(sssd-common-1.15.2-26.el7.x86_64) scriptlet failed, exit status 3
Product: Red Hat Enterprise Linux 7 Reporter: Sudhir Menon <sumenon>
Component: sssdAssignee: SSSD Maintainers <sssd-maint>
Status: CLOSED ERRATA QA Contact: sssd-qe <sssd-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: grajaiya, jhrozek, ksiddiqu, lslebodn, mkosek, mzidek, nsoman, pbrezina, sgoveas, sumenon, tscherf
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sssd-1.15.2-29.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 09:06:23 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:
Attachments:
Description Flags
Upgrade logs from sssd version 24 to 26
none
Upgrade logs from sssd version 21 to 26 none

Description Sudhir Menon 2017-05-09 08:50:33 UTC
Description of problem: error: %pre(sssd-common-1.15.2-26.el7.x86_64) scriptlet failed, exit status 3


Version-Release number of selected component (if applicable):
sssd-common.1.15.2-26.el7

How reproducible: Always

Steps to Reproduce: 
Upgrade from sssd-common.1.15.2-24.el7 to sssd-common.1.15.2-26.el7 fails

Actual results:
1. Upgrade from version 21 to 26 passes.
2. upgrade from version 24 to 26 fails.

Expected results:
Upgrade from version 24 to 24 should work fine without any errors.

Additional info: 

1. /tmp/sssd.24-26.txt shows the error while update is done.
2. /tmp/sssd.21-26.txt shows that update works fine.

Comment 2 Sudhir Menon 2017-05-09 08:51:49 UTC
Created attachment 1277318 [details]
Upgrade logs from sssd version 24 to 26

Comment 3 Sudhir Menon 2017-05-09 08:52:49 UTC
Created attachment 1277320 [details]
Upgrade logs from sssd version 21 to 26

Comment 7 Lukas Slebodnik 2017-05-11 09:02:41 UTC
Fix is to ignore errors in %pre scriptlet.
Because if sssd is not running then we cannot restart it later

It was previously ignored as well
/bin/systemctl status sssd.service >/dev/null 2>&1 && touch /var/tmp/sssd.upgrade || :


diff --git a/sssd.spec b/sssd.spec
index 89b8869..741cbd9 100644
--- a/sssd.spec
+++ b/sssd.spec
@@ -1165,7 +1165,7 @@ getent passwd sssd >/dev/null || useradd -r -g sssd -d / -s /sbin/nologin -c "Us
 %pre common
 getent group sssd >/dev/null || groupadd -r sssd
 getent passwd sssd >/dev/null || useradd -r -g sssd -d / -s /sbin/nologin -c "User for sssd" sssd
-/bin/systemctl is-active --quiet sssd.service && touch /var/tmp/sssd_is_running
+/bin/systemctl is-active --quiet sssd.service && touch /var/tmp/sssd_is_running || :
 
 %post common
 %systemd_post sssd.service

Comment 8 Lukas Slebodnik 2017-05-11 09:04:49 UTC
BTW it is not related to the initial version.
You can reproduce it even with sssd-common.1.15.2-21.el7. But sssd must not be running.

The problem is that test for upgrade for BZ1439457 does not cover this test-case.

Comment 9 Jakub Hrozek 2017-05-11 09:12:09 UTC
Thanks.

Steeve, Sudhir, I can of course build you a test package, but would it work to build a scratch build first that you could put into both CI and test https://bugzilla.redhat.com/show_bug.cgi?id=1439457 so that we can be sure we won't cause another issue?

Also, can you qa_ack this bug, please?

Comment 10 Steeve Goveas 2017-05-11 10:10:07 UTC
It will be tough to test this in CI, but we can test the scratch build manually. That should be a a good test to avoid anything from breaking.
Namita has already ack'd

Comment 11 Jakub Hrozek 2017-05-11 10:25:57 UTC
(In reply to Steeve Goveas from comment #10)
> It will be tough to test this in CI, but we can test the scratch build
> manually. That should be a a good test to avoid anything from breaking.
> Namita has already ack'd

OK, could you then please try this build:
https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13178470

Comment 14 Sudhir Menon 2017-05-15 12:59:46 UTC
Fix is seen. Verified using sssd-1.15.2-29.el7.

Comment 15 errata-xmlrpc 2017-08-01 09:06:23 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/RHEA-2017:2294