Bug 533831 - Yum reports package installed even if scriptled failed
Summary: Yum reports package installed even if scriptled failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rpm
Version: 5.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On: 216221
Blocks: 590060 769266
TreeView+ depends on / blocked
 
Reported: 2009-11-09 13:35 UTC by Olivier Fourdan
Modified: 2018-11-26 19:35 UTC (History)
9 users (show)

Fixed In Version: rpm-4.4.2.3-26.el5
Doc Type: Bug Fix
Doc Text:
Clone Of: 216221
Environment:
Last Closed: 2012-02-21 06:45:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (backport from upstream) (3.38 KB, patch)
2009-11-09 13:35 UTC, Olivier Fourdan
no flags Details | Diff
example foo package (1.61 KB, application/x-rpm)
2009-11-09 13:36 UTC, Olivier Fourdan
no flags Details
example bar package (1.55 KB, application/x-rpm)
2009-11-09 13:37 UTC, Olivier Fourdan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0283 0 normal SHIPPED_LIVE rpm bug fix and enhancement update 2012-02-20 15:05:55 UTC

Description Olivier Fourdan 2009-11-09 13:35:07 UTC
Created attachment 368203 [details]
Proposed patch (backport from upstream)

+++ This bug was initially created as a clone of Bug #216221 +++

Description of problem:

If one package installation fails in scriptlet (%pre or %post) yum is not notified and still reports the package as installed.

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

rpm-4.4.2.3-18.el5
yum-3.2.22-20.el5

How reproducible:

Always

Steps to Reproduce:
1. build foo and bar from attached src rpm
2. yum localinstall --nogpgcheck -y foo-1.0-1.noarch.rpm bar-1.0-1.noarch.rpm
  
Actual results:

Setting up Local Package Process
Examining foo-1.0-1.noarch.rpm: foo-1.0-1.noarch
Marking foo-1.0-1.noarch.rpm to be installed
Examining bar-1.0-1.noarch.rpm: bar-1.0-1.noarch
Marking bar-1.0-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package bar.noarch 0:1.0-1 set to be updated
---> Package foo.noarch 0:1.0-1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================
 Package    Arch          Version        Repository                Size
========================================================================
Installing:
 bar        noarch        1.0-1          /bar-1.0-1.noarch         0.0 
 foo        noarch        1.0-1          /foo-1.0-1.noarch         0.0 

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

Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
error: %pre(bar-1.0-1.noarch) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping bar-1.0-1
  Installing     : foo                                              2/2 

Installed:
  bar.noarch 0:1.0-1                 foo.noarch 0:1.0-1                

Complete!

Expected results:

Setting up Local Package Process
Examining foo-1.0-1.noarch.rpm: foo-1.0-1.noarch
Marking foo-1.0-1.noarch.rpm to be installed
Examining bar-1.0-1.noarch.rpm: bar-1.0-1.noarch
Marking bar-1.0-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package bar.noarch 0:1.0-1 set to be updated
---> Package foo.noarch 0:1.0-1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================
 Package    Arch          Version        Repository                Size
========================================================================
Installing:
 bar        noarch        1.0-1          /bar-1.0-1.noarch         0.0 
 foo        noarch        1.0-1          /foo-1.0-1.noarch         0.0 

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

Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Error in <unknown> scriptlet in rpm package bar-1.0-1.noarch
error: %pre(bar-1.0-1.noarch) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping bar-1.0-1
  Installing     : foo                                              2/2 

Installed:
  foo.noarch 0:1.0-1                                                    

Failed:
  bar.noarch 0:1.0-1                                                    

Complete!

Additional info:

yum-3.2.22 contains the required code but relies on the notification taht is present upstream in rpm 4.6.

The proposed patch here attached is a backport of the notification for failed scriptlet in rpm 4.4 so that yum rightfully reports the package that failed in scriptled.

Comment 1 Olivier Fourdan 2009-11-09 13:36:23 UTC
Created attachment 368205 [details]
example foo package

Comment 2 Olivier Fourdan 2009-11-09 13:37:14 UTC
Created attachment 368206 [details]
example bar package

Comment 3 Gopinath Marappan 2010-06-11 07:06:40 UTC
Saw a similar issue on RHEL5.5.  When will this patch be available for download?

Thanks.

Comment 5 RHEL Program Management 2010-08-09 19:27:42 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 27 errata-xmlrpc 2012-02-21 06:45: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.

http://rhn.redhat.com/errata/RHBA-2012-0283.html


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