Bug 1043763 - AttributeError: 'DeviceFormat' object has no attribute 'peStart'
Summary: AttributeError: 'DeviceFormat' object has no attribute 'peStart'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-blivet
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: mulhern
QA Contact: Release Test Team
URL:
Whiteboard:
: 1034324 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-17 05:32 UTC by Kun He
Modified: 2021-09-03 14:13 UTC (History)
7 users (show)

Fixed In Version: python-blivet-0.18.30-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 09:55:25 UTC
Target Upstream Version:


Attachments (Terms of Use)
The exception information the system record. (639.54 KB, application/x-gzip)
2013-12-17 05:32 UTC, Kun He
no flags Details
anaconda-tb (1.87 MB, text/plain)
2013-12-20 01:19 UTC, Brian Lane
no flags Details
Screenshot showing funky display of disk situation that should be cleaned up (64.43 KB, image/png)
2014-02-14 18:10 UTC, mulhern
no flags Details
Patch that doesn't work (944 bytes, patch)
2014-02-18 23:31 UTC, mulhern
no flags Details | Diff
Possible fix to half the problem (1.21 KB, patch)
2014-02-19 20:08 UTC, mulhern
no flags Details | Diff
Screenshot showing CreateNew screen with almost no free space (109.80 KB, image/png)
2014-02-22 14:36 UTC, mulhern
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1032654 0 unspecified CLOSED AttributeError: 'DeviceFormat' object has no attribute 'partedDisk' 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1032895 1 None None None 2021-09-03 14:08:53 UTC
Red Hat Bugzilla 1077906 0 unspecified CLOSED Device.kids field out of sync with actual number of children 2021-09-03 14:08:06 UTC
Red Hat Bugzilla 1080409 1 None None None 2021-09-03 14:07:03 UTC

Internal Links: 1032654 1032895 1077906 1080409

Description Kun He 2013-12-17 05:32:55 UTC
Created attachment 837564 [details]
The exception information the system record.

Description of problem:


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


How reproducible:


Steps to Reproduce:
1. Boot in EFI mode from DVD. 
2. Turn to "STORAGE" configuration when the anaconda GUI load up.
3. Choose "Custom partitioning", delete all the partitions that already existed.
4. Add new mount point as "/", capacity set 51200MB, fs set xfs. Then just click "done" and "accept changes". Here, I do not create any other partitions(even the *ESP*) in order to find out what will happen while some errors exist in the partitions configuration. 
5. When turned back to the "installation summary page"(I'v no idear how to name it, just call it like this), *TRY* to turn to "STORAGE" configuration again.

Actual results:
1. After step 4, turn to the anaconda "installation summary page", and "Error checking storage configure" alarm shows on it.
2. After step 5, the anaconda crash or halted and the GUI cannot refresh. Sometimes a exception threw, but sometimes not. 

Expected results:
1. After step 5, I can continue the configuration of partition, util the configure is correct.

Additional info:

Comment 2 Brian Lane 2013-12-20 01:19:20 UTC
Created attachment 839292 [details]
anaconda-tb

Comment 3 Brian Lane 2013-12-20 01:22:50 UTC
Looks similar to bug 974255

Comment 4 mulhern 2013-12-23 14:52:16 UTC
Yes to Comment #3.

Comment 5 mulhern 2013-12-23 14:53:35 UTC
In trying to reproduce this bug I instead reproduced 1032654.

Comment 6 mulhern 2013-12-23 15:53:19 UTC
Posted a patch set for review that does not directly address this problem but ought to help clarify it a bit.

It's the same patch that I posted for #974255 a while ago.

Comment 7 mulhern 2013-12-23 16:41:14 UTC
Steps to reproduce #1032654 are pretty simple.

1) qemu-kvm -hda disk1 -hdb disk2 -m 1G -cdrom boot.iso
2) Choose "Installation Destination" spoke
3) Select both disks, press "Done"
4) In "Installation Options" dialogue select "Automatically configure" and press "Continue"
5) Select "Installation Destination" spoke
6) Press "Done"
7) In "Installation Options" dialogue choose "I want to review/modify" and press "Continue"
7a) Choose "Click here to create them automatically"
8) Press "Done" and in "Summary of Changes" dialogue press "Accept Changes"
9) Choose "Installation Destination" spoke once more
10) Unselect first disk, and press "Done"
11) In "Installation Options" dialogue choose "Custom Partitioning"

At the last step you go directly back to the main hub and get the stack trace noted above.

Comment 8 mulhern 2013-12-23 17:29:06 UTC
Or,

1) In "Installation Destination" select both disks and click "Done".
2) In "Installation Options" dialogue choose "I want to review/modify" and press "Continue"
3) Add a new mountpoint as specified in original report and press "Done"
4) In "Summary of Changes" dialog press "Accept Changes"
5) Choose "Installation Destination" again, unselect first disk, and press "Done"
6) In "Installation Options" dialogue choose "Custom Partitioning"
7) Return immediately to main hub and encounter same stack trace

Comment 9 mulhern 2013-12-23 18:05:15 UTC
There's little point in splitting these out to separate bugs because they all fit into the larger category of DeviceFormat objects, i.e., instances of DeviceFormat and not of any of its subclasses, ending up where they don't belong.

Comment 10 mulhern 2013-12-23 21:44:33 UTC
An interesting point is that the ids obtained by the Python id function don't seem to be behaving as appropriate.

That is, I can find the id generated like this for the particular format where the crash occurs. Then, I can search for that id among the ids of all the DeviceFormat objects returned by getFormat (with a little editing of the code to log this), and I can't find that id among any of the device formats so generated.

If I generate an internal counter-based id for every DeviceFormat, I can locate the one at the failure point and also where it was first generated quickly and precisely. This is a strong argument for switching over to this kind of id, especially as they are generated in sequence, which is useful to a person debugging. It is probably a good idea to come up with an abstraction for this.

Comment 11 mulhern 2013-12-23 21:56:15 UTC
As it happens, the format which is the culprit in this case is the one with id (2), the format generated for the first disk examined, which is a DiskDevice.

The previous formats aren't associated w/ any device, but represent the default filesystem.

Comment 12 mulhern 2013-12-23 22:14:13 UTC
It is likely that the commit that fixed #1027845 (ec045750ff8d63bedd7a2eb5860b24b8a0b016aa) should be cherry-picked to this branch. It removes devices that the user removes, instead of just hiding them.

Comment 13 mulhern 2014-01-06 15:16:46 UTC
Pushed patch described in Comment#6 to master.

Comment 14 mulhern 2014-01-06 21:21:22 UTC
Posted another patch that should make the logging in storage.log more informative for debugging DeviceFormat has no attribute errors like this one.

Comment 15 mulhern 2014-01-06 21:46:39 UTC
I couldn't reproduce the original bug. I used method described here: https://fedoraproject.org/wiki/Testing_secureboot_with_KVM.

Comment 16 mulhern 2014-01-07 17:11:08 UTC
Pushed patch described in Commment #14 to master.

Comment 17 David Cantrell 2014-01-15 19:26:55 UTC
*** Bug 1034324 has been marked as a duplicate of this bug. ***

Comment 18 mulhern 2014-02-03 21:48:45 UTC
Please let me know if you can still reproduce this in current version.

Thanks!

- mulhern

Comment 19 David Lehman 2014-02-06 13:28:29 UTC
(I didn't actually do this, but I'd be willing to bet some cash it is accurate.)

Steps to reproduce:

1. set up an lvm layout that spans two disks in custom spoke
2. return to disk selection and hide one of the two disks
3. return to the custom spoke and try to change the size of an lv in
   the aforementioned vg
4. bang!

DeviceTree.hide needs some code to make sure that when it cancels creation of a pv it also cancels the rest of that lvm layout (from other disks) since the layout is in all likelihood broken.

Comment 20 mulhern 2014-02-10 17:47:23 UTC
Cannot reproduce. I think it's getting to be a candidate for fixed in current version.

Comment 21 mulhern 2014-02-14 18:05:12 UTC
Ok. I do get a problem but it shows up slightly differently.

1. Go to Installation Destination spoke
2. Select "custom partitioning" radio button, choose two disks, 8GB and 20GB and press "Continue"
3. On "Manual Partitioning" press Create button. The LVM layout spans the two disks.
4. Press Done and Accept Changes and return to hub.
5. Unselect first disk, make sure "custom partitioning" radio button is selected, press continue.
6. See screenshot for not quite right situation.

Comment 22 mulhern 2014-02-14 18:10:57 UTC
Created attachment 863350 [details]
Screenshot showing funky display of disk situation that should be cleaned up

Comment 23 mulhern 2014-02-18 23:30:22 UTC
The attached patch fails miserably because it creates cyclical dependencies in the action graph which therefore can not be topologically sorted. It may actually succeed in doing the correct thing in devicetree.DeviceTree.hide.

Comment 24 mulhern 2014-02-18 23:31:52 UTC
Created attachment 864826 [details]
Patch that doesn't work

Comment 25 mulhern 2014-02-19 20:08:45 UTC
Created attachment 865197 [details]
Possible fix to half the problem

New patch that leads to Unknown OS/Unknown format display in custom spoke which is probably correct.

Comment 26 mulhern 2014-02-19 20:09:57 UTC
The Unknown OS/Unknown Format display then leads the the same stack trace as with bz#1032895.

Comment 27 mulhern 2014-02-19 23:35:31 UTC
Unknown OS/Unknown format is ok, but "New Rhel7..." page should be there as well, even if is empty.

Comment 28 mulhern 2014-02-20 16:18:52 UTC
Blivet side of patch acked.

Comment 29 mulhern 2014-02-21 16:01:33 UTC
bz#996078 has a commit associated with it in master which I think should fix the rest of the problem. Oddly enough, that commit isn't in RHEL7 branch, but bz#996078 has Verified status.

Comment 30 mulhern 2014-02-21 16:29:20 UTC
Applying that commit results in a stack trace because the accordion is empty since the partition is no longer in unusedDevices but the "New ..." page is not made either.

list index out of range at @line 1020

firstPage = self._accordion.allPages[0]

Comment 31 mulhern 2014-02-21 18:20:21 UTC
Posted again.

Comment 32 mulhern 2014-02-22 14:33:44 UTC
Things are better, with a blivet only patch set, which improves the removal of devices and actions in devicetree.DeviceTree.hide(). So, when we get rid of the disk, lvs and pvs get removed and we end up back at the special CreateNew page.

What is still going wrong is that there is virtually no space on the one remaining device.

Comment 33 mulhern 2014-02-22 14:36:24 UTC
Created attachment 866415 [details]
Screenshot showing CreateNew screen with almost no free space

The CreateNew page is correct, but that missing free space is wrong.

Comment 34 mulhern 2014-02-22 17:29:49 UTC
The problem is that shouldClear() returns False on this disk because:

1) self.config.clearNonExistent is False and
2) it's a disk
3) it's format does not exist

It's format is DiskLabel.

After all other actions have been canceled two actions remain:
A destroy format and a create format.

The second action creates the DiskLabel format which does not exist,
replacing the DeviceFormat, which does exist. The other action destroys the format. It's these two actions which are causing the problem, looks like.

Comment 35 mulhern 2014-02-24 13:28:55 UTC
Comment #34 diagnosis is incorrect. I believe that shouldClear is doing the correct thing and that it is probably subsequent code in getFreeSpace() that calculates available free space incorrectly.

The DestroyFormat and CreateFormat actions would be created automatically even if no other action were taken.

Comment 36 mulhern 2014-02-24 14:37:03 UTC
It seems that the problem is that the remaining disk, sdc, has a format of DiskLabel when it should have a format of DeviceFormat. It still has the two associated actions, destroy format DeviceFormat and CreateFormat disklabel.

Comment 37 mulhern 2014-02-24 22:38:03 UTC
Posted again. At this point it is believed that there are no more remaining problems to be fixed.

Comment 38 mulhern 2014-02-25 12:25:06 UTC
Tiny anaconda side of this acked by vpodzime, but most of it is on blivet side.

Comment 39 mulhern 2014-02-25 15:42:06 UTC
Pushed tiny anaconda side, which is independent, posted new version of blivet side.

Comment 40 mulhern 2014-02-25 17:46:21 UTC
Posted again with a much simpler patch.

Comment 42 mulhern 2014-03-04 17:06:06 UTC
Posted and acked.

Comment 43 Peter Kotvan 2014-03-17 09:26:19 UTC
Verified on:
RHEL-7.0-20140314.0
python-blivet-0.18.32-1.el7

Comment 44 Ludek Smid 2014-06-13 09:55:25 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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