Public bug reported:

There appears to be a race condition during boot on Ubuntu 24.04.3 LTS
(GNU/Linux 6.14.0-1013-oracle x86_64), where [email protected] starts
before the network is fully up, resulting in intermittent WireGuard
initialization failures.

Observed behavior:

[email protected] fails on cold boots.

Manually restarting the service (systemctl restart wg-quick@wg0) after
boot succeeds.

Journal logs suggest that network-online.target has not yet been reached
when wg-quick@wg0 starts.

Environment:

Ubuntu 24.04.3 LTS (Oracle Cloud image)

Linux kernel 6.14.0-1013-oracle

WireGuard installed via apt

netfilter-persistent active (firewall rules applied at boot)

Steps to reproduce:

Create a standard WireGuard interface (wg0.conf under /etc/wireguard/).

Enable the service:

sudo systemctl enable wg-quick@wg0


Reboot the system.

Observe that wg show returns “interface not found” after boot, requiring
a manual restart.

Additional context:
A community discussion identified this as a systemd startup order race 
condition between network-online.target, firewall initialization, and WireGuard.
See discussion and diagnostics here:
👉 
https://discourse.ubuntu.com/t/suspected-race-condition-error-in-systemd-startup-order/69668

Workarounds tested:

Adding After=network-online.target and ExecStartPre dependency to the
unit file (partial success).

Introducing an artificial delay using ExecStartPre=/bin/sleep 10 (works
reliably, but not ideal).

Using a systemd override dependency or custom rc.local script to restart
wg-quick@wg0 after networking (works consistently).

These resolve the symptom but not the root cause.
A long-term fix may require adjusting default dependency ordering between 
network-online.target and [email protected] or related 
cloud-init/systemd-networkd units on Oracle Cloud images.

** Affects: ubuntu
     Importance: Undecided
         Status: New

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: systemd

** Also affects: systemd (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2128680

Title:
  Race condition in systemd startup order causes WireGuard to fail at
  boot on Ubuntu 24.04.3 (Oracle Cloud image)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/2128680/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to