Bug 243121

Summary: text mode upgrade crashes with IndexError: string index out of range in upgrade_bootloader_text.py
Product: [Fedora] Fedora Reporter: Alexander Woick <alex>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED DUPLICATE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 7   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-07 14:09:44 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
anaconda dump none

Description Alexander Woick 2007-06-07 13:13:27 UTC
Description of problem:
When doing a text mode upgrade of fc5 to f7, anaconda crashes with this error:

Traceback (most recent call first):
  File "/usr/lib/anaconda/textw/upgrade_bootloader_text.py", line 46, in
_ideToLibata
    if l.strip()[0] == "#":
  File "/usr/lib/anaconda/textw/upgrade_bootloader_text.py", line 58, in __call__
    newToLibata = self._ideToLibata(anaconda.rootPath)
  File "/usr/lib/anaconda/text.py", line 582, in run
    rc = win(self.screen, instance)
  File "/usr/bin/anaconda", line 955, in <module>
    anaconda.intf.run(anaconda)
IndexError: string index out of range


How reproducible:
- have a Fedora Core 5 system (probably fine with any upgradeable system with
kernel 2.6)
- have an empty line in /etc/modprobe.conf
- perform the upgrade to f7 in text mode

Steps to Reproduce:
1. have a Fedora Core 5 system (probably fine with any upgradeable system with
kernel 2.6) to upgrade
2. put an empty line into /etc/modprobe.conf of the original system
2. start Fedora 7 upgrade in text mode (graphical mode runs fine)
3. when anaconda comes to the bootloader configuration/upgrade, it crashes.
4. if you remove all empty lines from /etc/modprobe.conf, the installation runs
fine.

Actual results:
The above trace appears and the installation aborts.

Expected results:
installation continues.

Additional info:
After reviewing the offending line in
/usr/lib/anaconda/textw/upgrade_bootloader_text.py, it seems to me that this
part scans /etc/modprobe.conf and tries to skip commented lines. But empty lines
are not handled. Empty lines have no character at index 0, so the function traps.

Suggested fix:
Handle empty lines in the _ideToLibata function of
/usr/lib/anaconda/textw/upgrade_bootloader_text.py. I don't know python, so I
cannot tell how such a line may look like.

Comment 1 Alexander Woick 2007-06-07 13:13:27 UTC
Created attachment 156459 [details]
anaconda dump

Comment 2 Chris Lumens 2007-06-07 14:09:44 UTC

*** This bug has been marked as a duplicate of 241991 ***