Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 433849 - (TB1fe56f53) TB1fe56f53 NCHostsList.py:66:load:IndexError: list index out of range
TB1fe56f53 NCHostsList.py:66:load:IndexError: list index out of range
Product: Fedora
Classification: Fedora
Component: system-config-network (Show other bugs)
i386 Linux
low Severity low
: ---
: ---
Assigned To: Harald Hoyer
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-02-21 13:47 EST by Tom Horsley
Modified: 2008-04-22 18:39 EDT (History)
1 user (show)

See Also:
Fixed In Version: 1.5.5-1.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-22 18:39:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Tom Horsley 2008-02-21 13:47:12 EST
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 13:48:18 EST
Created attachment 295549 [details]
the dump from the system-config-network exception
Comment 2 Harald Hoyer 2008-02-22 06:34:01 EST
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 06:46:25 EST
This problem should be fixed in rawhide.
Comment 5 Tom Horsley 2008-03-27 07:26:18 EDT
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 18:04:24 EDT
Next version, hopefully better...
Comment 7 Tom Horsley 2008-03-28 07:26:49 EDT
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 07:28:19 EDT
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 07:34:45 EDT
rofl :-) ok... seems like your /etc/hosts is a little bit longer than the
average :-)
Comment 10 grs 2008-04-06 21:33:30 EDT
Created attachment 301454 [details]
system-config-network problem file
Comment 11 Fedora Update System 2008-04-07 10:34:29 EDT
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 01:19:47 EDT
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 18:38:34 EDT
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.