Time Sync failure when IPv6 enabled
#1
Hello all,

It seems whenever I enable IPv6 OpenElec is unable to get time sync at the next reboot.

I've confirmed I'm using IPv6 time sources (not all are) just to rule out IPv4 fallback failing but nothing seems to make a difference.
Disable IPv6 and time sync is immediately restored and also works at reboot.

Ping -6 to known v6 sites works well so its not a gateway issue.

Can someone tell me where / which the time sync service resides and the logs to confirm operation.

Problem exists on both OE v5.08 and v6.00.

An assistance appreciated.

TIA Vex
Reply
#2
Not clear on what you mean by Time sync and without understanding your system or network topology, I'll give this a whirl.

On my network ipv6 caused nothing but problems and had to be disabled on 3 different Linux distros, including Openelec. Problems frequently included hangs, loss of connectivity, and sharing issues.
I operate a number of machines, devices, on a separate subnet where sharing and connectivity between each system is extremely important. My FreeNAS box acts as the network time (NTP) server and Samba server while other machines operate as DNS and WINS servers for the subnet. Getting nearly a dozen operating systems and a variety of clients and servers to participate was daunting but it works extremely well. BTW, in Openelec Samba is configured as a server and master browser by default which required additional mods to act as a client.

Introducing ipv6 into this type of environment was a can of worms. By nature the protocol is encrypted and doesn't broadcast which was a serious liability for Kodi and the Samba server. In addition, it didn't play nice with ipv4 machines and added extra overhead to DNS resolution which caused unnecessary delays. After using Wireshark to capture this activity, I decided it was unnecessary on my local subnet. On the upstream subnet, which includes the internet gateway and clients who are prevented access to downstream machines and shares, ipv6 is enabled.

Here's an article describing some of these issues: http://www.lovemytool.com/blog/2010/01/i...greer.html

If you need ipv6 for some reason, and this is Windows issue (Win7 on) with an NTP Server, it should be easy to configure your Windows ipv6 enabled machine to act as an NTP Server, give it a fixed IP, and enter the address in Openelec settings. You may also want to review the samba.conf settings and make sure the "Workgroup" name and other network settings match.

Hope this helps
Reply
#3
Thanks for the reply but I've got no issues with IPv6 across my 25+ devices on my LAN except for Openelec on my Raspberry Pi.

OE works fine EXCEPT time at reboot not correct and showing 09:30 01 Jan 1970 when IPv6 enabled. Disable IPv6 and time is correct.

It is a little know fact the default "pool.ntp.org" only supports IPv4 and if you need IPv6 sync you must use "2.pool.ntp.org"
See here: http://www.internetsociety.org/deploy360...rvers-ntp/

I suspect the problem is OE defaults to an IPv4 only time source such as 0.pool.ntp.org even if you set alternate sources in the GUI.

The standard answer about the forums is to use "ntpdate" but this appears to be no longer available.
Reply
#4
(2015-11-21, 06:08)vex8tion Wrote: I suspect the problem is OE defaults to an IPv4 only time source such as 0.pool.ntp.org even if you set alternate sources in the GUI.

If OE is not respecting/using the configured timeservers, that would be a bug... are you sure this is the case? If so, please raise it as an issue so that it can be investigated further.

(2015-11-21, 06:08)vex8tion Wrote: It is a little know fact the default "pool.ntp.org" only supports IPv4 and if you need IPv6 sync you must use "2.pool.ntp.org"
See here: http://www.internetsociety.org/deploy360...rvers-ntp/

ntp is handled by connman.

You can configure the fallback connman timesevers by copying the default connman configuration, /etc/connman/main.conf, to /storage/.config/connman_main.conf, then edit the latter.

However, this shouldn't be necessary if the timeservers configured in the GUI are being respected.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#5
Configuring the NTP Timeservers in OE Settings seems to be working, although there are two places where you can configure NTP Timeservers which might be a bit confusing - there's what appears to be a "global" setting (Network -> NTP Servers), then there are connection-specific settings (Connections -> [select connection] -> Edit -> NTP Servers). The latter seems to include the former, with the former appearing after any connection specific timeservers that you may have set manually or been set by dhcp.

To see the timeservers that connman is using, run:
Code:
echo "CONNMAN_DEBUG=--debug" >> /run/openelec/debug/connman.conf
systemctl restart connman
journalctl --no-pager --follow | grep "ntp"
then configure your timeservers in OE Settings (global or connection) and you should see the ntp changes you make in the GUI reflected in the connman configuration (via the debug output).

The /run/openelec/debug/connman.conf file won't last across reboots.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#6
(2015-11-21, 08:34)Milhouse Wrote: If OE is not respecting/using the configured timeservers, that would be a bug... are you sure this is the case? If so, please raise it as an issue so that it can be investigated further.

ntp is handled by connman.

Excellent, thanks for the connman advice, I'm making some headway.....

A look at 09_Journal-cur.log is showing that connmand is trying IPv6 first then IPv4 but is failing on all?
It appears to be attempting to get DNS requests out before the gateway is ready?? I have IPv4 set to DHCP and IPv6 set to AUTO.

Code:
    Line 434: Jan 01 09:30:07 kodi-family connmand[263]: eth0 {update} flags 102467 <UP,RUNNING,LOWER_UP>
    Line 435: Jan 01 09:30:07 kodi-family connmand[263]: eth0 {newlink} index 2 address AB:CD:EF:AB:CD:EF mtu 1500
    Line 436: Jan 01 09:30:07 kodi-family connmand[263]: eth0 {newlink} index 2 operstate 6 <UP>
    Line 438: Jan 01 09:30:07 kodi-family connmand[263]: Skipping disconnect of carrier, network is connecting.
    Line 440: Jan 01 09:30:08 kodi-family connmand[263]: eth0 {add} route 2001:xxxx:xxxx:xxxx:: gw :: scope 0 <UNIVERSE>
    Line 446: Jan 01 09:30:09 kodi-family connmand[263]: eth0 {add} address 2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/64 label (null) family 10
    Line 447: Jan 01 09:30:09 kodi-family connmand[263]: eth0 {add} route 2001:xxxx:xxxx:xxxx::1 gw :: scope 0 <UNIVERSE>
    Line 448: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 2001:44b8:1::1 failed (101/Network is unreachable)
    Line 449: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 192.231.203.132 failed (101/Network is unreachable)
    Line 450: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 2001:df0:fe:2::4 failed (101/Network is unreachable)
    Line 451: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 192.189.54.33 failed (101/Network is unreachable)
    Line 452: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 121.0.0.42 failed (101/Network is unreachable)
    Line 453: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 54.252.161.68 failed (101/Network is unreachable)
    Line 454: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 45.114.116.62 failed (101/Network is unreachable)
    Line 455: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 2407:2e00:601:701:130:102:2:7b failed (101/Network is unreachable)
    Line 456: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 2403:4200:403:2::ff:2 failed (101/Network is unreachable)
    Line 457: Jan 01 09:30:09 kodi-family connmand[263]: Time request for server 2001:418:3ff::53 failed (101/Network is unreachable)
    Line 460: Jan 01 09:30:12 kodi-family connmand[263]: Set IPv6 host route error (Invalid argument)
    Line 462: Jan 01 09:30:12 kodi-family connmand[263]: eth0 {add} address 192.168.2.40/24 label eth0 family 2
    Line 463: Jan 01 09:30:12 kodi-family connmand[263]: eth0 {add} route 192.168.2.0 gw 0.0.0.0 scope 253 <LINK>
    Line 464: Jan 01 09:30:12 kodi-family connmand[263]: eth0 {add} route 192.168.2.254 gw 0.0.0.0 scope 253 <LINK>
    Line 465: Jan 01 09:30:12 kodi-family connmand[263]: eth0 {add} route 2001:xxxx:xxxx:xxxx::1 gw :: scope 0 <UNIVERSE>
    Line 466: Jan 01 09:30:12 kodi-family connmand[263]: eth0 {del} route 2001:xxxx:xxxx:xxxx::1 gw :: scope 0 <UNIVERSE>
    Line 467: Jan 01 09:30:12 kodi-family connmand[263]: eth0 {add} route 0.0.0.0 gw 192.168.2.254 scope 0 <UNIVERSE>

It appears the extra load created by setting up IPv6 is slowing down the creation of the network and its not ready when the first DNS requests are sent.
If you wait long enough for the next automatic time update, sync will proceed correctly.

The timing must be very fine because if I manually assign IPv4 but leave IPv6 at AUTO time sync will be successful at boot.
I do have the "Wait for Network" set within the OpenElec settings set for 30 secs.

Is there a way to force a connman time sync manually?
Reply
#7
(2015-11-21, 09:37)vex8tion Wrote: Is there a way to force a connman time sync manually?

Not that I'm aware of. Connman syncs every 17 minutes and 4 seconds (1024 second interval) - this polling interval is hard-coded in the source code ("10" == 2^10 => 1024).

I'm not a network expert, even less so with IPv6 - if there is a problem with connman and IPv6 I'd suggest opening an issue on OpenELEC.tv github as it might be a configuration issue, or an upstream connman issue.

You could also try the latest testbuild as this includes connman 1.30, updated from connman 1.23 in OpenELEC 6.0 (1.23...1.30 changelog - many changes, several of which relate to IPv6, didn't check them all - too many!)
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply

Logout Mark Read Team Forum Stats Members Help
Time Sync failure when IPv6 enabled0