Bug 216221 - Says it deleted Dependency, but with scriptlet exit status 2, it really did not
Says it deleted Dependency, but with scriptlet exit status 2, it really did not
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
All Linux
medium Severity high
: ---
: ---
Assigned To: Panu Matilainen
:
: yum-pre-error (view as bug list)
Depends On:
Blocks: 533831
  Show dependency treegraph
 
Reported: 2006-11-17 16:24 EST by Bob Gustafson
Modified: 2016-12-07 10:12 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 533831 (view as bug list)
Environment:
Last Closed: 2008-10-16 13:09:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bob Gustafson 2006-11-17 16:24:30 EST
Description of problem:

This is perhaps a cosmetic problem.

Yum says:

Removed: java-1.5.0-sun.i586 0:1.5.0.06-1jpp
Dependency Removed: java-1.5.0-sun-devel.i586 0:1.5.0.06-1jpp
Complete!

But in fact, it did not remove the file.
Subsequent running of identical command gives same result.

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

  [root@hoho2 Desktop]# yum --version
  Loading "installonlyn" plugin
  3.0
  [root@hoho2 Desktop]#

OS is updated FC6

How reproducible:

  Infinitely

Steps to Reproduce:
1. see 'Actual results' below
2.
3.
  
Actual results:

[root@hoho2 Desktop]# yum erase java-1.5.0-sun-1.5.0.06-1jpp
Loading "installonlyn" plugin
Setting up Remove Process
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package java-1.5.0-sun.i586 0:1.5.0.06-1jpp set to be erased
--> Running transaction check
Setting up repositories
Reading repository metadata in from local files
--> Processing Dependency: java-1.5.0-sun = 0:1.5.0.06-1jpp for package:
java-1.5.0-sun-devel
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package java-1.5.0-sun-devel.i586 0:1.5.0.06-1jpp set to be erased
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Removing:
 java-1.5.0-sun          i586       1.5.0.06-1jpp    installed          84 M
Removing for dependencies:
 java-1.5.0-sun-devel    i586       1.5.0.06-1jpp    installed          12 M

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

Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Removing  : java-1.5.0-sun-devel         ######################### [1/2]
/usr/lib/jvm/java-1.5.0-sun/bin/javac has not been configured as an alternative
for javac
error: %postun(java-1.5.0-sun-devel-1.5.0.06-1jpp.i586) scriptlet failed, exit
status 2
  Removing  : java-1.5.0-sun               ######################### [2/2]
/usr/lib/jvm/jre-1.5.0-sun/bin/java has not been configured as an alternative
for java
error: %postun(java-1.5.0-sun-1.5.0.06-1jpp.i586) scriptlet failed, exit status 2

Removed: java-1.5.0-sun.i586 0:1.5.0.06-1jpp
Dependency Removed: java-1.5.0-sun-devel.i586 0:1.5.0.06-1jpp
Complete!

**** Note that yum says 'Dependency Removed: xx Complete!
**** However, it did not remove the package.
**** Doing it again, gives same answer.

[root@hoho2 Desktop]# yum erase java-1.5.0-sun-1.5.0.06-1jpp
Loading "installonlyn" plugin
Setting up Remove Process
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package java-1.5.0-sun.i586 0:1.5.0.06-1jpp set to be erased
--> Running transaction check
Setting up repositories
core                      100% |=========================| 1.1 kB    00:00     
updates                   100% |=========================| 1.2 kB    00:00     
extras                    100% |=========================| 1.1 kB    00:00     
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 193 kB    00:01     
################################################## 591/591
--> Processing Dependency: java-1.5.0-sun = 0:1.5.0.06-1jpp for package:
java-1.5.0-sun-devel
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package java-1.5.0-sun-devel.i586 0:1.5.0.06-1jpp set to be erased
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Removing:
 java-1.5.0-sun          i586       1.5.0.06-1jpp    installed          84 M
Removing for dependencies:
 java-1.5.0-sun-devel    i586       1.5.0.06-1jpp    installed          12 M

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

Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Removing  : java-1.5.0-sun-devel         ######################### [1/2]
/usr/lib/jvm/java-1.5.0-sun/bin/javac has not been configured as an alternative
for javac
error: %postun(java-1.5.0-sun-devel-1.5.0.06-1jpp.i586) scriptlet failed, exit
status 2
  Removing  : java-1.5.0-sun               ######################### [2/2]
/usr/lib/jvm/jre-1.5.0-sun/bin/java has not been configured as an alternative
for java
error: %postun(java-1.5.0-sun-1.5.0.06-1jpp.i586) scriptlet failed, exit status 2

Removed: java-1.5.0-sun.i586 0:1.5.0.06-1jpp
Dependency Removed: java-1.5.0-sun-devel.i586 0:1.5.0.06-1jpp
Complete!
[root@hoho2 Desktop]# 

Expected results:

  It probably should say something like:

'Error occurred. Command may not have completed as you wish'
'See diagnostic output above'

Additional info:
Comment 1 Bob Gustafson 2006-11-18 13:03:58 EST
Although not a fix for the Complete! message,
the fix for the troublesome erase is:

[root@hoho2 jboss]# rpm -e --nopostun java-1.5.0-sun-devel-1.5.0.06-1jpp.i586
[root@hoho2 jboss]# rpm -e --nopostun java-1.5.0-sun-1.5.0.06-1jpp.i586

As a test:

[root@hoho2 jboss]# yum erase java-1.5.0-sun-1.5.0.06-1jpp
Loading "installonlyn" plugin
Setting up Remove Process
No Match for argument: java-1.5.0-sun-1.5.0.06-1jpp
No Packages marked for removal
[root@hoho2 jboss]# 

Comment 2 Seth Vidal 2006-11-19 10:33:24 EST
unfortunately scriptlet errors do not cause the transaction to return an error.
Therefore, there is no way for yum to know anything untoward happened w/o going
back and checking each package.

If we can get scriptlet errors to result in a transaction error, or some kind of
warning then we could act on it.

but that's an rpm thing.
Comment 3 Bob Gustafson 2006-11-19 14:20:35 EST
There does seem to be a need for closer coordination between rpm contributors
and yum contributors.

Is there an easy way to re-file this bug against rpm?
Comment 4 Bob Gustafson 2006-11-19 14:24:39 EST
What is printing out

error: %postun(java-1.5.0-sun-1.5.0.06-1jpp.i586) scriptlet failed, exit status 2

Is this coming directly from the scriptlet? From rpm?

If yum is a wrapper around rpm, it seems like this error status could be
captured in yum..
Comment 5 Seth Vidal 2006-11-19 14:43:53 EST
yum isn't a wrapper around rpm. Yum uses the rpm python libraries. That's
specifically NOT a wrapper.

I'll be happy to reassign this to rpm, but I assure you, they know about it.
Comment 6 Bob Gustafson 2006-11-19 15:01:08 EST
Since yum does not know whether its minions are acting successfully, it should
not print out the end messages:

Removed: java-1.5.0-sun.i586 0:1.5.0.06-1jpp
Dependency Removed: java-1.5.0-sun-devel.i586 0:1.5.0.06-1jpp
Complete!

!!!
Comment 7 Seth Vidal 2006-11-20 00:46:47 EST
yum gets some error messages from the transaction. It just doesn't get scriptlet
errors. So it reads the error codes it does get back. They say all clear, hence
yum's response.

Comment 8 Panu Matilainen 2007-08-09 16:40:10 EDT
*** Bug 228771 has been marked as a duplicate of this bug. ***
Comment 9 Red Hat Bugzilla 2007-08-21 01:29:44 EDT
User pnasrat@redhat.com's account has been closed
Comment 10 Panu Matilainen 2007-08-22 02:32:17 EDT
Reassigning to owner after bugzilla made a mess, sorry about the noise...
Comment 11 Matthew Miller 2008-02-20 22:51:48 EST
This isn't just a cosmetic problem, as it can cause users relying on reports and
log files to think that security updates have been applied when they haven't.
Comment 12 Matthew Miller 2008-02-20 23:00:32 EST
Moving from fc6 to devel -- this problem just struck with xulrunner in rawhide.
And that demonstrates that it's not just post-script failure issues, but can be
internal RPM errors as well. The specific directory/symlink bug needs fixin',
but really, I'm more concerned about the erroneous reporting overall.

Also, I suggest also changing bug summary to something like:

rpm python layer doesn't give enough information about failure to be useful

Um, anyone got something more succinct?
Comment 13 Panu Matilainen 2008-04-01 07:40:20 EDT
The xulrunner case was very different actually: it wasn't a scriptlet error but
a cpio error due to replacing directory with a symlink (or the other way around).
The python layer gets notified of CPIO/UNPACK errors but it's not like it (or
rpm itself) can do anything about it, the rpm transaction is not unlike a
trainwreck in progress - it doesn't stop until it stops no matter what gets
crushed in the process ;)

That said, the scriptlet failure issue is going to get addressed in couple of ways:
1) let non-pre scriptlets fail without leaving old junk behind
2) add better means of reporting the failures to user

1) might even make it to F9, 2) will have to wait for next major rpm version
Comment 14 Bug Zapper 2008-05-13 22:28:58 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 15 Panu Matilainen 2008-10-04 04:46:06 EDT
Ok, here's what rpm does now (upstream, not in rawhide just yet):
- %pre and %preun scriptlets exiting with non-zero code cause install/erase to fail just like before. This behavior needs to be preserved as various packages use that to prevent install/uninstall on some conditions.
- non-zero exit code from other scriptlets is treated as a warning only (ie %postun failing will log a warning but the package will get removed anyway)
- scriptlets dying on signals and other "abnormal" ways are still treated as errors
- for all scriptlet errors, RPMCALLBACK_SCRIPT_ERROR notification is issued to the callback, with the tag of the failing script passed in the "amount" parameter and "total" parameter containing RPMRC_OK / RPMRC_FAIL to signal whether rpm treated it as a warning or error
Comment 16 Panu Matilainen 2008-10-16 13:09:25 EDT
In rawhide now.

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