ntp doesn't support proxy

Bug #236719 reported by Lionel Dricot
4
Affects Status Importance Assigned to Milestone
ntp (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: ntp

if you are behind a proxy and choose to automatically configure the time in the gnome applet :

1) It will not works because NTP assume a direct connection.
2) It will not warn you or tell you that it doesn't work. You will simply discover it when you will see a time shift.

When configured with the gnome applet, ntp should automatically acquires the proxy configuration of Gnome. It should also warn you if it cannot connect to a ntp server for whatever reason.

Revision history for this message
Thomas (thomas-sprinkmeier) wrote :

I'm not sure I understand the problem you're reporting.

I assume you are behind a firewall and use a proxy for web access (HTTP, HTTPS, FTP etc).

NTP cannot use a web proxy, but it works just fine behind a firewall provided the firewall allows UDP packets to leave and NAT's the replies.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

The problem, as an average user, is the following :

"My GNOME clock is out of sync altough it is marked as using NTP and all seems to be working fine because no error is displayed"

Because I'm not completely an average user, I can guess that the problem is that I'm behind a web proxy. So, I see two ways of solving this bug :

1) Making NTP capable of using a web proxy + use of the gnome configurer proxy.

2) When NTP is not working (for whatever reason), have some feedback that tells you that NTP is not working.

For information, the same laptop use NTP with Windows XP and it works. Because the hardware clock is buggy (approximately 15minutes out of sync every day), I have to reboot under Windows only to adjust the clock !

Does it explain you better the problem ?

Revision history for this message
Thomas (thomas-sprinkmeier) wrote :

I suspect the problem is your drift, not your proxy/firewall/gateway.

NTP tries to not only fix your clock offset, but also your clock drift. It has limits, however, and if your drift is too bad it just gives up after a while. You might be lucky to find a message about it in /var/log/messages, but as you've pointed out it's not exactly user friendly.

Windows probably use SNTP (Simple-NTP (network time protocol)) which periodically sends a single packet, guesstimats the time offset and simply steps the clock if necessary. Usually this gives a much worse result than NTP, but for a badly drifting clock like yours this simple approach actually works better.

The ntpdate program (from the ntpdate package) can step your clock for you:

$ sudo ntpdate ntp.ubuntu.com

run this periodically (as a CRON job perhaps) and you should have a 'working' time sync:

$ sudo crontab -e

(an editor starts, add the line following line then save and exit):
17 * * * * ntpdate ntp.ubuntu.com

(check)

$ sudo crontab -l
# m h dom mon dow command
17 * * * * ntpdate ntp.ubuntu.com

Stepping the time like this is probably not doing much for the rest of your system, especially if you're stepping time backwards.
Various programs use things like file times to figure out what is going on, and having time leap around is likely to confuse them badly (e.g. "make" won't know what's out of date).
Stepping time forward can be just as bad, CRON jobs can get missed...

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

ploum@nout:~$ sudo ntpdate ntp.ubuntu.com
[sudo] password for ploum:
14 Jul 10:30:00 ntpdate[9562]: no server suitable for synchronization found

But the proxy is well configured because "ssh ntp.ubuntu.com" send me the key of the machine and asks me correctly for a password. I don't understand.

(For information, I've mesured, approximately, a slowing shift of one minute per hour on my clock computer, which means that it count 59 minutes for 60 real minutes)

Revision history for this message
Thomas (thomas-sprinkmeier) wrote :

try one of the NTP pool servers: http://www.pool.ntp.org/
Your ISP should have an NTP server too, that's probably the best one to sync on as it's closest.

also try ntptrace:

$ ntptrace 1.au.pool.ntp.org
1.au.pool.ntp.org: stratum 2, offset -0.000370, synch distance 0.028278

SSH uses TCP (but no proxy http://en.wikipedia.org/wiki/Proxy_server), so if that's getting through but NTP (which uses UDP) does not then it might be a configuration problem with your gateway.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

ntptrace replies with a timeout. So UDP is bloqued. (but how does it work on Windows). How can we see which ntp server Windows XP uses ?

Revision history for this message
Thomas (thomas-sprinkmeier) wrote :

Might be a firewall on the Linux system then.

This is wandering away from the original bug.
I think it's fair to make the bug 'invalid' as NTP does not use a proxy. A usability bug "NTP gives no indication of its status" might be more appropriate.
I'll have a look at https://help.ubuntu.com/community/UbuntuTime to see if I can add a few things.

I'm be happy to help diagnose but it might be better if we do it off-list.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

I agree completely. I will report an usability bug against Gnome clock for this.

Changed in ntp:
status: New → Invalid
Revision history for this message
bortis (bortis) wrote :

@Lionel Dricot: If you not know the address of your local ntp server in a Windows NT, Active Directory controlled network, you can try to typ the command "net time" in the windows command promt. If one working NTP Server exists in your network, the address should show up.

Afther that, add the this address to your /etc/ntp.conf.

If that doesn't work you are out of luck, I think.

Regards

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.