openwrt / openwrt/packages

watchcat: interface resolution races netifd at boot, leaving the daemon permanently misconfigured

Open
#30,463 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug release/25.12
Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Package Name

watchcat

Maintainer

@danielfdickinson, @dhrm1k

OpenWrt Version

OpenWrt 25.12.5 r33051-f5dae5ece4

OpenWrt Target/Subtarget

mediatek/filogic

Steps to Reproduce
  1. Configure a restart_iface instance with interface='@wan' (DHCP WAN on eth0).
  2. Reboot the device.
  3. Check the log: logread | grep watchcat
Actual Behaviour

Device: OpenWrt One. Package version: watchcat-1-r25.

Observed:

daemon.warn watchcat[4026]: Could not resolve interface "@wan" for pinging.
daemon.warn watchcat[4026]: Could not resolve interface "@wan" for restart.

Restarting the service by hand once the system is up resolves cleanly and produces no warning. ubus call network.interface.wan status reports "l3_device": "eth0" at that point.

watchcat_resolve_ping_iface and watchcat_resolve_restart_iface are called once, at daemon startup. START=97 runs after /etc/init.d/network, but that script returns as soon as netifd is launched — not when interfaces are attached. With a DHCP WAN the lease arrives later, so network_get_device fails and the daemon keeps the failed result for its whole lifetime. restart_iface stays empty, so the watchdog can detect an outage but can no longer repair it.

With the historical interface='wan' form the same race is silent and far worse: the caller falls back to ping_iface="$iface", every ping runs as ping -I wan, busybox rejects it, and the daemon restarts the WAN every 15 minutes indefinitely. This ran for 8 days on our device — 735 interface restarts, each reloading both radios — before we traced it. No warning is logged in that path.

service_triggers() only declares procd_add_reload_trigger "watchcat", which fires on UCI config changes, never on network events. An interface trigger would make the daemon re-resolve when the monitored network comes up.

Confirmation Checklist

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with watchcat_resolve_ping_iface, watchcat_resolve_restart_iface, and service_triggers(), then inspect how START=97 and network_get_device behave during DHCP startup. Ensure resolution is retried when the monitored network becomes available and that failed resolution does not leave an invalid fallback. Verify by rebooting with restart_iface set to @wan and checking logread plus subsequent ping and restart behavior.

Written by the indexing model from the issue text.

Assessment

Domain
networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.