Bug 240617 - yum groupinstall not failing when package in group fails
yum groupinstall not failing when package in group fails
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yum (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: James Antill
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-18 16:33 EDT by Guil Barros
Modified: 2010-10-22 11:11 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 16:44:04 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Simple pacakge with no content that has a bad %pre script (1.41 KB, application/x-rpm)
2008-05-27 15:45 EDT, Frank Hirtz
no flags Details
Simple pacakge with no content that will install cleanly (1.40 KB, application/x-rpm)
2008-05-27 15:46 EDT, Frank Hirtz
no flags Details

  None (edit)
Description Guil Barros 2007-05-18 16:33:52 EDT
Description of problem:
If a package in a groupinstall fails it continues with following packages and
returns success (zero). Should return fail (non-zero).

Version-Release number of selected component (if applicable):
yum-3.0.1-5.el5

How reproducible:
always

Steps to Reproduce:
[root@njlxlabvmgfb01 ~]# yum groupinstall lb-hpov-pre

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 lb-hpov-pre-AS4.0       noarch     3.5-5            lehman-c          4.0 k
Installing for dependencies:
 lb-functions            noarch     1.2-4            lehman-c          8.3 k

Transaction Summary
=============================================================================
Install      2 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 12 k
Is this ok [y/N]: y
ERROR [CheckFile]: File /etc/auto_opt_override does not exist.
error: %post(lb-hpov-pre-AS4.0-3.5-5.noarch) scriptlet failed, exit status 2

Installed: lb-hpov-pre-AS4.0.noarch 0:3.5-5
Dependency Installed: lb-functions.noarch 0:1.2-4
[root@njlxlabvmgfb01 ~]# echo $?
0


Expected results:
groupinstall should have failed as a package in the group failed to install.
Comment 1 Seth Vidal 2007-06-20 11:57:54 EDT
reassigning to rpm as we need some way of knowing what happened in the
transaction scriptlets for yum to respond appropriately.
Comment 2 Jeff Johnson 2007-06-20 22:40:38 EDT
All errors in rpm go through rpmError() which has a python method to use a buffer, not
stderr, for saving errors. That includes the msg above (from lib/psm.c):

        rpmError(RPMERR_SCRIPT,
                _("%s(%s-%s-%s.%s) scriptlet failed, exit status %d\n"),
                sln, n, v, r, a, WEXITSTATUS(psm->sq.status));

The "way of knowing" has been in rpm since the year 2000 (at least).

I'm not at all sure how yum is going to respond appropriately. A non-existent file
is a packaging, not a tool, error.
Comment 3 Frank Hirtz 2007-06-21 08:08:43 EDT
The point of this issue is that ANY pkg that fails in a yum group should report
a different exit code than zero.  This was a test where we forced one of the
rpms in a yum group to fail (on purpose) with an exit code of non-zero.  The yum
groupinstall still reports an exit code of zero when I feel it should report
otherwise.

It even shows that it was installed when yet it was not completely installed
with success.
Comment 4 Jeff Johnson 2007-06-21 19:29:51 EDT
I'd suggest moving the discussion back to yum then. I just responded to comment #1, have no other 
context. rpm certainly has no concept of "yum groups".
Comment 5 RHEL Product and Program Management 2007-10-19 16:29:06 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 6 Frank Hirtz 2007-12-06 13:40:18 EST
Moving back to yum per Jeff's suggestion.
Comment 10 Frank Hirtz 2008-05-27 15:45:56 EDT
Created attachment 306827 [details]
Simple pacakge with no content that has a bad %pre script
Comment 11 Frank Hirtz 2008-05-27 15:46:35 EDT
Created attachment 306828 [details]
Simple pacakge with no content that will install cleanly
Comment 12 Frank Hirtz 2008-05-27 15:47:43 EDT
Attached is my simple test case for this problem:

<snip>
[root@ibm-x3650-1 SPECS]# yum localinstall
/usr/src/redhat/RPMS/noarch/test-prebroke-1.0-1.noarch.rpm
/usr/src/redhat/RPMS/noarch/test-works-1.0-1.noarch.rpm --nogpgcheck
Loading "rhnplugin" plugin
Loading "filter-data" plugin
Loading "security" plugin
Setting up Local Package Process
rhel-x86_64-server-5      100% |=========================| 1.4 kB    00:00     
rhn-tools-rhel-x86_64-ser 100% |=========================| 1.2 kB    00:00     
rhel-x86_64-server-5-beta 100% |=========================| 1.2 kB    00:00     
rhel-x86_64-server-vt-5   100% |=========================| 1.4 kB    00:00     
rhel-x86_64-server-supple 100% |=========================| 1.2 kB    00:00     
Examining /usr/src/redhat/RPMS/noarch/test-prebroke-1.0-1.noarch.rpm:
test-prebroke - 1.0-1.noarch
Examining /usr/src/redhat/RPMS/noarch/test-works-1.0-1.noarch.rpm: test-works -
1.0-1.noarch
Marking /usr/src/redhat/RPMS/noarch/test-prebroke-1.0-1.noarch.rpm to be installed
Marking /usr/src/redhat/RPMS/noarch/test-works-1.0-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package test-works.noarch 0:1.0-1 set to be updated
---> Package test-prebroke.noarch 0:1.0-1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 test-prebroke           noarch     1.0-1           
/usr/src/redhat/RPMS/noarch/test-prebroke-1.0-1.noarch.rpm   0.0 
 test-works              noarch     1.0-1           
/usr/src/redhat/RPMS/noarch/test-works-1.0-1.noarch.rpm   0.0 

Transaction Summary
=============================================================================
Install      2 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 0 
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
/var/tmp/rpm-tmp.95840: line 1: cd: /foo/bar/baz: No such file or directory
error: %pre(test-prebroke-1.0-1.noarch) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping test-prebroke-1.0-1
  Installing: test-works                   ######################### [2/2] 

Installed: test-prebroke.noarch 0:1.0-1 test-works.noarch 0:1.0-1
Complete!
[root@ibm-x3650-1 SPECS]# rpm -qa | grep test\-
test-works-1.0-1
[root@ibm-x3650-1 SPECS]# 
</snip>
Comment 13 Frank Hirtz 2008-05-27 15:50:43 EDT
I'd omitted the last line where we check the exit code:

<snip>
[root@ibm-x3650-1 SPECS]# echo $?
0
</snip>
Comment 15 RHEL Product and Program Management 2008-06-02 16:37:10 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 19 errata-xmlrpc 2009-01-20 16:44:04 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0176.html

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