Bug 495433

Summary: Anaconda crash: Error opening /dev/sdb: No medium found
Product: [Fedora] Fedora Reporter: Dmytro Taranovsky <dmytro>
Component: pypartedAssignee: David Cantrell <dcantrell>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: al.danial, am, arkaha, asrhael, atila_rist, bugzilla.redhat, dcantrell, dejan1, d.jaya, drozas, esdumbo2003, frengoflash, fvdmarkt, jlc, lhx_ytht, lorenzo.themax, mblauste, mbrast, mike, murli.shreeya6508, peter2.hemery, pjones, plarsen, reddot357, rmaximo, starsareblueandfaraway, vanmeeuwen+fedora, ver.sanjose, vruiz2.0, werdberd, whart, w.winthagen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-23 22:31:22 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 473302    
Attachments:
Description Flags
Anaconda dump file
none
Anaconda Traceback for RAID install failure
none
Anaconda error log
none
Anaconda fails during instyallation none

Description Dmytro Taranovsky 2009-04-13 00:40:13 EDT
Created attachment 339276 [details]
Anaconda dump file

When trying to install Fedora 11 (post-beta) Snapshot 1 (Gnome Live CD with anaconda-11.5.0.42-1.i586) to the hard drive, anaconda created the following exception:
Traceback (most recent call first):
  File "/usr/lib/python2.6/site-packages/parted/geometry.py", line 128, in intersect
    return Geometry(PedGeometry=self.__geometry.intersect(b.getPedGeometry()))
  File "/usr/lib/anaconda/storage/partitioning.py", line 487, in getBestFreeSpaceRegion
    free_geom = extended.geometry.intersect(_range)
  File "/usr/lib/anaconda/storage/partitioning.py", line 697, in allocatePartitions
    boot=_part.req_bootable)
  File "/usr/lib/anaconda/storage/partitioning.py", line 562, in doPartitioning
    allocatePartitions(disks, partitions)
  File "/usr/lib/anaconda/storage/partitioning.py", line 186, in doAutoPartition
    exclusiveDisks=anaconda.id.storage.clearPartDisks)
  File "/usr/lib/anaconda/dispatch.py", line 205, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 128, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/gui.py", line 1323, in nextClicked
    self.anaconda.dispatch.gotoNext()
CreateException: Error opening /dev/sdb: No medium found

See the attached anacdump.txt

Note that /deb/sdb is a USB HS-CF Card.
This bug may be related to Bug 488800, but it is not the same bug.
Comment 1 Dmytro Taranovsky 2009-04-14 20:18:11 EDT
As a workaround, I was able to install Fedora 11 Snapshot 1 by first running
rmmod usb-strorage
Comment 2 Chris Lumens 2009-04-20 10:38:20 EDT
*** Bug 496411 has been marked as a duplicate of this bug. ***
Comment 3 Chris Lumens 2009-05-07 09:56:47 EDT
*** Bug 499523 has been marked as a duplicate of this bug. ***
Comment 4 Dmytro Taranovsky 2009-05-07 12:33:08 EDT
I can confirm that the bug continues to be present in Fedora 11 Preview Release i686 and that upgrading to anaconda-11.5.0.50 does not help.  Adding to Fedora 11 Target.
Comment 5 Chris Lumens 2009-05-10 19:24:00 EDT
*** Bug 500090 has been marked as a duplicate of this bug. ***
Comment 6 Chris Lumens 2009-05-10 19:24:09 EDT
*** Bug 500091 has been marked as a duplicate of this bug. ***
Comment 7 Bug Zapper 2009-06-09 09:43:16 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 8 Chris Lumens 2009-06-10 09:47:56 EDT
*** Bug 504878 has been marked as a duplicate of this bug. ***
Comment 9 Chris Lumens 2009-06-10 09:48:07 EDT
*** Bug 505038 has been marked as a duplicate of this bug. ***
Comment 10 Jeffrey R. Evans 2009-06-10 17:20:51 EDT
Created attachment 347297 [details]
Anaconda Traceback for RAID install failure
Comment 11 Michael St. Laurent 2009-06-11 18:06:59 EDT
On my system this bug seems to have been related to the presence of USB storage
devices.  I had a USB hub plugged in that would accept memory cards such as
those used in digital cameras, MP3 players, etc.  Once I unplugged this hub the install was able to proceed.
Comment 12 Rob Taft 2009-06-28 09:43:44 EDT
Same situation here, I have a 14-in-1 internal card reader.  I'm trying to install on sda5 and there is nothing in the sdb drive.  I will attempt to disconnect it and try again.
Comment 13 Rob Taft 2009-06-28 09:45:10 EDT
Created attachment 349702 [details]
Anaconda error log
Comment 14 Chris Lumens 2009-06-29 08:17:26 EDT
*** Bug 508604 has been marked as a duplicate of this bug. ***
Comment 15 Rob Taft 2009-06-29 08:40:02 EDT
Disconnecting the card reader got everything installed and working fine.  I cannot get to grub either with it plugged in, so for now it is disconnected until this can be resolved.
Comment 16 Chris Lumens 2009-06-29 11:42:47 EDT
*** Bug 505812 has been marked as a duplicate of this bug. ***
Comment 17 Chris Lumens 2009-07-02 15:48:26 EDT
*** Bug 509442 has been marked as a duplicate of this bug. ***
Comment 18 Chris Lumens 2009-07-06 11:57:19 EDT
*** Bug 509051 has been marked as a duplicate of this bug. ***
Comment 19 Need Real Name 2009-07-19 17:30:44 EDT
Disabling usb as a workaround does not work with Insprion 1545.  I don't know what is going on, but it seems to be impossible to install fedora 11 on this system.
Comment 20 Philip Frampton 2009-07-25 13:48:25 EDT
Dear "Need Real Name". I've just found this bug trying to setup my mum's new laptop with F11. It's an Inspiron 1545. For me the disable USB work around is working.

Open a Terminal and type "su" and then Enter.
Type "rmmod usb_storage" and enter
Exit the terminal and run the Install to Disk.

Hope it works for you.

Philip
Comment 21 William Hart 2009-07-25 21:59:37 EDT
Created attachment 355169 [details]
Anaconda fails during instyallation
Comment 22 Need Real Name 2009-07-26 14:04:36 EDT
I did eventually succeed in installing fc 11.  The trick was to put "nousb" to the command line at the beginning of the process.

I don't see how one can do "rmmod" etc. during the installation process itself- how can you open a terminal?
Comment 23 Chris Lumens 2009-08-02 12:26:07 EDT
*** Bug 515057 has been marked as a duplicate of this bug. ***
Comment 24 Chris Lumens 2009-08-03 11:47:26 EDT
Both QA and I have done tests and cannot reproduce this bug, though we were able to reproduce it in F11 before I fixed the original problem.  This makes debugging what's going on here difficult.  Is there anyone on this bug who can easily reproduce it who might be able to help debugging?

If so, here's what I'd like.  When the exception dialog comes up, press the debug button.  Then attach the output of the following pdb commands:

type(b)
print b
print b.__geometry
up
print disk.getFreeSpaceRegions()
up
up
print disks
print map(lambda d: d.mediaPresent, disks)
print map(lambda d: d.partedDevice, disks)

Thanks.
Comment 25 Radek Vykydal 2009-08-04 05:53:28 EDT
*** Bug 515025 has been marked as a duplicate of this bug. ***
Comment 26 Andy Lindeberg 2009-08-04 10:45:29 EDT
*** Bug 515364 has been marked as a duplicate of this bug. ***
Comment 27 Chris Lumens 2009-08-10 09:52:19 EDT
*** Bug 516353 has been marked as a duplicate of this bug. ***
Comment 28 Martin Andrews 2009-08-10 10:09:12 EDT
Here is the slightly abbreviated (until someone can tell me how to redirect
output from pdb onto a mounted device...) output after dropping back to the
Debugger :

(pdb) type(b)
class `parted.geometry.Geometry`

(pdb) print b
parted.Geometry instance --
start: 63   end: 2047
device: <parted.device.Device> PedGeometry: <_ped.Geometry>

(pdb) print b.__geometry
no attribute __geometry

(pdb) up
partitioning.py 505 getBestFreeSpaceRegion()
free_geom=None

(pdb) print disk.getFreeSpaceRegions()
[ <parted.geometry.Geometry>, <parted.geometry.Geometry>,
<parted.geometry.Geometry>, <parted.geometry.Geometry> ]

(pdb) up
partitioning.py 798 allocatePartitions()
boot=_part.req_bootable

(pdb) up
partitioning.py 587 doPartitioning()
allocatePartitions(disks, partitions)

(pdb) print disks
[ <storage.devices.DiskDevice> ]

(pdb) print map(lambda d: d.mediaPresent, disks)
[ True ]

(pdb) print map(lambda d: d.partedDevice, disks)
[ <parted.device.Device> ]


Please respond ASAP, since this machine won't be in this uninstalled state for
long...  I'm happy to help while I can.
Comment 29 Hans de Goede 2009-08-10 10:26:18 EDT
*** Bug 505750 has been marked as a duplicate of this bug. ***
Comment 30 Chris Lumens 2009-08-10 10:28:26 EDT
*** Bug 515850 has been marked as a duplicate of this bug. ***
Comment 31 Chris Lumens 2009-08-10 12:04:08 EDT
This confirms that my patch to keep USB devices without media out of the disks list.  However, it does not explain why pyparted/libparted is attempting to open the USB device.
Comment 32 Alex 2009-08-10 14:41:31 EDT
I unplugged all USB storage devices but the problem still occurs on my Dell Studio XPS 435T. Here's the output of the suggested debug commands, I omitted the pointer references in most cases..

type(b)
<class 'parted.geometry.Geometry'>
print b
parted.Geometry instance --
  start: 144585 end: 145407  length: 823
  device: <parted.device.Device object  at 0x7f110ec8e7d0> PedGeometry: <_ped.Geometry object at 0x7f110ec8e6d0>
print b.__geometry
**** AttributeError: 'Geometry' object has no attribute '__geometry'
up
> /usr/lib/anaconda/storage/partitioning.py(505)getBestFreeSpaceRegion()
-> free_geom = None
print disk.getFreeSpaceRegions()
[<parted.geometry.Geometry object at 0x.........>, <parted.geometry.Geometry object at 0x....., <parted.geometry.Geometry object at 0x7....>]
up
> /usr/lib/anaconda/storage/partitioning.py(726)allocatePartitions()
-> boot=_part.req_bootable)
up
> /usr/lib/anaconda/storage/partitioning.py(587)doPartitioning()
-> allocatePartitions(disks, partitions)
print disks
[<storage.devices.DiskDevice object at 0x7....>]
print map(lambda d: d.mediaPresent, disks) 
[True]
print map(lambda d: d.partedDevice, disks) 
[<parted.device.Device object at 0x7...>]
Comment 33 Chris Lumens 2009-08-11 16:16:20 EDT
This is reproducable outside of anaconda.  First, attach one of these crazy USB reader things to your computer.  For me, one of the device nodes it creates is /dev/sdc.  Then in parted, do the following:

In [1]: import parted

In [2]: xxx = parted.getDevice ("/dev/sdc")
...
DeviceException: Could not find device for path /dev/sdc

In [3]: dev = parted.getDevice("/dev/sda")

In [4]: geom1 = parted.Geometry(dev, 1, 100)

In [5]: geom2 = parted.Geometry(dev, 101, 200)

In [6]: geom1.intersect (geom2)
...
/home/clumens/src/pyparted/src/parted/geometry.pyc in intersect(self, b)
    134            and Geometry b.  Raises ArithmeticError if the regions do not
    135            intersect."""
--> 136         return Geometry(PedGeometry=self.__geometry.intersect(b.getPedGeometry()))
    137 
    138     @localeC

CreateException: Error opening /dev/sdc: No medium found


This tells me the problem has nothing to do with anaconda.  I also believe the "Error opening /dev/sdc: No medium found" message to be a red herring.  What I think is happening here is that's the message from a previous exception that was caught.  However, partedExnRaised is not getting reset to 0 (or something similar).

Now, notice that the two geometries do not intersect at all.  This means ped_geometry_intersect returns NULL so pyparted moves into the error handling code.  Since partedExnRaised must still be set, that means we treat it like an exception happened, and we raise a CreateException with the old error message.

The correct behavior here is to notice the NULL and raise an ArithmeticError.  Hopefully anaconda knows what to do with that.
Comment 34 Chris Lumens 2009-08-11 16:36:29 EDT
The following patch fixes this bug.  I wonder where else we need to do the same thing.

diff --git a/src/pydevice.c b/src/pydevice.c
index 933acd2..9bb3049 100644
--- a/src/pydevice.c
+++ b/src/pydevice.c
@@ -366,7 +366,16 @@ PyObject *py_ped_device_get(PyObject *s, PyObject *args) {
         ret = PedDevice2_ped_Device(device);
     }
     else {
-        PyErr_Format(DeviceException, "Could not find device for path %s", path);
+        if (partedExnRaised) {
+            partedExnRaised = 0;
+
+            if (!PyErr_ExceptionMatches(PartedException) &&
+                !PyErr_ExceptionMatches(PyExc_NotImplementedError))
+                PyErr_SetString(IOException, partedExnMessage);
+        }
+        else
+            PyErr_Format(DeviceException, "Could not find device for path %s", path);
+
         return NULL;
     }
Comment 35 Chris Lumens 2009-08-11 16:53:52 EDT
This will be fixed in the next build of pyparted, which will likely have to come out after F12 Alpha.  I think the above patch is likely to introduce new exceptions in anaconda which will be easy to handle (just adapt except Whatever: to exception NewWhatever:), but we shouldn't break anaconda this late in the alpha cycle.
Comment 36 David Lehman 2009-08-14 13:37:18 EDT
*** Bug 506807 has been marked as a duplicate of this bug. ***
Comment 37 Chris Lumens 2009-08-17 12:57:06 EDT
*** Bug 517882 has been marked as a duplicate of this bug. ***
Comment 38 Chris Lumens 2009-08-26 13:04:57 EDT
*** Bug 519454 has been marked as a duplicate of this bug. ***
Comment 39 John L. Chmielewski 2009-08-31 20:52:47 EDT
Not sure if this is the same problem, but when trying to install Fedora 11 64-bit from a DVD I was getting the message:

      Anoconda Crash: Error opening /dev/sdb : no medium.

Troubleshooting a bit produced:

    Partition 3 isn't aligned to cylinder boundaries.  This is still unsupported.

My system uses a SATA drive, IDE0 master DVD, IDE0 slave hard drive

The IDE HD is used for backup and was created under Fedora 10.  When I disconnected the IDE HD, Fedora 11 installed without crashing.  After the install, I reconnected the HD and was able to use it.
Comment 40 Peter Larsen 2009-09-22 14:53:19 EDT
I had a lot of crashes like this with ISW - Intel Software Raid - which seems to be considered an MD under Linux during install, but the installer doesn't notice that. So when you try to add LVM and other MD/Mapper devices, I assume the installer tries to restart the MD at somepoint but that makes it loose the core devices it depends on, and you core dump.

I only managed to get anaconda to a complete install by not doing ANY edits of LVM volumes (grub doesn't support ISW so this isn't an important bug for that reason).
Comment 41 Dmytro Taranovsky 2009-09-23 22:19:54 EDT
This bug appears to be fixed in Rawhide (I tested Fedora 12 Snapshot 3 with anaconda updated to 12.29).
Comment 42 David Cantrell 2009-09-23 22:31:22 EDT
Closing per comment #41
Comment 43 Chris Lumens 2009-11-09 09:48:38 EST
*** Bug 533218 has been marked as a duplicate of this bug. ***
Comment 44 Chris Lumens 2009-11-19 14:05:46 EST
*** Bug 539265 has been marked as a duplicate of this bug. ***