Bug 216221 - Says it deleted Dependency, but with scriptlet exit status 2, it really did not
Summary: Says it deleted Dependency, but with scriptlet exit status 2, it really did not
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact:
URL:
Whiteboard:
: yum-pre-error (view as bug list)
Depends On:
Blocks: 533831
TreeView+ depends on / blocked
 
Reported: 2006-11-17 21:24 UTC by Bob Gustafson
Modified: 2016-12-07 15:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 533831 (view as bug list)
Environment:
Last Closed: 2008-10-16 17:09:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1394770 0 high CLOSED [RFE] yum does not fail if mkinitrd creation fails 2021-06-10 11:40:01 UTC

Internal Links: 1394770

Description Bob Gustafson 2006-11-17 21:24:30 UTC
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 18:03:58 UTC
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 15:33:24 UTC
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 19:20:35 UTC
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 19:24:39 UTC
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 19:43:53 UTC
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 20:01:08 UTC
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 05:46:47 UTC
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 20:40:10 UTC
*** Bug 228771 has been marked as a duplicate of this bug. ***

Comment 9 Red Hat Bugzilla 2007-08-21 05:29:44 UTC
User pnasrat's account has been closed

Comment 10 Panu Matilainen 2007-08-22 06:32:17 UTC
Reassigning to owner after bugzilla made a mess, sorry about the noise...

Comment 11 Matthew Miller 2008-02-21 03:51:48 UTC
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-21 04:00:32 UTC
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 11:40:20 UTC
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-14 02:28:58 UTC
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 08:46:06 UTC
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 17:09:25 UTC
In rawhide now.


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