Posts by Doemela

    Doemela I use the script from https://github.com/pia-foss/manual-connections to manually generate wireguard config files using my PIA dedicated token, is it a chore to build support for it into your add-on?

    The integration of PIA into WireGuard VPN Manager is indeed based on that exact script https://github.com/pia-foss/manua…d_with_token.sh . In the add-on settings under 'VPN provider', you enter your username and password. The add-on after selecting countries/regions then automatically generates the WireGuard files in ~/.config/wireguard. https://github.com/BrodjagaRatnik…tings-Explained

    Please note that it refreshes the standard session token only when it connects or updates in add-on. The update interval can be set in the hours settings. If you are not connected, it will refresh every hour (or whatever interval you choose). You can use it this way for now.

    However, it does not officially support the 'PIA dedicated token' feature yet. In the meantime, I will look into adding a PIA authentication option specifically for dedicated tokens. I have looked into the script logic for the 'PIA dedicated token' and noticed it bypasses the standard user/password auth by using the token as a basic auth username. Since my add-on manages many other platform-specific tasks (like ConnMan routing and firewalls for LibreELEC), I will need to design a specific settings layout to let you input your dedicated IP, hostname, and token safely. I will look into adding this dedicated auth option in a future update!

    Salute.

    Update: Wi-Fi Specific Leak Profile & Optimized Service Mitigation.

    Through further targeted testing with my custom monitor scripts, I discovered that this tracking leak is entirely Wi-Fi specific. When cycling the VPN over a hardwired Ethernet connection, the file descriptor counts remain completely flat and stable (with Service Mitigation). However, the moment the system switches to a wireless interface, disconnecting the WireGuard tunnel causes an immediate, massive spike in connmand file descriptors. Here is the live capture of the anomaly during a wireless test cycle:

    1. VPN Connected (Baseline Stable):

    Code
    === Network & VPN Status ===
    WireGuard (wg): CONNECTED
    === ConnMan Daemon Resources ===
    VPN Daemon (connman-vpnd): 10
    Main Daemon (connmand):    19

    2. Immediately After Disconnecting VPN (The Wi-Fi Leak Trigger):

    Code
    === Network & VPN Status ===
    WireGuard (wg): DISCONNECTED
    === ConnMan Daemon Resources ===
    VPN Daemon (connman-vpnd): 10
    Main Daemon (connmand):    91   <-- Leaked 72 FDs after ~15 minutes on a single disconnect!

    It appears that when operating over Wi-Fi, ConnMan's underlying link/route scanning infrastructure fails to execute standard close() calls on its routing sockets when the virtual tunnel interface drops out-of-band. To prevent this aggressive accumulation from hitting the hard kernel wall of 1024 (which inevitably drops all system IP routes and kills SSH access), I have integrated a safe, proactive containment mechanism into my management addon.

    By applying a custom systemd override template, we can restrict the process file allocation limits so the service safely self-reclaims without freezing the host system, while also ensuring aggressive logging loops don't choke the storage layer:

    Code
    [Service]
    ExecStart=
    ExecStart=/usr/sbin/connmand -n --config=/storage/.config/connman_main.conf --nodnsproxy
    LimitNOFILE=4096
    LogRateLimitIntervalSec=0

    connman_main.conf:

    Code
    [General]
    onlinecheckmode = none
    onlinecheckurl = 
    onlinecheckinterval = 0
    onlinecheckipv4url = 
    onlinecheckipv6url =
    • --nodnsproxy: Completely bypasses ConnMan's corrupted DNS loop architecture.
    • LimitNOFILE=4096: Explicitly raises the system descriptor ceiling from the default 1024 up to 4096. This provides a massive resource cushion to absorb slow, creeping wireless handle transitions, keeping the core operating system and active SSH terminal sessions completely stable for long-term use.
    • LogRateLimitIntervalSec=0: Prevents systemd from locking out or throttling ConnMan diagnostic events during a rapid interface or connection shift.
    • OnlineCheckMode=none: Completely disables ConnMan’s periodic internet accessibility probing subsystem, which prevents background testing loops when network gateways drop routing tables.
    • OnlineCheckIPv4URL= & OnlineCheckIPv6URL=: Clears the default target endpoints. This blocks ConnMan from attempting out-of-band WPAD/PAC proxy lookups, resolving infinite retry loops triggered by routers like the Fritz!Box.
    • OnlineCheckInterval=0: Sets the validation retry timer to zero, completely turning off background testing intervals.

    Hopefully, this extra data point regarding the wireless-specific behavior helps the upstream maintainers narrow down exactly which wireless state tracking hooks or netlink socket callbacks are missing their proper garbage collection routines.

    Salute!

    I had the same problem and made/added to my /storage/.config/autostart.sh at the top:

    Bash
    #!/bin/sh
    ip link set dev wlan0 down
    ip link set dev wlan0 address 00:11:22:33:44:55
    ip link set dev wlan0 up
    systemctl restart connman

    Make the script executable, clean out the broken profiles and reboot:

    Shell session
    chmod +x /storage/.config/autostart.sh
    rm -rf /storage/.cache/connman/wifi_*
    reboot

    This fixed the asking for wifi password after every reboot.

    RapidRapunzel This wireguard config will do the trick:

    I am busy integrating Mullvad into version 1.5.3. You can try out this beta version in the meantime. https://github.com/BrodjagaRatnik….5.3~Beta.2.zip

    To post logs to this forum, copy and paste the following into SSH:

    Shell session
    grep -i "service.wireguard.manager" /storage/.kodi/temp/kodi.log | pastebinit

    And post that URL here.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem
    4. Generate a log URL (do not post/upload logs to the forum)

    use "Settings > LibreELEC > System > Paste system logs" or run "pastekodi" over SSH, then post the URL link

    Salute.

    Hello Brun0 ,

    Because you are running on a non-Raspberry Pi wireless setup, your hardware requires slightly more time to cleanly tear down existing connection profiles when switching locations. Because the connection processing occasionally takes slightly longer than the hard-coded limits of the previous build, it caused a timeout crash. This left a stale .lock state file behind, which blocked your TV channels (PVR) and locked down your local routing parameters (disrupting SSH/Samba access).

    Please install the updated script modules https://github.com/BrodjagaRatnik…-1.5.2~RC.3.zip and let me know if everything is running smoothly!

    Best regards, Doemela.


    Maybe try the latest version 1.5.2~rc

    Reddirt You beat moi :P you can also test https://github.com/BrodjagaRatnik…-1.5.2~RC.3.zip specially on that I7.

    v1.5.2 (2026-08-0?)
    - Fixed: Resolved an exit status 22 argument error on Wi-Fi profile swaps.
    - Fixed: Prevented system lockouts and file tracking freezes on slower hardware tiers.
    - Optimized: Maintained local subnets and gateway paths to guarantee uninterrupted SSH/Samba access.
    - Fixed: Resolved an exception routing conflict where upstream HTTP 429 server blocks returned empty token responses.
    - Fixed: Resolved an issue causing the exception tree to misinterpret events and erroneously trigger the 401 alert window.
    - Optimized: Implemented dynamic file state inspection within the token verification routine to accurately isolate locks.
    - Optimized: Prioritized system rate-limiting locks over authentication validation screens during active profile swaps.

    Salute.

    Thank you so much for testing the beta build and sharing the logs!

    I can see from the entries that the connection teardown and the dynamic DNS recycling are now working flawlessly. The stream links (pvr.iptvsimple) are resolving instantly and cleanly right after the tunnel closes without hitting any deadlocks.

    The fix is officially successful! Thank you again for your time, and have a wonderful weekend as well!

    Brun0

    I have built a specific test build to automate this fix directly inside the add-on logic. This will proactively catch and repair the ConnMan DNS deadlock on your system during execution.

    You can download and install the update from here: service.wireguard.manager-1.5.1~beta.zip

    What this update does:
    Every time a VPN disconnection occurs, the manager now performs an internal DNS deadlock. If it detects that ConnMan has left your network in an unresolvable state (triggering the ifconfig.co error), it automatically triggers a fallback routine to flush the stale cache and force ConnMan to dynamically pull your local router's original DNS settings via DHCP. If a static IP is set, the script only clears the manual DNS block, causing ConnMan to immediately fall back to the manual DNS entered in LibreELEC, without affecting the static IP configuration.

    Please install this beta build, test your add-on switching workflow, and let me know if your TV channels and the pastebinit log uploader function correctly without any manual terminal commands.

    Salute.

    The Could not resolve host: ifconfig.co error confirms that your system is experiencing a DNS deadlock after switching add-ons, meaning LibreELEC's network manager (ConnMan) is failing to restore your local router's DNS servers.

    Since this issue does not occur for other users, it is likely caused by a local configuration conflict or a static IP setup on your device.

    To fix this and get your TV channels back immediately without rebooting, you can manually force a working DNS server via SSH using ConnMan. Please follow these steps:

    1. Connect to your LibreELEC device via SSH.

    2. Run the following command to find your active network service ID:

    Shell session
      connmanctl services

    (Look for the line starting with *AO or *AR which represents your active Ethernet or Wi-Fi connection. Copy the long ID string at the end of that line, it will look like ethernet_b0d5cc... or wifi_2ccf67...)

    3. Run this command to force assign public DNS servers to your connection (replace <your_service_id> with the ID you just copied):

    Shell session
      connmanctl config <your_service_id> --nameservers 1.1.1.1,8.8.8.8

    Once executed, your internet connectivity, TV channels, and the pastebinit log uploader should work instantly.

    A quick question to help prevent this from happening again: Do you have a manual/static IP address configured in your LibreELEC network settings, or do you use any other VPN/IPTV management add-ons on this system?

    I see in your rollable-sherice log:
    requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://k7.ftven.fr/videos/006194e…a9-153d999c59ae?country_code=NL&capabilities=drm&os=androidtv&diffusion_mode=tunnel_first&offline=false

    You either not connected to a French VPN server or the video plugin uses cache and NL is in the cache (so remove cache from that addon). For mapping video plugin -> VPN-country you do not have to use it you can also do:

    1. Connect to the desired VPN country server.
    2. Start/stream the addon.

    🗺 4. VPN Mapping (The Priority System)

    This automated tool pairs specific VPN locations directly to individual Kodi video add-ons. If you do not pair your chosen add-on app to a specific server location no connection will be made.

    Salute.

    Please i need help,

    I configured my config file (Proton VPN), but when I import and start the service manager, I get this error message: "error <general>: service.wireguard.manager v1.4.9: VPN Connector: VPN connection, handshake failed. Handshake failed. Refused, rate-limited, or unreachable."

    I can't seem to find where the problem is.

    ;(

    Provide the wireguard config file(s) please no privatekey. Did you read https://github.com/BrodjagaRatnik…via-Custom-Mode

    Set kodi in debug logging and copy/paste this in ssh:

    Shell session
    grep -i "service.wireguard.manager" /storage/.kodi/temp/kodi.log | pastebinit

    Or provide a full debug log.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem
    4. Generate a log URL (do not post/upload logs to the forum)

    use "Settings > LibreELEC > System > Paste system logs" or run "pastekodi" over SSH, then post the URL link

    The proposed Kodi pull request (PR) will not fix the underlying issue or change the standard for good python coding; it merely changes how Kodi handles and reports the developer's errors. The PR modifies CPythonInvoker to forcefully run a garbage collection cycle and clear module dictionaries before tearing down the Python sub-interpreter. While this prevents Kodi from crashing (segmentation fault) or spamming logs during a profile switch, it is an application-level safety net. It does not absolve the addon developer from writing clean code.

    The PR cleans up the leaked memory only when the execution is completely finished or when switching profiles. If an addon leaks xbmc.Monitor or xbmc.Player objects during its normal runtime execution (e.g., repeatedly restarting a background service or script without destroying old instances), those objects will still consume RAM and leak resources until the entire interpreter environment is destroyed.

    In short, the PR fixes Kodi's stability when handling badly written addons, but good conduct Python coding still dictates that developers must explicitly close monitors, stop players, and avoid circular references in threads to prevent active runtime memory leaks.

    Salute.

    Think we haxored it ;) Following up on my previous report regarding the severe file descriptor leak in connmand when using WireGuard (wg0) tunnels, my team and testers have successfully isolated the root causes and implemented a elegant solution, zero-leak workaround. It turns out there were two separate upstream tracking bugs inside ConnMan's older network cache layer that trigger when an out-of-band virtual interface alters default routing metrics.

    • ConnMan's internal DNS proxy layer loops indefinitely trying to process client sockets during interface state changes, leaking 10 FDs every minute.
    • ConnMan constantly polls ipv4.connman.net to verify global internet status. When WireGuard routes shift mid-flight, these TCP connections get permanently orphaned in a CLOSE_WAIT state, trickling in an additional 2–3 leaks per minute on older environments (like LibreELEC 12).

    By completely disabling ConnMan's internal DNS proxy and turning off its aggressive global connectivity tracking, the daemon relies on native Linux routing. This drops the file descriptor load down to baseline and completely flatlines the leak. Here is the exact setup we deployed via SSH to fix the issue:

    Open or create /storage/.config/connman_main.conf and ensure the online check is completely disabled:

    Code
    [General]
    EnableOnlineCheck = false

    To apply your changes and restart ConnMan via SSH, use this command:

    Shell session
    systemctl daemon-reload && systemctl restart connman

    Create the service drop-in override directory and force ConnMan to start with the --nodnsproxy flag active:

    Shell session
    mkdir -p /storage/.config/system.d/connman.service.d
    cat << 'EOF' > /storage/.config/system.d/connman.service.d/override.conf
    [Service]
    ExecStart=
    ExecStart=/usr/sbin/connmand -nr --config=/storage/.config/connman_main.conf --nodnsproxy
    EOF

    Reload and Apply in ssh:

    Shell session
    systemctl daemon-reload
    systemctl restart connman

    Verification:

    Shell session
    watch -n 1 "echo -n 'VPN Daemon (connman-vpnd): '; ls -l /proc/\$(pidof connman-vpnd)/fd 2>/dev/null | wc -l; echo -n 'Main Daemon (connmand):    '; ls -l /proc/\$(pidof connmand)/fd 2>/dev/null | wc -l"

    LibreELEC 13 (Generic): File descriptors stay perfectly locked and flat at 30 FDs. LibreELEC 12 (Pi4 / Pi5): File descriptors stay perfectly locked and flat at 22 FDs without a single trickle over time. The system is now completely stable. I have forwarded these exact details to the ConnMan upstream developer mailing list ([email protected]) so they can investigate adding proper close() descriptors inside the rtnl or proxy source arrays for future releases.

    Salute.

    Thank you for checking the patch history. I have followed your advice and officially submitted a detailed bug report upstream to the ConnMan developers mailing list. For anyone else running into this freeze or loop while using WireGuard configurations, here is a summary of what I have discovered and how I have managed to mitigate the issue in the meantime:

    When an out-of-band WireGuard interface changes the system routing table, ConnMan's internal DNS proxy subsystem gets caught in a loop. It repeatedly spawns client sockets targeting the gateway (port 53), but fails to run a close() system call on them. These orphaned file descriptors accumulate rapidly until they hit the Linux process limit of 1024. Once hit, all network resolutions fail and the system freezes. On LibreELEC 13 (Generic), the socket leak is completely tied to the DNS proxy loop. On LibreELEC 12.2.1 (Pi4, PI5), an older tracking bug remains active alongside the DNS loop, trickling in an additional 2 unclosed anonymous sockets per minute during active VPN cycles.

    Bypassed ConnMan's broken DNS proxy layer by applying a custom systemd runtime override flag. This forces the OS to handle DNS calls natively without letting ConnMan drop handles. If your system is freezing due to this leak, you can apply this workaround via SSH:

    Bash
    mkdir -p /storage/.config/system.d/connman.service.d
    cat << 'EOF' > /storage/.config/system.d/connman.service.d/override.conf
    [Service]
    ExecStart=
    ExecStart=/usr/sbin/connmand -nr --config=/storage/.config/connman_main.conf --nodnsproxy
    EOF
    systemctl daemon-reload
    systemctl restart connman

    On LE 13 the file descriptor count stays completely flat and stable (locked around 30 FDs), entirely fixing the crash. On LE 12 the massive socket storm is blocked, slowing the leak down drastically to just 2 FDs per minute, giving the machine significantly longer uptime before needing a network service restart. Hopefully, the upstream developers can pinpoint exactly where the missing close() descriptors are in the rtnl or proxy source arrays.


    Salute.