Bug 77953 - redhat-config-date traceback with non-specified ntp server
redhat-config-date traceback with non-specified ntp server
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-date (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Brent Fox
:
: 81789 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-15 14:40 EST by Myk Melez
Modified: 2008-05-01 11:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-11-15 15:22:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Myk Melez 2002-11-15 14:40:56 EST
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 15:22:48 EST
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 15:27:55 EST
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 00:01:15 EST
*** Bug 81789 has been marked as a duplicate of this bug. ***
Comment 4 Theodore C. Belding 2003-01-17 07:38:40 EST
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 11:10:05 EST
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.