Bug 522200

Summary: [CRM#1935122] system-config-lvm crashes at startup (empty PhysicalVolume.devnames)
Product: Red Hat Enterprise Linux 5 Reporter: ritz <rkhadgar>
Component: system-config-lvmAssignee: Marek Grac <mgrac>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: agk, bbrock, bmr, cluster-maint, cward, dwysocha, mbroz, prockai, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: system-config-lvm-1.1.5-3.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:42:42 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:

Description ritz 2009-09-09 18:32:09 UTC
Created attachment 360307 [details]
patch

Description of problem:
system-config-lvm crashes at startup

Version-Release number of selected component (if applicable):
1.1.5-1.0.el5

How reproducible:
always

Steps to Reproduce:
1. system-config-lvm
  
Actual results:
system-config-lvm crashes at startup

Expected results:
system-config-lvm should Just Work

Additional info:
Not sure, why pv.devnames is empty. Patch attached to allow pv.getPartition() handle this case gracefuly, From Adrien Kunysz

Here is the backtrace extracted from strace:

Traceback (most recent call last):
 File "/usr/sbin/system-config-lvm", line 173, in ?
   runFullGUI()
 File "/usr/sbin/system-config-lvm", line 158, in runFullGUI
   blvm = baselvm(glade_xml, app)
 File "/usr/sbin/system-config-lvm", line 108, 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 175, in reload
   self.__set_LVs_props() # has to come after link_mirrors
 File "/usr/share/system-config-lvm/lvm_model.py", line 801, in __set_LVs_props
   lv.set_properties(self.__get_data_for_LV(lv))
 File "/usr/share/system-config-lvm/lvm_model.py", line 857, in __get_data_for_LV
   text_list.append(self.__getFS(lv.get_path()))
 File "/usr/share/system-config-lvm/lvm_model.py", line 987, in __getFS
   if path_list[0].getPartition() == None:
 File "/usr/share/system-config-lvm/PhysicalVolume.py", line 146, in getPartition
   return (self.getDevnames()[0], self.part)
IndexError: list index out of range

So it looks like self.getDevnames() returns and empty list. Here is that method full body:

 def getDevnames(self):
   return self.devnames

Now, devnames is initialized as an empty list in __init__:
   self.devnames = []

It is grown by calling addDevname:
     self.devnames.append(devname)

and shrinked by calling removeDevname:
     self.devnames.pop(self.devnames.index(devname))

It seems clear that PV.getPartition() should be able to handle the empty list case as caller lvm_model:__getFS() can handle None.

There might still be a more fundamental problem however (why is devnames empty?).

Comment 12 Chris Ward 2010-02-11 10:23:33 UTC
~~ Attention Customers and Partners - RHEL 5.5 Beta is now available on RHN ~~

RHEL 5.5 Beta has been released! There should be a fix present in this 
release that addresses your request. Please test and report back results 
here, by March 3rd 2010 (2010-03-03) or sooner.

Upon successful verification of this request, post your results and update 
the Verified field in Bugzilla with the appropriate value.

If you encounter any issues while testing, please describe them and set 
this bug into NEED_INFO. If you encounter new defects or have additional 
patch(es) to request for inclusion, please clone this bug per each request
and escalate through your support representative.

Comment 21 errata-xmlrpc 2010-03-30 08:42:42 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0267.html