Bug 433849 (TB1fe56f53) - TB1fe56f53 NCHostsList.py:66:load:IndexError: list index out of range
Summary: TB1fe56f53 NCHostsList.py:66:load:IndexError: list index out of range
Alias: TB1fe56f53
Product: Fedora
Classification: Fedora
Component: system-config-network
Version: 8
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-02-21 18:47 UTC by Tom Horsley
Modified: 2008-04-22 22:39 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2008-04-22 22:39:08 UTC

Attachments (Terms of Use)
the dump from the system-config-network exception (157.47 KB, text/plain)
2008-02-21 18:48 UTC, Tom Horsley
no flags Details
screenshot of error popup (46.78 KB, image/png)
2008-03-28 11:28 UTC, Tom Horsley
no flags Details
system-config-network problem file (2.03 KB, text/plain)
2008-04-07 01:33 UTC, grs
no flags Details

Description Tom Horsley 2008-02-21 18:47:12 UTC
Description of problem:

If I try to run system-config-network on a Fedora 8 system with a massive
/etc/hosts file (about 3000 lines) containing lots of entries for hosts
on different subnets, it crashes on startup. If I temporarily rename
/etc/hosts, it runs with no problem.

Version-Release number of selected component (if applicable):

How reproducible:
every time

Steps to Reproduce:
1. get on a fedora 8 system with the massive hosts file
2. run system-config-network
3. boom
Actual results:


Expected results:

gui network app

Additional info:

I'll attach the crash info created by the boom.

It is also worth noting that several other machines with various versions
of rhel and fedora all work fine with the same hosts file. It appears as though
it is only fedora 8 that blows up.

Comment 1 Tom Horsley 2008-02-21 18:48:18 UTC
Created attachment 295549 [details]
the dump from the system-config-network exception

Comment 2 Harald Hoyer 2008-02-22 11:34:01 UTC
looks like the hostname is missing on one of your lines.

error: Error while parsing /etc/hosts:
Wrong Hostname on line 61

Comment 3 Jiri Moskovcak 2008-02-22 11:46:25 UTC
This problem should be fixed in rawhide.

Comment 5 Tom Horsley 2008-03-27 11:26:18 UTC
I ran system-config-network to verify that it still blows up (was 1.4.7),
then I installed system-config-network-1.5.90-1.fc8.noarch.rpm and
and ran it again, and it still blows up :-(.

The saved crash file is much smaller this time, so I'm just including it inline

Component: system-config-network
Version: 1.5.90
Summary: TB8cec5205 NC_functions.py:240:testHostname:TypeError: object of type
'NoneType' has no len()

Traceback (most recent call last):
  File "/usr/sbin/system-config-network-gui", line 166, in runit
    window = mainDialog() # pylint: disable-msg=W0612
  File "/usr/share/system-config-network/netconfpkg/gui/maindialog.py", line
296, in __init__
  File "/usr/share/system-config-network/netconfpkg/gui/maindialog.py", line
322, in load
  File "/usr/share/system-config-network/netconfpkg/gui/maindialog.py", line
338, in loadProfiles
    profilelist = getProfileList()
  File "/usr/share/system-config-network/netconfpkg/NCProfileList.py", line 657,
in getProfileList
  File "/usr/share/system-config-network/netconfpkg/NCProfileList.py", line 90,
in load
    self.loadprof(pr, profdir)
  File "/usr/share/system-config-network/netconfpkg/NCProfileList.py", line 140,
in loadprof
    prof.HostsList.load(filename = profdir + '/hosts')
  File "/usr/share/system-config-network/netconfpkg/NCHostsList.py", line 97, in
  File "/usr/share/system-config-network/netconfpkg/NCHost.py", line 47, in test
    if not self.testHostname():
  File "/usr/share/system-config-network/netconfpkg/NCHost.py", line 42, in
    return testHostname(self.Hostname)
  File "/usr/share/system-config-network/netconfpkg/NC_functions.py", line 240,
in testHostname
    if (len(hostname) - hostname.count('.')) < 256:
TypeError: object of type 'NoneType' has no len()

Local variables in innermost frame:
hostname: None

I tend to suspect the code is going all anal retentive and barfing on hostnames
that contain underscore characters (which are in theory illegal, but have
always worked anyway :-). It would probably be better to simply eliminate
the hostname tab if the hosts file is illegal rather than crashing the
whole app.

Comment 6 Harald Hoyer 2008-03-27 22:04:24 UTC
Next version, hopefully better...

Comment 7 Tom Horsley 2008-03-28 11:26:49 UTC
Better, no crash this time, but I do get a popup of wrong hostname
messages way too big to fit on my screen :-). Perhaps a scrolled text
area for the wrong name messages would be in order.

I'll attach the (partial) screenshot of the popup.

Comment 8 Tom Horsley 2008-03-28 11:28:19 UTC
Created attachment 299453 [details]
screenshot of error popup

I do't know if there were any buttons on the bottom or not :-).

Comment 9 Harald Hoyer 2008-03-28 11:34:45 UTC
rofl :-) ok... seems like your /etc/hosts is a little bit longer than the
average :-)

Comment 10 grs 2008-04-07 01:33:30 UTC
Created attachment 301454 [details]
system-config-network problem file

Comment 11 Fedora Update System 2008-04-07 14:34:29 UTC
system-config-network-1.5.5-1.fc8 has been submitted as an update for Fedora 8

Comment 12 Fedora Update System 2008-04-09 05:19:47 UTC
system-config-network-1.5.5-1.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update system-config-network'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-2995

Comment 13 Fedora Update System 2008-04-22 22:38:34 UTC
system-config-network-1.5.5-1.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

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