Bug 120519 - rpm -e commits changes even on error
rpm -e commits changes even on error
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks: FC3Target
  Show dependency treegraph
 
Reported: 2004-04-09 15:30 EDT by alvin thompson
Modified: 2007-11-30 17:10 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-04 21:37:11 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 alvin thompson 2004-04-09 15:30:50 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040312 Epiphany/1.1.12

Description of problem:
if multiple versions of a package are installed, rpm -e behavior is
very bad if ambiguities exist:


[root@t2 root]# rpm -q kernel
kernel-2.6.4-1.300
kernel-2.6.3-2.1.253.2.1
kernel-2.6.4-1.303
kernel-2.6.4-1.305
kernel-2.6.5-1.308
kernel-2.6.5-1.309
[root@t2 root]# rpm -e kernel-2.6.4
error: "kernel-2.6.4" specifies multiple packages
[root@t2 root]# rpm -q kernel
kernel-2.6.3-2.1.253.2.1
kernel-2.6.4-1.303
kernel-2.6.4-1.305
kernel-2.6.5-1.308
kernel-2.6.5-1.309

note that one of the packages was removed, anyway. rpm should not
commit changes when an error is presented and never when the results
would be arbitrary, as in this case.


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

How reproducible:
Always

Steps to Reproduce:
1. see above
2.
3.
    

Additional info:
Comment 1 Jeff Johnson 2004-04-09 18:35:52 EDT
A failure of "rpm -e" when multiple packages installed fails
immediately w/o attempting any operation.

There's no way that the "rpm -e" did anything.
Comment 2 alvin thompson 2004-04-11 15:09:39 EDT
just saying "There's no way that the "rpm -e" did anything" does not
make it true. certainly, what you described is the way it *should*
work, but it's not working that way. that's why this bug is open. look
more closely at the printout; it is verbatim. this bug has been
experimentally verified not only by me, but by others on the #fedora
IRC channel. i've been using redhat linux since '96; please don't just
assume it's operator error.

there is another bug (i forget the number) where if multiple versions
of the same package are installed, 'rpm -e' removes common files. the
bug may be related in some way.
Comment 3 Jeff Johnson 2004-04-11 22:11:58 EDT
You list the display output, not whether the pkg is actually installed.

You also do not identify whether other processes are running.

Do you have a rproducer? Hearsay claims from an irc channel cannot
be reproduced ...
Comment 4 alvin thompson 2004-04-12 12:49:40 EDT
once again, read the output. you'll notice that the first command is
'rpm -q kernel'. the 'rpm -q kernel' command lists the currently
installed kernel packages. if you look at the version numbers, you
will notice that they follow the upgrade path of up2date, so perhaps
the problem lies there. it is reasonable to assume that i've booted
from each kernel at least once (i have).

as you should know, if there were other processes running that
required a lock on the rpm database, the 'rpm -e' process would have
blocked until the lock was available. as i'm sure you also know, this
was a problem with the last few redhat/fedora distros as the lock
would sometimes not get released and it required the user to manually
'kill -9' the rpm process and rebuild the database. this did *not*
happen in this case; there have been no problems with anything
regarding package management on this computer. in fact, this machine
is for the most part a clean installation w/ updates.

if you really think it's relevant, i booted, logged into gnome, opened
a terminal, became root (su -) and ran the command. gaim was also
running. all internet server services are disabled on this box. any
processes running were assosiated with this described state.

sorry, the others that comfirmed the bug are not on the IRC channel
right now. however, it can hardly be called heresay as i--the
submitter of this bug--had this problem and can still reproduce it.

i reproduced the problem with a different kernel version. note the
strange behavior when i run the command a second time. something is
certainly not right here:

[root@t2 up2date]# rpm -q kernel
kernel-2.6.3-2.1.253.2.1
kernel-2.6.5-1.309
kernel-2.6.5-1.315
[root@t2 up2date]# rpm -q kernel-2.6.5
kernel-2.6.5-1.309
kernel-2.6.5-1.315
[root@t2 up2date]# rpm -e kernel-2.6.5
error: "kernel-2.6.5" specifies multiple packages
[root@t2 up2date]# rpm -q kernel-2.6.5
kernel-2.6.5-1.315
[root@t2 up2date]# rpm -e kernel-2.6.5
error: Failed dependencies:
        kernel >= 2.6.4-1.300 is needed by (installed) policy-1.10.2-5
        kernel >= 2.6.4-1.300 is needed by (installed)
policy-sources-1.10.2-5

after the (first) 'error' line is given, there is a long pause where
the command is still working on something. that is what originally
made me suspicious.

i strongly suggest you find and fix this bug, as it could lead to
major problems if people accidentally remove all versions of a package
on a system, especially the kernel. it may not look good if this bug
were submitted but ignored because someone didn't think is was real...
Comment 5 Aleksey Nogin 2004-04-14 05:09:49 EDT
I tried reproducing it - and indeed, I see it too.

# rpm -q rpm
rpm-4.3.1-0.2
# rpm -q kernel
kernel-2.6.5-1.315
kernel-2.6.5-1.319
# rpm -e kernel-2.6.5
ошибка: "kernel-2.6.5" задает несколько пакетов
rpm -q kernel
# rpm -q kernel
kernel-2.6.5-1.319
#
Comment 6 Warren Togami 2004-05-06 18:04:44 EDT
[root@ibmlaptop tmp]# rpm -q kernel-source
kernel-source-2.6.5-1.319
kernel-source-2.6.5-1.322
kernel-source-2.6.5-1.326
kernel-source-2.6.5-1.327
kernel-source-2.6.5-1.349
[root@ibmlaptop tmp]# rpm -e kernel-source
error: "kernel-source" specifies multiple packages

At this point it gets stuck for 2-3 minutes with 100% CPU and disk
clicking like crazy.  Then...

[root@ibmlaptop tmp]# rpm -q kernel-source
kernel-source-2.6.5-1.322
kernel-source-2.6.5-1.326
kernel-source-2.6.5-1.327
kernel-source-2.6.5-1.349
Comment 7 Warren Togami 2004-05-18 03:26:30 EDT
rpm did not exhibit this behavior in RH9.  (Just more info.)
Comment 8 Jeff Johnson 2004-10-04 21:37:11 EDT
This has been fixed for a couple months at least:

[root@wellfleet ~]# rpm -q kernel
kernel-2.6.8-1.533
kernel-2.6.8-1.541
kernel-2.6.8-1.538
kernel-2.6.8-1.590
# rpm -e kernel-2.6.8
error: "kernel-2.6.8" specifies multiple packages
# rpm -q kernel
kernel-2.6.8-1.533
kernel-2.6.8-1.541
kernel-2.6.8-1.538
kernel-2.6.8-1.590
# rpm -q rpm
rpm-4.3.2-8

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