Bug 1194530

Summary: [abrt] blivet-gui: AttributeError: 'NoneType' object has no attribute 'startswith'
Product: [Fedora] Fedora Reporter: utoplenick <arifulovrenat>
Component: python-blivetAssignee: Vojtech Trefny <vtrefny>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: amulhern, anaconda-maint-list, arifulovrenat, bcl, dlehman, vpodzime, vtrefny
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/0c421e95fceeee6275d5c5de74a40e0ac9564f71
Whiteboard: abrt_hash:091fac61951dc1a9aca19fcb789c166bd253da5f3e038d10147a3e925c1d364e
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-02 09:16:22 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: backtrace
none
File: blivet-gui-tb
none
File: blivet.log
none
File: description
none
File: environ
none
program.log from version 0.2.1-2 none

Description utoplenick 2015-02-20 04:52:53 UTC
Description of problem:
just start blivet-gui

Version-Release number of selected component:
blivet-gui-0.2.1-1.fc21.noarch

Additional info:
reporter:       libreport-2.3.0
blivet-gui.log: 
cmdline:        /usr/bin/python  /bin/blivet-gui
executable:     /bin/blivet-gui
hashmarkername: blivet-gui
kernel:         3.18.7-200.fc21.x86_64
other involved packages: python-blivet-0.72-2.fc21.noarch
product:        Fedora"
release:        Fedora release 21 (Twenty One)
type:           Python
version:        Fedora

Truncated backtrace:
Traceback (most recent call last):
  File "/bin/blivet-gui", line 103, in <module>
    main()
  File "/bin/blivet-gui", line 95, in main
    win = main_window()
  File "/usr/lib/python2.7/site-packages/blivetgui/main_window.py", line 63, in main_window
    ListDevices(win, builder, kickstart)
  File "/usr/lib/python2.7/site-packages/blivetgui/list_devices.py", line 61, in __init__
    self.b = BlivetUtils(self.main_window, kickstart)
  File "/usr/lib/python2.7/site-packages/blivetgui/utils.py", line 163, in __init__
    self.storage.reset()
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 471, in reset
    self.devicetree.populate(cleanupOnly=cleanupOnly)
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 2078, in populate
    self._populate()
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 2144, in _populate
    self.addUdevDevice(dev)
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 1231, in addUdevDevice
    self.handleUdevDeviceFormat(info, device)
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 1846, in handleUdevDeviceFormat
    self.handleUdevMDMemberFormat(info, device)
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 1602, in handleUdevMDMemberFormat
    exists=True)
  File "/usr/lib/python2.7/site-packages/blivet/devices/md.py", line 87, in __init__
    sysfsPath=sysfsPath)
  File "/usr/lib/python2.7/site-packages/blivet/devices/container.py", line 63, in __init__
    super(ContainerDevice, self).__init__(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/blivet/devices/storage.py", line 105, in __init__
    super(StorageDevice, self).__init__(name, parents=parents)
  File "/usr/lib/python2.7/site-packages/blivet/devices/device.py", line 83, in __init__
    if not self.isNameValid(name):
  File "/usr/lib/python2.7/site-packages/blivet/devices/storage.py", line 764, in isNameValid
    if name.startswith("cciss/"):
AttributeError: 'NoneType' object has no attribute 'startswith'

Comment 1 utoplenick 2015-02-20 04:52:56 UTC
Created attachment 993822 [details]
File: backtrace

Comment 2 utoplenick 2015-02-20 04:52:58 UTC
Created attachment 993823 [details]
File: blivet-gui-tb

Comment 3 utoplenick 2015-02-20 04:52:59 UTC
Created attachment 993824 [details]
File: blivet.log

Comment 4 utoplenick 2015-02-20 04:53:00 UTC
Created attachment 993825 [details]
File: description

Comment 5 utoplenick 2015-02-20 04:53:01 UTC
Created attachment 993826 [details]
File: environ

Comment 6 mulhern 2015-02-20 14:02:12 UTC
Could you post program.log as well? It would be useful to see the output of mdexamine call.

Comment 7 Vojtech Trefny 2015-02-23 13:59:25 UTC
mulhern: I actually forgot to store the program.log, so it is not possible.

utoplenick: There is a new version of blivet-gui in my copr repository (0.2.2). If you wouldn't mind, please install it and run blivet-gui again -- it should fail the same way but now with the program.log available (in /tmp/program.log, the crash reporting tool shoud attach it automatically). It would really help us with debugging of this issue.

Comment 8 utoplenick 2015-02-24 20:30:55 UTC
Vojtech: sorry, but I cannot find new version for fedora 21.

Comment 9 Vojtech Trefny 2015-02-25 09:30:03 UTC
utoplenick: Sorry, my bad, I didn't realize you are using Fedora 21. New version was available only for rawhide... Sorry again. New build for Fedora 21 (0.2.1-2) is available now in my copr (vtrefny/blivet-gui).

Comment 10 utoplenick 2015-02-25 09:45:38 UTC
Created attachment 995063 [details]
program.log from version 0.2.1-2

Here is program.log

Comment 11 mulhern 2015-02-25 12:44:56 UTC
And here's the relevant mdexamine result.

INFO:program: Running... mdadm --examine --export /dev/sda
INFO:program: MD_METADATA=imsm
INFO:program: MD_LEVEL=container
INFO:program: MD_UUID=1659d7f3:8395e97a:1375cc63:0161dc68
INFO:program: MD_DEVICES=4
DEBUG:program: Return code: 0
INFO:program: Running... mdadm --examine --brief /dev/sda
INFO:program: ARRAY metadata=imsm UUID=1659d7f3:8395e97a:1375cc63:0161dc68
INFO:program: ARRAY /dev/md/Volume0 container=1659d7f3:8395e97a:1375cc63:0161dc68 member=0 UUID=d5410cf2:25a7af2c:1b865dca:59244416
DEBUG:program: Return code: 0

So, mdexamine isn't giving us the necessary information, clearly. Maybe this has to do with the fact that the metadata is imsm, and maybe not. If the metadata fails to provide the name directly, the fallback is to try to extract the name from the device, "/dev/md/Volume0". This functionality should probably be in udev, not in devicetree, but anyway, it should end up giving the name "Volume0". I suspect it does, but "Volume0" is rejected as a name because it doesn't look like the regular expression r'md\d+$' expects it to. After that, the cause is lost. The question is...how did that "Volume0" get there, and is it legit? What is going on w/ this array? Also, should we guard against the name being None? We guard against level, number of devices, and uuid being None by returning and we ensure that metadate version has some value. Perhaps we should simply return if md_name goes undiscovered.

Comment 12 mulhern 2015-02-25 12:48:34 UTC
Could you look at comment #11 and give your opinion on whether a quick fix, (exiting when md_name is None) is the right thing, or whether it needs a closer look?

Comment 13 David Lehman 2015-04-06 15:18:52 UTC
We should be coming up with the name "Volume0", which is totally legit.

Comment 14 mulhern 2015-04-06 16:13:20 UTC
This bug is related to bz#1208536. In storage log it's clear that the array initially can't be found because, like that bug, there is no UUID on the format because udev has not supplied one. We can supply one, like for the fix for that bug. The missing name problem will still exist, but it's looking less like a disagreement about the format of the name, and more like an inscrutable problem w/ mdexamine. Something in that block below the

# mdexamine yields MD_METADATA only for metadata version > 0.90

is going wrong, but it is less and less clear what.

Comment 15 mulhern 2015-06-23 14:01:27 UTC
Also related: https://github.com/rhinstaller/blivet/pull/161

Comment 16 Fedora End Of Life 2015-11-04 15:29:37 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 17 Fedora End Of Life 2015-12-02 09:16:25 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.