Bug 516168 - Traceback while initializing disks
Summary: Traceback while initializing disks
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: rawhide
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Hans de Goede
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: anaconda_trace_hash:5e082969ea0041538...
Depends On:
Blocks: F12Alpha, F12AlphaBlocker
TreeView+ depends on / blocked
 
Reported: 2009-08-07 05:47 UTC by Jesse Keating
Modified: 2013-01-10 03:30 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-11 18:41:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Attached traceback automatically from anaconda. (69.87 KB, text/plain)
2009-08-07 05:48 UTC, Jesse Keating
no flags Details

Description Jesse Keating 2009-08-07 05:47:55 UTC
The following was filed automatically by anaconda:
anaconda 12.10 exception report
Traceback (most recent call first):
  File "/usr/lib/anaconda/storage/udev.py", line 170, in udev_device_get_sysfs_path
    return info['sysfs_path']
  File "/usr/lib/anaconda/storage/devicetree.py", line 1196, in addUdevDevice
    sysfs_path = udev_device_get_sysfs_path(info)
  File "/usr/lib/anaconda/storage/devicetree.py", line 1089, in addUdevPartitionDevice
    self.addUdevDevice(new_info)
  File "/usr/lib/anaconda/storage/devicetree.py", line 1259, in addUdevDevice
    device = self.addUdevPartitionDevice(info)
  File "/usr/lib/anaconda/storage/devicetree.py", line 1864, in populate
    self.addUdevDevice(dev)
  File "/usr/lib/anaconda/storage/__init__.py", line 293, in reset
    self.devicetree.populate()
  File "/usr/lib/anaconda/storage/__init__.py", line 92, in storageInitialize
    storage.reset()
  File "/usr/lib/anaconda/dispatch.py", line 204, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 127, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/gui.py", line 1201, in nextClicked
    self.anaconda.dispatch.gotoNext()
  File "/usr/lib/anaconda/gui.py", line 1331, in keyRelease
    self.nextClicked()
KeyError: 'sysfs_path'

Comment 1 Jesse Keating 2009-08-07 05:48:00 UTC
Created attachment 356622 [details]
Attached traceback automatically from anaconda.

Comment 2 Hans de Goede 2009-08-07 12:34:26 UTC
Ok,

So this is not as generic a bug as you think, something weird is going on,
from the log:

[2009-07-29 19:36:06,011]     INFO: devices to scan: ['sda1', 'sda2', 'sdb1', 'sr0', 'sda', 'sdb']
[2009-07-29 19:36:06,257]    DEBUG: scanning sda1 (/devices/pci0000:00/0000:00:07.0/host0/target0:0:0/0:0:0:0/block/sda/sda1)...
[2009-07-29 19:36:06,258]    DEBUG: looking for device 'sda1'...
[2009-07-29 19:36:06,258]    DEBUG: found None
[2009-07-29 19:36:06,259]    DEBUG: sda1 is a partition
[2009-07-29 19:36:06,262]    DEBUG: looking for device 'sda'...
[2009-07-29 19:36:06,263]    DEBUG: found None
[2009-07-29 19:36:06,264]    DEBUG: /devices/pci0000:00/0000:00:07.0/host0/target0:0:0/0:0:0:0/block/sda does not exist

So it begins with scanning sda1, then cannot find the disk in the devicetree
at it has not been scanned yet (all fine) and then it errors out with:

[2009-07-29 19:36:06,264]    DEBUG: /devices/pci0000:00/0000:00:07.0/host0/target0:0:0/0:0:0:0/block/sda does not exist

Which is the beginning of the end.

Comment 3 Hans de Goede 2009-08-07 12:49:26 UTC
Hmm, ok, I take that back the issue does seem to be as generic as you think, digging deeper ...

Ok so the problem is that the find the disk and add it to the tree code in
addUdevPartitionDevice() passes a sysfs path without /sys/ prefixed to
udev_get_block_device()

Where as udev_get_block_device() expects a path prefixed with /sys/.

This was a pre-existing problem before the recent udev handling changes clumens did, but before these changes, udev_get_block_device() would just return
None in this case, leading to:

            if disk is None:
                # if the current device is still not in
                # the tree, something has gone wrong
                log.error("failure scanning device %s" % disk_name)
                return  

So if a partition was scanned before a disk we would ignore it. In the new udev code however we have:

    dev = udev_get_device(sysfs_path)
    if not dev or not dev.has_key("name"):
        return {"name": None, "symlinks": []}
    else:
        return dev

So  udev_get_block_device() is no longer returning None due to the wrong sysfs path, and therefor we now backtrace.

I'll send a patch to the list fixing the sysfs path issue.


p.s.

This does expose a deeper problem, just like had some places in the old storage code which expected /dev/sda and others which expected just sda, we seem to have done the same now with /sys. udev_device_get_sysfs_path() returns 
a path without the /sys prefix, where as udev_get_block_device expects a path
prefixed with /sys. This seems like something which we ought to fix.

Comment 4 Hans de Goede 2009-08-07 13:52:29 UTC
Status upd: a patch for this has been send to the list.

Comment 5 Hans de Goede 2009-08-07 14:46:03 UTC
This is fixed by this commit:
http://git.fedorahosted.org/git/?p=anaconda.git;a=commitdiff;h=2694e31a34d7f89ab84d59fbdfcffd3986cc1fcb

Which will be in 12.11

Comment 6 Jesse Keating 2009-08-11 18:41:12 UTC
Confirmed fixed in rawhide.


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