Bug 495433 - Anaconda crash: Error opening /dev/sdb: No medium found
Summary: Anaconda crash: Error opening /dev/sdb: No medium found
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pyparted
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 496411 499523 500090 500091 504878 505038 505750 505812 506807 508604 509051 509442 515025 515057 515364 515850 516353 517882 519454 533218 539265 (view as bug list)
Depends On:
Blocks: F12Target
TreeView+ depends on / blocked
 
Reported: 2009-04-13 04:40 UTC by Dmytro Taranovsky
Modified: 2010-04-30 09:15 UTC (History)
32 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-24 02:31:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Anaconda dump file (58.46 KB, text/plain)
2009-04-13 04:40 UTC, Dmytro Taranovsky
no flags Details
Anaconda Traceback for RAID install failure (224.77 KB, text/plain)
2009-06-10 21:20 UTC, Jeffrey R. Evans
no flags Details
Anaconda error log (136.75 KB, text/plain)
2009-06-28 13:45 UTC, Rob Taft
no flags Details
Anaconda fails during instyallation (210.41 KB, text/plain)
2009-07-26 01:59 UTC, William Hart
no flags Details

Description Dmytro Taranovsky 2009-04-13 04:40:13 UTC
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-15 00:18:11 UTC
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 14:38:20 UTC
*** Bug 496411 has been marked as a duplicate of this bug. ***

Comment 3 Chris Lumens 2009-05-07 13:56:47 UTC
*** Bug 499523 has been marked as a duplicate of this bug. ***

Comment 4 Dmytro Taranovsky 2009-05-07 16:33:08 UTC
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 23:24:00 UTC
*** Bug 500090 has been marked as a duplicate of this bug. ***

Comment 6 Chris Lumens 2009-05-10 23:24:09 UTC
*** Bug 500091 has been marked as a duplicate of this bug. ***

Comment 7 Bug Zapper 2009-06-09 13:43:16 UTC
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 13:47:56 UTC
*** Bug 504878 has been marked as a duplicate of this bug. ***

Comment 9 Chris Lumens 2009-06-10 13:48:07 UTC
*** Bug 505038 has been marked as a duplicate of this bug. ***

Comment 10 Jeffrey R. Evans 2009-06-10 21:20:51 UTC
Created attachment 347297 [details]
Anaconda Traceback for RAID install failure

Comment 11 Michael St. Laurent 2009-06-11 22:06:59 UTC
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 13:43:44 UTC
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 13:45:10 UTC
Created attachment 349702 [details]
Anaconda error log

Comment 14 Chris Lumens 2009-06-29 12:17:26 UTC
*** Bug 508604 has been marked as a duplicate of this bug. ***

Comment 15 Rob Taft 2009-06-29 12:40:02 UTC
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 15:42:47 UTC
*** Bug 505812 has been marked as a duplicate of this bug. ***

Comment 17 Chris Lumens 2009-07-02 19:48:26 UTC
*** Bug 509442 has been marked as a duplicate of this bug. ***

Comment 18 Chris Lumens 2009-07-06 15:57:19 UTC
*** Bug 509051 has been marked as a duplicate of this bug. ***

Comment 19 Need Real Name 2009-07-19 21:30:44 UTC
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 17:48:25 UTC
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-26 01:59:37 UTC
Created attachment 355169 [details]
Anaconda fails during instyallation

Comment 22 Need Real Name 2009-07-26 18:04:36 UTC
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 16:26:07 UTC
*** Bug 515057 has been marked as a duplicate of this bug. ***

Comment 24 Chris Lumens 2009-08-03 15:47:26 UTC
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 09:53:28 UTC
*** Bug 515025 has been marked as a duplicate of this bug. ***

Comment 26 Andy Lindeberg 2009-08-04 14:45:29 UTC
*** Bug 515364 has been marked as a duplicate of this bug. ***

Comment 27 Chris Lumens 2009-08-10 13:52:19 UTC
*** Bug 516353 has been marked as a duplicate of this bug. ***

Comment 28 Martin Andrews 2009-08-10 14:09:12 UTC
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 14:26:18 UTC
*** Bug 505750 has been marked as a duplicate of this bug. ***

Comment 30 Chris Lumens 2009-08-10 14:28:26 UTC
*** Bug 515850 has been marked as a duplicate of this bug. ***

Comment 31 Chris Lumens 2009-08-10 16:04:08 UTC
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 18:41:31 UTC
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 20:16:20 UTC
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 20:36:29 UTC
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 20:53:52 UTC
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 17:37:18 UTC
*** Bug 506807 has been marked as a duplicate of this bug. ***

Comment 37 Chris Lumens 2009-08-17 16:57:06 UTC
*** Bug 517882 has been marked as a duplicate of this bug. ***

Comment 38 Chris Lumens 2009-08-26 17:04:57 UTC
*** Bug 519454 has been marked as a duplicate of this bug. ***

Comment 39 John L. Chmielewski 2009-09-01 00:52:47 UTC
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 18:53:19 UTC
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-24 02:19:54 UTC
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-24 02:31:22 UTC
Closing per comment #41

Comment 43 Chris Lumens 2009-11-09 14:48:38 UTC
*** Bug 533218 has been marked as a duplicate of this bug. ***

Comment 44 Chris Lumens 2009-11-19 19:05:46 UTC
*** Bug 539265 has been marked as a duplicate of this bug. ***


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