Bug 1325394 - lvm2 and device-mapper package file conflict issues
Summary: lvm2 and device-mapper package file conflict issues
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Rajnoha
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
: 1294128 1342441 (view as bug list)
Depends On: 1332990
Blocks: 1313485 1295577
TreeView+ depends on / blocked
 
Reported: 2016-04-08 17:10 UTC by Vivek Goyal
Modified: 2019-11-14 07:45 UTC (History)
12 users (show)

Fixed In Version: lvm2-2.02.152-2.el7
Doc Type: Bug Fix
Doc Text:
There was an incorrectly defined dependency between lvm2-libs and device-mapper-event LVM2 subpackages prior to lvm2 version 2.02.111. When updating only device-mapper subpackages, without updating lvm2 package, we may have ended up with file conflicts if files were moved around subpackages. These dependencies are fixed since LVM2 version 2.02.111. To avoid problems when updating from older versions, there's direct conflict defined explicitly in the packages now which, if hit, will give an information about the minimum required version to resolve this conflict.
Clone Of:
Environment:
Last Closed: 2016-11-04 04:20:02 UTC
Target Upstream Version:


Attachments (Terms of Use)
logs for the issue (102.78 KB, text/plain)
2016-04-08 17:11 UTC, Vivek Goyal
no flags Details
result (15.42 KB, text/plain)
2016-09-21 12:04 UTC, Roman Bednář
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1445 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2016-11-03 13:46:41 UTC

Description Vivek Goyal 2016-04-08 17:10:11 UTC
Description of problem:

Looks like some files were moved from lvm2 package to device-mapper package
and later when device-mapper package is upgraded (without upgrading lvm2 package), error happens.


Transaction check error:
  file /usr/lib/systemd/system/blk-availability.service from install of device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64
  file /usr/sbin/blkdeactivate from install of device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64
  file /usr/share/man/man8/blkdeactivate.8.gz from install of device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Vivek Goyal 2016-04-08 17:11:29 UTC
Created attachment 1145193 [details]
logs for the issue

Comment 2 Vivek Goyal 2016-04-08 17:12:40 UTC
Looks like docker pulled in newer device-mapper package. But there is no dependency on newer lvm2, so lvm2 remained the same. And newer device-mapper package had conflicts with older lvm2 package.

Comment 4 Alasdair Kergon 2016-04-08 18:11:30 UTC
Try a Conflicts tag to stop whichever subpackage now has the files from being present alongside the one(s) that used to have them.

Comment 5 Peter Rajnoha 2016-04-11 11:08:40 UTC
There's direct dependency on concrete version of device-mapper in lvm2 (so "lvm2 Requires device-mapper = version", *not* "lvm2 Requires device-mapper >= version"). When upgrading device-mapper, the higher version will also cause new version of lvm2 to be brought in. Otherwise, it would mean the yum/rpm is breaking dependency, which it should not!

This is what I got (and what is also expected) when I update from 7.1.z to 7.2 (you used 7.2.z version, but that doesn't matter here as 7.2.z has just 2 extra patched when compared to 7.2, no changes in dependencies):

[root@localhost ~]# rpm -q device-mapper
device-mapper-1.02.93-3.el7_1.2.x86_64

[root@localhost ~]# rpm -q lvm2
lvm2-2.02.115-3.el7_1.2.x86_64

[root@localhost ~]# rpm -qf /usr/sbin/blkdeactivate
lvm2-2.02.115-3.el7_1.2.x86_64

[root@localhost ~]# yum update device-mapper

...

Resolving Dependencies
--> Running transaction check
---> Package device-mapper.x86_64 7:1.02.93-3.el7_1.2 will be updated
--> Processing Dependency: device-mapper = 7:1.02.93-3.el7_1.2 for package: 7:device-mapper-event-1.02.93-3.el7_1.2.x86_64
--> Processing Dependency: device-mapper = 7:1.02.93-3.el7_1.2 for package: 7:device-mapper-libs-1.02.93-3.el7_1.2.x86_64
---> Package device-mapper.x86_64 7:1.02.107-5.el7 will be an update
--> Running transaction check
---> Package device-mapper-event.x86_64 7:1.02.93-3.el7_1.2 will be updated
--> Processing Dependency: device-mapper-event = 7:1.02.93-3.el7_1.2 for package: 7:lvm2-libs-2.02.115-3.el7_1.2.x86_64
---> Package device-mapper-event.x86_64 7:1.02.107-5.el7 will be an update
--> Processing Dependency: device-mapper-event-libs = 7:1.02.107-5.el7 for package: 7:device-mapper-event-1.02.107-5.el7.x86_64
---> Package device-mapper-libs.x86_64 7:1.02.93-3.el7_1.2 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.107-5.el7 will be an update
--> Running transaction check
---> Package device-mapper-event-libs.x86_64 7:1.02.93-3.el7_1.2 will be updated
---> Package device-mapper-event-libs.x86_64 7:1.02.107-5.el7 will be an update
---> Package lvm2-libs.x86_64 7:2.02.115-3.el7_1.2 will be updated
--> Processing Dependency: lvm2-libs = 7:2.02.115-3.el7_1.2 for package: 7:lvm2-2.02.115-3.el7_1.2.x86_64
---> Package lvm2-libs.x86_64 7:2.02.130-5.el7 will be an update
--> Running transaction check
---> Package lvm2.x86_64 7:2.02.115-3.el7_1.2 will be updated
---> Package lvm2.x86_64 7:2.02.130-5.el7 will be an update
--> Processing Dependency: device-mapper-persistent-data >= 0.5.5-1 for package: 7:lvm2-2.02.130-5.el7.x86_64
--> Running transaction check
---> Package device-mapper-persistent-data.x86_64 0:0.4.1-2.el7 will be updated
---> Package device-mapper-persistent-data.x86_64 0:0.5.5-1.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================
 Package                                Arch            Version                     Repository             Size
================================================================================================================
Updating:
 device-mapper                          x86_64          7:1.02.107-5.el7            rhel7-client          251 k
Updating for dependencies:
 device-mapper-event                    x86_64          7:1.02.107-5.el7            rhel7-client          167 k
 device-mapper-event-libs               x86_64          7:1.02.107-5.el7            rhel7-client          169 k
 device-mapper-libs                     x86_64          7:1.02.107-5.el7            rhel7-client          304 k
 device-mapper-persistent-data          x86_64          0.5.5-1.el7                 rhel7-client          350 k
 lvm2                                   x86_64          7:2.02.130-5.el7            rhel7-client          1.0 M
 lvm2-libs                              x86_64          7:2.02.130-5.el7            rhel7-client          872 k

Transaction Summary
================================================================================================================
Upgrade  1 Package (+6 Dependent packages)

Total download size: 3.0 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for rhel7-client
(1/7): device-mapper-event-1.02.107-5.el7.x86_64.rpm                                     | 167 kB  00:00:01     
(2/7): device-mapper-1.02.107-5.el7.x86_64.rpm                                           | 251 kB  00:00:01     
(3/7): device-mapper-event-libs-1.02.107-5.el7.x86_64.rpm                                | 169 kB  00:00:00     
(4/7): device-mapper-libs-1.02.107-5.el7.x86_64.rpm                                      | 304 kB  00:00:01     
(5/7): device-mapper-persistent-data-0.5.5-1.el7.x86_64.rpm                              | 350 kB  00:00:01     
(6/7): lvm2-2.02.130-5.el7.x86_64.rpm                                                    | 1.0 MB  00:00:01     
(7/7): lvm2-libs-2.02.130-5.el7.x86_64.rpm                                               | 872 kB  00:00:01     
----------------------------------------------------------------------------------------------------------------
Total                                                                           633 kB/s | 3.0 MB  00:00:04     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
fcoe-utils-1.0.29-9.el7.x86_64 has missing requires of device-mapper-multipath
python-blivet-0.61.0.26-1.el7.noarch has missing requires of device-mapper-multipath
  Updating   : 7:device-mapper-libs-1.02.107-5.el7.x86_64                                                  1/14 
  Updating   : 7:device-mapper-1.02.107-5.el7.x86_64                                                       2/14 
  Updating   : 7:device-mapper-event-libs-1.02.107-5.el7.x86_64                                            3/14 
  Updating   : 7:device-mapper-event-1.02.107-5.el7.x86_64                                                 4/14 
  Updating   : 7:lvm2-libs-2.02.130-5.el7.x86_64                                                           5/14 
  Updating   : device-mapper-persistent-data-0.5.5-1.el7.x86_64                                            6/14 
  Updating   : 7:lvm2-2.02.130-5.el7.x86_64                                                                7/14 
ln -s '/usr/lib/systemd/system/lvm2-lvmpolld.socket' '/etc/systemd/system/sysinit.target.wants/lvm2-lvmpolld.socket'
  Cleanup    : 7:lvm2-2.02.115-3.el7_1.2.x86_64                                                            8/14 
  Cleanup    : 7:lvm2-libs-2.02.115-3.el7_1.2.x86_64                                                       9/14 
  Cleanup    : 7:device-mapper-event-1.02.93-3.el7_1.2.x86_64                                             10/14 
  Cleanup    : 7:device-mapper-event-libs-1.02.93-3.el7_1.2.x86_64                                        11/14 
  Cleanup    : 7:device-mapper-1.02.93-3.el7_1.2.x86_64                                                   12/14 
  Cleanup    : 7:device-mapper-libs-1.02.93-3.el7_1.2.x86_64                                              13/14 
  Cleanup    : device-mapper-persistent-data-0.4.1-2.el7.x86_64                                           14/14 
  Verifying  : 7:lvm2-2.02.130-5.el7.x86_64                                                                1/14 
  Verifying  : 7:lvm2-libs-2.02.130-5.el7.x86_64                                                           2/14 
  Verifying  : 7:device-mapper-event-1.02.107-5.el7.x86_64                                                 3/14 
  Verifying  : device-mapper-persistent-data-0.5.5-1.el7.x86_64                                            4/14 
  Verifying  : 7:device-mapper-event-libs-1.02.107-5.el7.x86_64                                            5/14 
  Verifying  : 7:device-mapper-1.02.107-5.el7.x86_64                                                       6/14 
  Verifying  : 7:device-mapper-libs-1.02.107-5.el7.x86_64                                                  7/14 
  Verifying  : 7:lvm2-2.02.115-3.el7_1.2.x86_64                                                            8/14 
  Verifying  : 7:device-mapper-event-libs-1.02.93-3.el7_1.2.x86_64                                         9/14 
  Verifying  : 7:device-mapper-libs-1.02.93-3.el7_1.2.x86_64                                              10/14 
  Verifying  : 7:lvm2-libs-2.02.115-3.el7_1.2.x86_64                                                      11/14 
  Verifying  : device-mapper-persistent-data-0.4.1-2.el7.x86_64                                           12/14 
  Verifying  : 7:device-mapper-event-1.02.93-3.el7_1.2.x86_64                                             13/14 
  Verifying  : 7:device-mapper-1.02.93-3.el7_1.2.x86_64                                                   14/14 

Updated:
  device-mapper.x86_64 7:1.02.107-5.el7                                                                         

Dependency Updated:
  device-mapper-event.x86_64 7:1.02.107-5.el7         device-mapper-event-libs.x86_64 7:1.02.107-5.el7          
  device-mapper-libs.x86_64 7:1.02.107-5.el7          device-mapper-persistent-data.x86_64 0:0.5.5-1.el7        
  lvm2.x86_64 7:2.02.130-5.el7                        lvm2-libs.x86_64 7:2.02.130-5.el7                         

Complete!


===

So lvm2 got updated due to the dependency on exact version of device-mapper. What's the exact command you used for the update?

Comment 6 Peter Rajnoha 2016-04-11 11:58:00 UTC
What's your yum configuration?

Comment 7 Vivek Goyal 2016-04-11 12:20:16 UTC
scott, Will be able to provide information asked by Peter.

Comment 8 Vivek Goyal 2016-04-11 12:23:41 UTC
Peter,

I think they are upgrading from 7.0. And I think when they upgrade from 7.1, issue is not there.

Comment 9 Scott Dodson 2016-04-11 13:05:56 UTC
Peter,

Steps to reproduce should just be 

1) Install RHEL 7.0
2) Subscribe to base and extras channel
3) yum install docker

I'm coming by this second hand and I don't have the time to setup an environment to reproduce this but I believe those steps should be sufficient to reproduce it. I've added Dafna to CC on this bug, they brought this to my attention because they were trying to install OpenShift 3 and were running into problems.

Comment 10 Scott Dodson 2016-04-11 13:06:42 UTC
Oh nevermind, looks like Vivek already attached the log I was going to attach. Please see the attachments.

Comment 11 Peter Rajnoha 2016-04-11 13:09:19 UTC
(In reply to Vivek Goyal from comment #0)
> Transaction check error:
>   file /usr/lib/systemd/system/blk-availability.service from install of
> device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package
> lvm2-7:2.02.105-14.el7.x86_64
>   file /usr/sbin/blkdeactivate from install of
> device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package
> lvm2-7:2.02.105-14.el7.x86_64
>   file /usr/share/man/man8/blkdeactivate.8.gz from install of
> device-mapper-7:1.02.107-5.el7_2.1.x86_64 conflicts with file from package
> lvm2-7:2.02.105-14.el7.x86_64
> 

Sorry, I've misread the version from which the update is done - I somehow assumed 7.1.z. But this is even 7.0 which used ">=", it was 7.1 only when this was fixed. So yes, we need the conflicts unfortunately in all the 7.2+ versions... Pity.

Comment 13 Peter Rajnoha 2016-05-04 13:39:47 UTC
I've added the Conflicts: lvm2 < 2.02.111 (the version from which dependencies are correct between lvm2-libs and device-mapper-event). However, when testing, I've hit an issue with rpm failing to detect the conflict - I've reported that as bug #1332990 - so this one needs to be resolved first.

This new conflict is included in lvm2-2.02.152-1.el7.

The connection between lvm2 and device-mapper dependency is exactly the "lvm2-libs --> device-mapper-event" dependency, that's why I'm mentioning device-mapper-event here... The full dependency chain is lvm2 --> lvm2_libs --> device-mapper-event--> device-mapper --> device-mapper-libs.

Comment 14 Peter Rajnoha 2016-05-04 14:01:46 UTC
OK, it was just missing epoch number...

To QA: to test this, install older version of lvm2/device-mapper with lvm2-libs < 2.02.111 (e.g. lvm2-2.02.105-14.el7 from 7.0: https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=346119) and then try to update ONLY device-mapper (and device-mapper-libs, device-mapper-event, device-mapper-event-libs as they're deps).

You should get:

# rpm -F device-mapper-1.02.124-1.el7.x86_64.rpm device-mapper-libs-1.02.124-1.el7.x86_64.rpm device-mapper-event-1.02.124-1.el7.x86_64.rpm device-mapper-event-libs-1.02.124-1.el7.x86_64.rpm 
error: Failed dependencies:
	lvm2-libs < 7:2.02.111 conflicts with device-mapper-event-7:1.02.124-1.el7.x86_64

When trying to update to older version, you get (e.g. updating device-mapper package from 7.0 version to version from 7.2):

Transaction check error:
  file /usr/lib/systemd/system/blk-availability.service from install of device-mapper-7:1.02.107-5.el7.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64
  file /usr/sbin/blkdeactivate from install of device-mapper-7:1.02.107-5.el7.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64
  file /usr/share/man/man8/blkdeactivate.8.gz from install of device-mapper-7:1.02.107-5.el7.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64

Comment 15 Peter Rajnoha 2016-05-04 14:04:22 UTC
(...updating from newer versions of lvm2-libs >= 2.02.111 should be OK as they already have a requirement for concrete version of device-mapper-event package)

Comment 17 Peter Rajnoha 2016-06-02 12:58:21 UTC
*** Bug 1294128 has been marked as a duplicate of this bug. ***

Comment 18 Peter Rajnoha 2016-06-03 10:01:04 UTC
*** Bug 1342441 has been marked as a duplicate of this bug. ***

Comment 19 Roman Bednář 2016-09-21 12:04:35 UTC
Verified. Conflict not present with lvm2-libs >= 2.02.111

Details in attachment.

Comment 20 Roman Bednář 2016-09-21 12:04:48 UTC
Created attachment 1203247 [details]
result

Comment 22 errata-xmlrpc 2016-11-04 04:20:02 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://rhn.redhat.com/errata/RHBA-2016-1445.html


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