RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1710691 - Package gets removed on failed update via dnf
Summary: Package gets removed on failed update via dnf
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact: Luca Berton
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-16 05:43 UTC by Panu Matilainen
Modified: 2020-05-30 01:45 UTC (History)
2 users (show)

Fixed In Version: rpm-4.11.3-43.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-31 20:01:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1114 0 None None None 2020-03-31 20:02:04 UTC

Description Panu Matilainen 2019-05-16 05:43:12 UTC
This bug was initially created as a copy of Bug #1710346

I am copying this bug because: 

AIUI yum doesn't exhibit this problem, but the bug exists in rpm 4.11 nevertheless and the dnf tech-preview (or something like that) in RHEL-7 extras is expected to be affected. Because dnf is not the default in RHEL-7, the priority is lower than in RHEL-8.

Description of problem:

When updating packages with dnf, if install of the newer package fails the package gets entirely removed as the cleanup stage runs despite the failure.

Version-Release number of selected component (if applicable):
All versions of rpm up to 4.14.2

How reproducible:
Always

Steps to Reproduce:
1. mount an iso image on /mnt
2. update/downgrade filesystem package

Actual results:
filesystem package gets removed completely

Expected results:
filesystem package stays in the original version

Additional info:
Here's a replay of it on Fedora, but equally applicable to RHEL and should be reproducable with just %pre scriptlet failure as well.

[root@sopuli ~]# rpm -q filesystem
filesystem-3.9-2.fc29.x86_64
[root@sopuli ~]# mount -o loop ~pmatilai/iso/Fedora-Server-dvd-x86_64-28-1.1.iso /mnt/
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@sopuli ~]# dnf -y -q update filesystem-3.10-1.fc30.x86_64.rpm 
Error unpacking rpm package filesystem-3.10-1.fc30.x86_64
Error: Transaction failed
[root@sopuli ~]# rpm -q filesystem
package filesystem is not installed
[root@sopuli ~]#

The reason for this is somewhat unexpected (but legitimate) API use by dnf, so it cannot be reproduced by rpm itself. The bug is certainly in rpm though.

Comment 8 errata-xmlrpc 2020-03-31 20:01:53 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.

https://access.redhat.com/errata/RHBA-2020:1114

Comment 9 Fedora Update System 2020-05-30 01:45:17 UTC
FEDORA-EPEL-2020-3ef1e07e82 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.


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