Bug 1075671 - Disk information not completely restored when actions are canceled
Summary: Disk information not completely restored when actions are canceled
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-blivet
Version: 7.0
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: David Lehman
QA Contact: Release Test Team
URL:
Whiteboard: abrt_hash:6855424faae8561a871ffae9ac5...
: 1074094 1075541 1080409 1084213 1089180 1098619 (view as bug list)
Depends On:
Blocks: 782468 1113519 807834 829185 1028479 1064025 1085201
TreeView+ depends on / blocked
 
Reported: 2014-03-12 14:52 UTC by Bruno Goncalves
Modified: 2019-04-16 14:08 UTC (History)
11 users (show)

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.
Clone Of:
Environment:
Last Closed: 2015-03-05 14:06:07 UTC
Target Upstream Version:


Attachments (Terms of Use)
File: anaconda-tb (557.12 KB, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: anaconda.log (14.12 KB, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: environ (404 bytes, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: ks.cfg (10.23 KB, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: lsblk_output (2.05 KB, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: nmcli_dev_list (2.50 KB, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: os_info (510 bytes, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: program.log (48.04 KB, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: storage.log (126.93 KB, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: syslog (113.59 KB, text/plain)
2014-03-12 14:53 UTC, Bruno Goncalves
no flags Details
File: ifcfg.log (7.05 KB, text/plain)
2014-03-12 14:54 UTC, Bruno Goncalves
no flags Details
File: packaging.log (154.58 KB, text/plain)
2014-03-12 14:54 UTC, Bruno Goncalves
no flags Details
Screenshot of stack trace showing same error, albeit different trace (29.87 KB, image/png)
2014-03-17 19:43 UTC, mulhern
no flags Details
Patch that failed (3.61 KB, patch)
2014-03-17 20:33 UTC, mulhern
no flags Details | Diff
anaconda.log snap 9 (29.88 KB, application/octet-stream)
2014-03-17 21:12 UTC, IBM Bug Proxy
no flags Details
anaconda traceback (/tmp/anaconda-tb-*) snap 9 (494.06 KB, application/octet-stream)
2014-03-17 21:12 UTC, IBM Bug Proxy
no flags Details
Shown space at first enter (133.44 KB, image/jpeg)
2014-03-17 21:13 UTC, IBM Bug Proxy
no flags Details
Shown space when reenter installation destination (136.16 KB, image/jpeg)
2014-03-17 21:13 UTC, IBM Bug Proxy
no flags Details
anaconda.log snap 10 (12.89 KB, application/octet-stream)
2014-03-17 21:13 UTC, IBM Bug Proxy
no flags Details
anaconda traceback (/tmp/anaconda-tb-*) snap 10 (477.70 KB, application/octet-stream)
2014-03-17 21:13 UTC, IBM Bug Proxy
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1077906 None None None Never
Red Hat Bugzilla 1084213 None None None Never
Red Hat Knowledge Base (Solution) 797883 None None None Never
Red Hat Product Errata RHBA-2015:0313 normal SHIPPED_LIVE python-blivet bug fix and enhancement update 2015-03-05 17:35:49 UTC

Internal Links: 1077906 1084213

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


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