Bug 1075671

Summary: Disk information not completely restored when actions are canceled
Product: Red Hat Enterprise Linux 7 Reporter: Bruno Goncalves <bgoncalv>
Component: python-blivetAssignee: David Lehman <dlehman>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: amulhern, bugproxy, hannsj_uhl, jstodola, lmacken, lsoft-tool-inc, mbanas, mflitter, pchavan, sgaikwad, yanwang
Target Milestone: rcKeywords: Reopened, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:6855424faae8561a871ffae9ac59c76322f87e9467bca5fe0e0e76efa71ebc7c
Fixed In Version: python-blivet-0.61.0.5-1 Doc Type: Known Issue
Doc Text:
If the system is installed from a removable medium, and an install or storage option is selected but then changed, the installation fails. Consequently, it is not possible to reconsider decisions made during the installation process. To work around this problem, avoid accepting and then changing storage decisions if using removable install media.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 14:06:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 782468, 807834, 829185, 1028479, 1064025, 1085201, 1113519    
Attachments:
Description Flags
File: anaconda-tb
none
File: anaconda.log
none
File: environ
none
File: ks.cfg
none
File: lsblk_output
none
File: nmcli_dev_list
none
File: os_info
none
File: program.log
none
File: storage.log
none
File: syslog
none
File: ifcfg.log
none
File: packaging.log
none
Screenshot of stack trace showing same error, albeit different trace
none
Patch that failed
none
anaconda.log snap 9
none
anaconda traceback (/tmp/anaconda-tb-*) snap 9
none
Shown space at first enter
none
Shown space when reenter installation destination
none
anaconda.log snap 10
none
anaconda traceback (/tmp/anaconda-tb-*) snap 10 none

Description Bruno Goncalves 2014-03-12 14:52:41 UTC
Description of problem:
The problem happened when trying to configure an iSCSI boot to boot from a server using tgtd as iSCSI target.

Version-Release number of selected component:
anaconda-19.31.67-1

The following was filed automatically by anaconda:
anaconda 19.31.67-1 exception report
Traceback (most recent call first):
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 2324, in _removeLogVol
    raise ValueError("specified lv is not part of this vg")
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 326, in _removeDevice
    dev.vg._removeLogVol(dev)
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 389, in cancelAction
    self._removeDevice(action.device)
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 1857, in hide
    self.cancelAction(action)
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 1850, in hide
    self.hide(d)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/gui/spokes/storage.py", line 794, in on_back_clicked
    self.storage.devicetree.hide(disk)
ValueError: specified lv is not part of this vg

Additional info:
cmdline:        /usr/bin/python  /sbin/anaconda
cmdline_file:   initrd=/images/storageqe-81.lab.eng.brq.redhat.com/initrd console=ttyS1,115200 inst.nompath ks=http://beaker.engineering.redhat.com/kickstart/666289 ksdevice=A0:B3:CC:EA:F8:0E serial vnc netboot_method=pxe BOOT_IMAGE=/images/storageqe-81.lab.eng.brq.redhat.com/kernel BOOTIF=01-a0-b3-cc-ea-f8-0e 
executable:     /sbin/anaconda
hashmarkername: anaconda
kernel:         3.10.0-108.el7.x86_64
product:        Red Hat Enterprise Linux
release:        Red Hat Enterprise Linux Workstation release 7.0 Beta (Maipo)
release_type:   pre-release
type:           anaconda
version:        7.0

Comment 1 Bruno Goncalves 2014-03-12 14:53:00 UTC
Created attachment 873620 [details]
File: anaconda-tb

Comment 2 Bruno Goncalves 2014-03-12 14:53:09 UTC
Created attachment 873621 [details]
File: anaconda.log

Comment 3 Bruno Goncalves 2014-03-12 14:53:11 UTC
Created attachment 873622 [details]
File: environ

Comment 4 Bruno Goncalves 2014-03-12 14:53:16 UTC
Created attachment 873623 [details]
File: ks.cfg

Comment 5 Bruno Goncalves 2014-03-12 14:53:19 UTC
Created attachment 873624 [details]
File: lsblk_output

Comment 6 Bruno Goncalves 2014-03-12 14:53:23 UTC
Created attachment 873625 [details]
File: nmcli_dev_list

Comment 7 Bruno Goncalves 2014-03-12 14:53:29 UTC
Created attachment 873626 [details]
File: os_info

Comment 8 Bruno Goncalves 2014-03-12 14:53:40 UTC
Created attachment 873627 [details]
File: program.log

Comment 9 Bruno Goncalves 2014-03-12 14:53:46 UTC
Created attachment 873628 [details]
File: storage.log

Comment 10 Bruno Goncalves 2014-03-12 14:53:52 UTC
Created attachment 873629 [details]
File: syslog

Comment 11 Bruno Goncalves 2014-03-12 14:54:02 UTC
Created attachment 873630 [details]
File: ifcfg.log

Comment 12 Bruno Goncalves 2014-03-12 14:54:09 UTC
Created attachment 873631 [details]
File: packaging.log

Comment 14 David Shea 2014-03-12 19:09:11 UTC
*** Bug 1075541 has been marked as a duplicate of this bug. ***

Comment 15 mulhern 2014-03-17 15:58:00 UTC
Stack trace is identical and it looks like it originates from same cause.

*** This bug has been marked as a duplicate of bug 1074094 ***

Comment 16 mulhern 2014-03-17 16:43:46 UTC
*** Bug 1074094 has been marked as a duplicate of this bug. ***

Comment 17 mulhern 2014-03-17 19:27:34 UTC
OK.

I've found a way to make it happen a little bit more directly.

Boot with existing LVM install on two disks, and a third empty disk.

1. Go to Installation Destination, select all disks, and "I will configure partitioning", press Done
2) In Manual Partitioning, remove swap partition in RHEL7 install, using - (do not delete everything on RHEL7 install) and press Done. This nets you a 'Destroy Device' action for the lvmlv /swap.
3) Go back to Installation Destination, unselect second disk, choose "I will configure partitioning" and press Done. In my case, swap partition reappeared, that is not wrong.
4) In Manual Partitioning, press Done and Accept Changes. There will not be a Device Destroy action this time.
5) Choose Installation Destination, and "I will configure partitioning" and press Done.
6) In Manual Partitioning, remove /swap as before with - (do not delete everything)...traceback.

Comment 18 mulhern 2014-03-17 19:40:47 UTC
Actually, this is enough:

1. Go to Installation Destination, select all disks, and "I will configure partitioning", press Done
2) In Manual Partitioning, remove swap partition in RHEL7 install, using - (do not delete everything on RHEL7 install) and press Done. This nets you a 'Destroy Device' action for the lvmlv /swap.
3) Go back to Installation Destination, unselect second disk, choose "I will configure partitioning" and press Done. In my case, swap partition reappeared, that is not wrong.
4) In Manual Partitioning, remove swap partition again using the -. Traceback!

Comment 19 mulhern 2014-03-17 19:43:24 UTC
Created attachment 875628 [details]
Screenshot of stack trace showing same error, albeit different trace

Comment 20 mulhern 2014-03-17 20:33:35 UTC
Created attachment 875677 [details]
Patch that failed

With this patch, the original bug is fixed, but it is possible to engineer a situation where hide finds itself calling _removeDevice on a non-leaf device. This can occur through some combination of deleting mountpoints in existing installs and adding and removing devices.

Comment 21 IBM Bug Proxy 2014-03-17 21:12:54 UTC
Created attachment 875696 [details]
anaconda.log snap 9

default comment by bridge

Comment 22 IBM Bug Proxy 2014-03-17 21:12:57 UTC
Created attachment 875697 [details]
anaconda traceback (/tmp/anaconda-tb-*) snap 9

default comment by bridge

Comment 23 IBM Bug Proxy 2014-03-17 21:13:00 UTC
Created attachment 875698 [details]
Shown space at first enter

default comment by bridge

Comment 24 IBM Bug Proxy 2014-03-17 21:13:02 UTC
Created attachment 875699 [details]
Shown space when reenter installation destination

default comment by bridge

Comment 25 IBM Bug Proxy 2014-03-17 21:13:05 UTC
Created attachment 875700 [details]
anaconda.log snap 10

default comment by bridge

Comment 26 IBM Bug Proxy 2014-03-17 21:13:12 UTC
Created attachment 875701 [details]
anaconda traceback (/tmp/anaconda-tb-*) snap 10

default comment by bridge

Comment 27 mulhern 2014-03-17 22:13:53 UTC
The problem here is that we find ourselves removing an LVMVolumeGroupDevice that has -2 kids. This makes it a non-leaf device, so error. DeviceTree.getChildren(device) == [], so this device is a leaf device, it's just that the kid count is now off.

Comment 28 mulhern 2014-03-17 23:04:45 UTC
The problem is that when we remove a device we decrement its parents child count
and when we add a device we do not do the corresponding operation.

My plan would be to use devicetree to figure out whether a device actually has children and use leaf just to record leafy properties of the device itself. A PartitionDevice requires more than just having no chidren to be a leaf.

Comment 29 mulhern 2014-03-26 15:43:14 UTC
*** Bug 1080409 has been marked as a duplicate of this bug. ***

Comment 30 mulhern 2014-03-26 15:47:22 UTC
Note that the error manifests somewhat differently in bz#1080409 so it's worth a look.

Comment 31 mulhern 2014-04-04 16:26:16 UTC
*** Bug 1084213 has been marked as a duplicate of this bug. ***

Comment 32 mulhern 2014-04-04 16:29:54 UTC
Note that bz#1084213 manifests due to the hiding of install media. It is possible that the type of install media (which is somehwat related to the reason for hiding it) should be taken into account in devicetree.hide(). When it comes to hiding install media, canceling actions seems like overkill and could be frustrating to the user, who has not taken any action to cause this to happen.

Comment 33 mulhern 2014-04-28 12:04:42 UTC
*** Bug 1089180 has been marked as a duplicate of this bug. ***

Comment 34 David Shea 2014-05-16 19:51:06 UTC
*** Bug 1098619 has been marked as a duplicate of this bug. ***

Comment 36 David Lehman 2014-09-16 20:27:34 UTC
(In reply to mulhern from comment #18)
> Actually, this is enough:
> 
> 1. Go to Installation Destination, select all disks, and "I will configure
> partitioning", press Done
> 2) In Manual Partitioning, remove swap partition in RHEL7 install, using -
> (do not delete everything on RHEL7 install) and press Done. This nets you a
> 'Destroy Device' action for the lvmlv /swap.
> 3) Go back to Installation Destination, unselect second disk, choose "I will
> configure partitioning" and press Done. In my case, swap partition
> reappeared, that is not wrong.

It is wrong. Since you've just hidden sdb all lvm that uses that disk should be hidden as well, but apparently it is not. It's because we cancel the actions after traversing the tree instead of beforehand. That means that we could be hiding devices that would be removed by the cancellations and then putting devices into the tree that should be hidden (by canceling destroy actions). I have a fix for this in my working tree, but wanted to note it here for posterity.

> 4) In Manual Partitioning, remove swap partition again using the -.
> Traceback!

Comment 38 Jan Stodola 2015-01-22 11:53:15 UTC
Retested with python-blivet-0.61.0.22-1.el7, using steps from comment 18.

After unselecting second disk and returning to the custom partitioning spoke, anaconda no longer shows logical volumes from incomplete VG, which is expected.
After removing PV and other existing partitions from the disk, it is possible to create new partitions and finish the installation.

Moving to VERIFIED.

Comment 40 errata-xmlrpc 2015-03-05 14:06:07 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-2015-0313.html