Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 77953 - redhat-config-date traceback with non-specified ntp server
Summary: redhat-config-date traceback with non-specified ntp server
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-date
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Brent Fox
QA Contact:
URL:
Whiteboard:
: 81789 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-15 19:40 UTC by Myk Melez
Modified: 2008-05-01 15:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-11-15 20:22:55 UTC


Attachments (Terms of Use)

Description Myk Melez 2002-11-15 19:40:56 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021114
Phoenix/0.4

Description of problem:

redhat-config-date crashes with a traceback when /etc/ntp.conf contains a
"server" configuration line with no server specified.  This wouldn't be such a
problem except that redhat-config-date's UI makes it possible to enable ntp
without specifying a server, so it's possible to use redhat-config-date to
specify a configuration that prevents the program from restarting.

Either redhat-config-date should be modified to gracefully handle a "server"
config line without a specified server, or it should be modified to prevent
users from enabling ntp without giving the name of an ntp server, or both.


How reproducible: Always


Steps to Reproduce:

1. Run redhat-config-date.  Make sure the "Enable Network Time Protocol"
checkbox is checked, but delete the server name from the "Server:" field.
2. Click "OK" to quit redhat-config-date.
3. Run redhat-config-date again.


Actual Results:

Traceback (most recent call last):
  File "/usr/share/redhat-config-date/redhat-config-date.py", line 35, in ?
    mainWindow.mainWindow().stand_alone()
  File "/usr/share/redhat-config-date/mainWindow.py", line 176, in __init__
    self.datePage = date_gui.datePage(self.dateBackend)
  File "/usr/share/redhat-config-date/date_gui.py", line 154, in __init__
    ntpServer = mainWindow.dateBackend.getNtpServer()
  File "/usr/share/redhat-config-date/dateBackend.py", line 184, in getNtpServer
    self.ntpServer = tokens[1]
IndexError: list index out of range


Expected Results:  redhat-config-date starts up successfully.


Additional info:

Note that if you delete the server name from the "Server:" field and uncheck the
"Enable Network Time Protocol" checkbox, then the server name does not change in
/etc/ntp.config.  This is probably another bug (changes to ntp server setting
not recorded if ntp is disabled).

Comment 1 Brent Fox 2002-11-15 20:22:48 UTC
I could swear that redhat-config-date will pop up a dialog if you try to enable
NTP without specifying a server.  It does on my machine anyway.  Oh I see, I
added that code after 8.0 shipped.  redhat-config-date-1.5.4-1 in Rawhide should
fix that problem.

The problem with the server line in ntp.conf with no server specified still
exists.  I will look at that now.



Comment 2 Brent Fox 2002-11-15 20:27:55 UTC
Ok, fixed in cvs.  redhat-config-date-1.5.5-1 should appear in Rawhide in the
next few days.  Thanks for your report.

Comment 3 Brent Fox 2003-01-14 05:01:15 UTC
*** Bug 81789 has been marked as a duplicate of this bug. ***

Comment 4 Theodore C. Belding 2003-01-17 12:38:40 UTC
I found a similar problem after upgrading to the newest rawhide version of
redhat-config-date and ntp-4.1.1a-9 from Red Hat 8.0, starting with a clean
/etc/ntp.conf from that RPM. Maybe this bug should be reopened?

[root@villiers root]# rpm -q redhat-config-date
redhat-config-date-1.5.7-5
[root@villiers root]# rm /etc/ntp.conf
rm: remove regular file `/etc/ntp.conf'? y
[root@villiers root]# rpm -Uvh ntp-4.1.1a-9.i386.rpm --force
Preparing...                ########################################### [100%]
   1:ntp                    ########################################### [100%]
[root@villiers root]# redhat-config-date &
[1] 23026
[root@villiers root]# Traceback (most recent call last):
  File "/usr/share/redhat-config-date/redhat-config-date.py", line 48, in ?
    mainWindow.mainWindow().stand_alone()
  File "/usr/share/redhat-config-date/mainWindow.py", line 180, in __init__
    self.datePage = date_gui.datePage(self.dateBackend)
  File "/usr/share/redhat-config-date/date_gui.py", line 171, in __init__
    ntpServer = socket.gethostbyaddr(ntpServerIP)[0]
TypeError: gethostbyaddr() argument 1 must be string, not None

[1]+  Done                    redhat-config-date
[root@villiers root]#

Adding a server to /etc/ntp.conf fixes this problem.

Comment 5 Brent Fox 2003-01-17 16:10:05 UTC
Theodore, you are seeing a separate bug that was fixed yesterday in
redhat-config-date-1.5.7-6 (bug #82061)


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