Bug 433849 (TB1fe56f53)

Summary: TB1fe56f53 NCHostsList.py:66:load:IndexError: list index out of range
Product: [Fedora] Fedora Reporter: Tom Horsley <horsley1953>
Component: system-config-networkAssignee: Harald Hoyer <harald>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: jmoskovc
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 1.5.5-1.fc8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-22 22:39:08 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
the dump from the system-config-network exception
none
screenshot of error popup
none
system-config-network problem file none

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):
system-config-network-tui-1.4.7-1.fc8

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:

boom

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
system-config-network-tui-1.5.90-1.fc8.noarch.rpm
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
here:

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__
    self.load()
  File "/usr/share/system-config-network/netconfpkg/gui/maindialog.py", line
322, in load
    self.loadProfiles()
  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
    __PFList.load()
  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
load
    entry.test()
  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
testHostname
    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...
http://people.fedoraproject.org/~harald/downloads/system-config-network/1.5.91/

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.