Bug 852864

Summary: [abrt] system-config-lvm-1.1.12-12.el6: ExtentBlock.py:14:__init__:AttributeError: 'NoneType' object has no attribute 'add_extent_block'
Product: Red Hat Enterprise Linux 6 Reporter: Jeff Bastian <jbastian>
Component: system-config-lvmAssignee: Marek Grac <mgrac>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.3CC: agk, cluster-maint, dwysocha, mbroz, prajnoha, prockai, rsteiger
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:8e701696e13bd3a0075cee31b7d460fa96814870
Fixed In Version: system-config-lvm-1.1.12-14.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 10:04:53 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:
Attachments:
Description Flags
File: sosreport.tar.xz
none
Proposed patch none

Description Jeff Bastian 2012-08-29 19:46:45 UTC
libreport version: 2.0.9
abrt_version:   2.0.8
cmdline:        /usr/bin/python2 /usr/share/system-config-lvm/system-config-lvm.py
executable:     /usr/share/system-config-lvm/system-config-lvm.py
kernel:         2.6.32-279.el6.x86_64
reason:         ExtentBlock.py:14:__init__:AttributeError: 'NoneType' object has no attribute 'add_extent_block'
time:           Wed 29 Aug 2012 02:17:25 PM CDT
uid:            0
username:       root

sosreport.tar.xz: Binary file, 1165620 bytes

backtrace:
:ExtentBlock.py:14:__init__:AttributeError: 'NoneType' object has no attribute 'add_extent_block'
:
:Traceback (most recent call last):
:  File "/usr/share/system-config-lvm/system-config-lvm.py", line 172, in <module>
:    runFullGUI()
:  File "/usr/share/system-config-lvm/system-config-lvm.py", line 157, in runFullGUI
:    blvm = baselvm(glade_xml, app)
:  File "/usr/share/system-config-lvm/system-config-lvm.py", line 105, in __init__
:    self.volume_tab_view = Volume_Tab_View(glade_xml, self.lvmm, self.main_win)
:  File "/usr/share/system-config-lvm/Volume_Tab_View.py", line 133, in __init__
:    self.prepare_tree()
:  File "/usr/share/system-config-lvm/Volume_Tab_View.py", line 214, in prepare_tree
:    self.model_factory.reload()
:  File "/usr/share/system-config-lvm/lvm_model.py", line 168, in reload
:    self.__query_LVs()
:  File "/usr/share/system-config-lvm/lvm_model.py", line 543, in __query_LVs
:    extent_block = ExtentBlock(pv, lv, ph_ext_beg, seg_size/len(devs))
:  File "/usr/share/system-config-lvm/ExtentBlock.py", line 14, in __init__
:    self.__pv.add_extent_block(self)
:AttributeError: 'NoneType' object has no attribute 'add_extent_block'
:
:Local variables in innermost frame:
:lv: <LogicalVolume.LogicalVolume instance at 0x10fb248>
:start: 0
:self: <ExtentBlock.ExtentBlock instance at 0x10fb2d8>
:pv: None
:size: 2048

comment:
:I added a second hard drive to my LVM volume group, and then I converted my 
:linear logical volumes to a RAID1 mirrored volume, and now
:system-config-lvm crashes with the traceback below.
:  pvcreate /dev/sdb1
:  vgextend vg_gecko /dev/sdb1
:  lvconvert --type raid1 -m 1 vg_gecko/gecko_root
:  lvconvert --type raid1 -m 1 vg_gecko/gecko_home
:  system-config-lvm
:
:The system is copying data right now.  I'll try again when the copy
:finishes.
:
:[root@gecko ~]# lvs -a -o name,copy_percent,devices vg_gecko
:  LV                    Copy%  Devices                                      
:  gecko_home             13.40 gecko_home_rimage_0(0),gecko_home_rimage_1(0)
:  [gecko_home_rimage_0]        /dev/sda5(0)                                 
:  [gecko_home_rimage_1]        /dev/sdb1(8194)                              
:  [gecko_home_rmeta_0]         /dev/sda5(13441)                             
:  [gecko_home_rmeta_1]         /dev/sdb1(8193)                              
:  gecko_root              0.82 gecko_root_rimage_0(0),gecko_root_rimage_1(0)
:  [gecko_root_rimage_0]        /dev/sda5(4608)                              
:  [gecko_root_rimage_1]        /dev/sdb1(1)                                 
:  [gecko_root_rmeta_0]         /dev/sda5(13440)                             
:  [gecko_root_rmeta_1]         /dev/sdb1(0)                                 
:  swap                         /dev/sda5(4096)
:  win7-vm                      /dev/sda5(12800)

Comment 1 Jeff Bastian 2012-08-29 19:46:49 UTC
Created attachment 607985 [details]
File: sosreport.tar.xz

Comment 3 Marek Grac 2012-09-06 13:02:26 UTC
@Jeff:

Is system-config-lvm working correctly after migration was completed?

Comment 4 Jeff Bastian 2012-09-06 14:52:20 UTC
No, it still fails with the same traceback.

(Sorry, I promised to update when the migration finished but I forgot!)

The migration is complete and working now:

$ sudo lvs -a -o name,copy_percent,devices
  LV                    Copy%  Devices
  gecko_home            100.00 gecko_home_rimage_0(0),gecko_home_rimage_1(0)
  [gecko_home_rimage_0]        /dev/sda5(0)
  [gecko_home_rimage_1]        /dev/sdb1(8194)
  [gecko_home_rmeta_0]         /dev/sda5(13441)
  [gecko_home_rmeta_1]         /dev/sdb1(8193)
  gecko_root            100.00 gecko_root_rimage_0(0),gecko_root_rimage_1(0)
  [gecko_root_rimage_0]        /dev/sda5(4608)
  [gecko_root_rimage_1]        /dev/sdb1(1)
  [gecko_root_rmeta_0]         /dev/sda5(13440)
  [gecko_root_rmeta_1]         /dev/sdb1(0)
  swap                         /dev/sda5(4096)
  win7-vm                      /dev/sda5(12800)

Comment 5 Marek Grac 2012-09-10 14:58:06 UTC
Reproducer:

dd if=/dev/zero of=/disk1
dd if=/dev/zero of=/disk2
dd if=/dev/zero of=/disk3
  
losetup -f /disk1
losetup -f /disk2
losetup -f /disk3
   
losetup -a (check devices)

pvcreate /dev/loop[012]
vgcreate test /dev/loop[012]  
lvcreate -n first -L 100M test

lvconvert --type raid1 -m 1 test/first

system-config-lvm

Comment 6 Marek Grac 2012-09-10 15:24:22 UTC
Created attachment 611473 [details]
Proposed patch

Proposed patch fixes problem with crashing. Please try to apply and test it too. 

You should see part of RAID1 what is not an ideal solution but adding support for RAID1 in LVM to system-config-lvm should be treat under RFE.

Comment 7 Jeff Bastian 2012-09-10 21:24:31 UTC
I confirm the patch solves the crash.

s-c-lvm shows all the pieces of the RAID1 as if they were equivalent logical volumes.  That is, instead of just gecko_home and gecko_root, I get:
  gecko_home
  gecko_home_rimage_0
  gecko_home_rimage_1
  gecko_home_rmeta_0
  gecko_home_rmeta_1
  gecko_root
  gecko_root_rimage_0
  gecko_root_rimage_1
  gecko_root_rmeta_0
  gecko_root_rmeta_1

But as you say, this problem is for an RFE.

Thank you!

Comment 16 errata-xmlrpc 2013-02-21 10:04: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.

http://rhn.redhat.com/errata/RHBA-2013-0385.html