I have a wireguard interface that is defined in UCI, which normally works well. Sometimes following a device reboot, wireguard will not be brought up at all. When I then try to bring up the interface manually using "ifup wg0", the wireguard.sh setup code is not even called. Rebooting the router beings back normal wireguard functionality.
I have seen this on 21.02 (ramips & ath79), 21.02-rc3 (ramips), and 19.07.3 (ar71xx).
It happens most frequently following an automatic 3am reboot. It is difficult to reproduce on demand in the middle of the day. I can cause it to happen in about 20% of 3am reboots by using a domain name for the wireguard peer which is a CNAME pointing to a CNAME pointing to a CNAME pointing to an A record.
@vgaetera thinks there might be a race condition in netifd, which is why I have tagged this report.
I have several routers in this state presently and can do any requested testing on them.