Posts by Der Olli

    Additional data point: reproducible trigger for the UDP :53 leak via a failed online check (no WireGuard)

    Setup: RPi2, LibreELEC 12.0.2 (ConnMan 1.43), WiFi only, no VPN/WireGuard, default online check settings ("one-shot", geometric interval [1, 12]).

    Symptom: after ~35 days of uptime connmand had ~1015 of 1024 FDs open, followed by "Failed to open/bind time server socket" flooding the journal and NTP no longer syncing.

    Findings:

    1. During normal operation there is no leak at all. connmand stayed at 17 FDs for 23 hours.
    2. Clean WiFi reconnects (connmanctl disconnect/connect, 3 cycles) don't leak either. FDs go 17 → 12 → 17 every time and all sockets are closed properly.
    3. A single failed online check does trigger it. I blocked outbound HTTP with

      Code
      iptables -I OUTPUT -p tcp --dport 80 ! -d 192.168.0.0/16 -j DROP

      and reconnected the WiFi. The service stays in "ready". After the first check times out (~2 min), every retry fails immediately with

      Code
      IPv4 online check to http://ipv4.connman.net/online/status.html failed: -22: Invalid argument

      Each retry leaves one more UDP socket to the DNS server (router:53) open. FDs went 17 → 24 within ~12 minutes (UDP :53 sockets 3 → 9+).

    4. The online check never recovers by itself. After removing the iptables rule it kept failing with -22 for another 7 minutes (and presumably forever, retrying at up to 144 s intervals), leaking one socket per attempt. Only restarting connman fixed it, after which the check succeeded immediately and FDs were back to 17.

    So on my system the chain is: a short internet/connman.net outage → online check stuck in -22 → endless retries → one leaked UDP :53 socket per retry → FD limit reached after a few days → NTP dead. A clean reconnect isn't enough to start it, it needs the check to actually time out.

    The ConnMan 1.44 changelog has "Fix issue with handling web context for online detection", and that release reworked the failure path in src/wispr.c / gweb. It might be related, but I haven't tested 12.2.x / 1.45 yet. The iptables rule above should be an easy way for anyone on 12.2 or 13 to check whether it still happens there.

    Workaround for now: EnableOnlineCheck = false in /storage/.config/connman_main.conf (CamelCase, [General] section), then restart connman.


    Update: still happens on LibreELEC 12.2.1 / ConnMan 1.45

    I updated to 12.2.1 (ConnMan 1.45) and repeated the same test (iptables DROP on outbound tcp:80, then WiFi reconnect). So my guess about the 1.44 changelog was wrong. The bug is still there, only the error message changed:

    Code
    21:52:58 IPv4 online check to http://ipv4.connman.net/online/status.html failed: Input/output error
    21:52:59 No valid proxy with proxy auto-configuration (PAC) URL http://wpad.fritz.box/wpad.dat for wlan0 [ wifi ] online check URL http://ipv4.connman.net/online/status.html
    21:52:59 IPv4 online check to http://ipv4.connman.net/online/status.html failed: no valid proxy
    ... (repeats at growing intervals)
    • The first check times out after ~2 min (Input/output error). After that, every retry fails immediately with no valid proxy.
    • Each retry still leaks one UDP socket to the DNS server (router:53). connmand went from 20 to 29 FDs in ~11 minutes.
    • It doesn't recover after the block is removed. I waited another 5+ minutes and it was still "ready" with no valid proxy on every retry. Restarting connman fixes it immediately.

    So in 1.45 the failure path seems to switch to WPAD/PAC proxy discovery. The PAC URL is derived from the DHCP domain (fritz.box, my AVM router doesn't provide a wpad.dat). It then never falls back to a direct request again, and every attempt leaves a resolver socket open.

    Workaround is unchanged: EnableOnlineCheck = false in /storage/.config/connman_main.conf ([General] section), then restart connman.

    Here you can see the program overview and the off-by-one error, cause the movie started at 20:15 and not at 19:15:

    If we take a look into the program info, when the channel is running it even gets more weird:

    While the time and also the end of the movie in the top right is correct, the information in the text box about the next program is wrong, cause the next show will run at 22:30 and not at 21:30. Also the start and end time at the bottom is wrong, while the relative time is correct again.

    After running okay for a while after reinstalling the whole system, the error came back after a few days and the EPG data shown within Kodi was off by one hour again. What helped, was going into the system settings and deleting the data. Maybe a restart was needed, but when the data was reloaded it was okay again.

    But today the system changed its behaviour again and it's not getting better. 😢

    Even deleting the EPG data and restarting didn't help, the off by one hour stayed. So any further idea on how to tackle down this problem would be great.

    To recap:

    I'm running LibreELEC (official): 11.0.1 (RPi2.arm) on a Raspi 3 with Tvheadend on it. All add-ons installed from the official repo, with nothing special. Kodi on screen and Tvheadend on the web interface show both the correct time and Tvheadend itself also shows correct EPG, but Kodi shows the EPG time off-by-one.

    Due to the fact, that my wife complained about the EPG problems I had to find a faster solution. I just made a complete re-install of the image and made all the same settings as last time. Currently the EPG problem is gone and connmanctl clock still tells me it would use the Timezone of Arctic/Longyearbyen. So this doesn't seem to be the root cause.

    So far the problem is solved through a complete re-install and new manual setup. Let's see how it will work in autumm, when time will be set back to MEZ. I will prepare myself and take care to have enough time to search for the problem again if it comes up.

    Thanks for the support und ideas.

    Unfortunately a restart was already made (several times) without any success (with the last restart just the update to 11.0.1 came in).

    Tvheadend shows the correct time and correct EPG data. Kodi shows the correct time, but EPG in Kodi is wrong. I know I had these problems also in the past (when I was on 9.x) but as already stated here, a reboot helped. But now after setting up 11.0.0 a few weeks ago which really worked well and without any problems this damn EPG can't be fixed.

    So any hint is welcome (except: try to reboot 😉).

    The main issue why I'm searching for this is (due to switch from MEZ to MESZ) that EPG is off-by-one within Kodi. But everything I found at the web doesn't match.

    Kodi shows the correct time at the top right corner and Tvheadend within the web interface also shows the correct time in the top right and EIT offset is set to UTC and EPG in webinterface also shows the correct times. The only wrong part is EPG data within Kodi.

    So anyone an idea how to get EPG shown correctly in Kodi when it is correct in Tvheadend?

    I'm running LibreELEC 11.0.0 on a RasPi 3.

    When entering the command "connmanctl clock" via SSH I'll get the following output:

    TimeUpdates = auto

    Timezone = Arctic/Longyearbyen

    TimezoneUpdates = auto

    Timeservers = [ de.pool.ntp.org ]

    TimeserverSynced = True

    But within Kodi I made the following settings:

    Settings / User Interface / Regional

    - Timezone region: Germany

    - Timezone: Europe/Berlin

    Settings / LibreELEC / Network / Timeserver

    - de.pool.ntp.org

    Any idea how I can get the terminal output to show the correct timezone? My search for "connmanctl clock" just brought how you can read these values, but nowhere any clue on how to set these things.