tailscale/tailscale · error
connecting to system bus: %w
Error message
connecting to system bus: %w
What it means
nmManager.SetDNS retries trySet every 10ms until reconfigTimeout; each trySet starts with dbus.SystemBus() to reach NetworkManager. This error means the D-Bus system bus connection itself failed: no system bus daemon running, the socket path wrong, or access denied. The wrapped error from go.dbus carries the underlying cause.
Source
Thrown at net/dns/nm.go:82
// configured before the DNS manager was invoked, but it might
// take a little time for the netlink notifications to propagate
// up. So, keep retrying for the duration of the reconfigTimeout.
var err error
for ctx.Err() == nil {
err = m.trySet(ctx, config)
if err == nil {
break
}
time.Sleep(10 * time.Millisecond)
}
return err
}
func (m *nmManager) trySet(ctx context.Context, config OSConfig) error {
conn, err := dbus.SystemBus()
if err != nil {
return fmt.Errorf("connecting to system bus: %w", err)
}
// This is how we get at the DNS settings:
//
// org.freedesktop.NetworkManager
// |
// [GetDeviceByIpIface]
// |
// v
// org.freedesktop.NetworkManager.Device <--------\
// (describes a network interface) |
// | |
// [GetAppliedConnection] [Reapply]
// | |
// v |
// org.freedesktop.NetworkManager.Connection |
// (connection settings) ------/
// contains {dns, dns-priority, dns-search}View on GitHub (pinned to 6e0912f979)
Solutions
- Start and enable the bus and NM: `systemctl enable --now dbus NetworkManager`.
- Check the socket: `ls -l /run/dbus/system_bus_socket` and `busctl --system` to confirm connectivity.
- Inspect DBUS_SYSTEM_BUS_ADDRESS in the tailscaled environment and unset it if wrong.
- If D-Bus truly cannot run on this host, select a different DNS manager (e.g. direct resolv.conf) instead of the NetworkManager one.
Defensive patterns
Strategy: retry
Validate before calling
// Probe the system bus before depending on the NetworkManager manager
conn, err := dbus.SystemBus()
if err != nil {
return nil, fmt.Errorf("system dbus unavailable, cannot use NetworkManager DNS: %w", err)
}
defer conn.Close() Try / catch
Retry SetDNS with backoff — dbus availability at boot is ordering-dependent, and SetDNS's internal loop already retries until reconfigTimeout; persistent failure means an environment problem, so surface 'start dbus' to the operator.
Prevention
- Order unit startup: dbus.service before tailscaled (After=dbus.service).
- Keep dbus and NetworkManager enabled on hosts using this manager.
- Verify /run/dbus/system_bus_socket exists in the service's mount namespace (containers).
When it happens
Trigger: trySet calls dbus.SystemBus() and it returns an error: /run/dbus/system_bus_socket missing, dbus-daemon not running, DBUS_SYSTEM_BUS_ADDRESS pointing somewhere invalid, or the process lacks permission to connect to the socket.
Common situations: Minimal containers or chroots without D-Bus; dbus.service failed or masked while NetworkManager appears installed; tailscaled started before dbus at boot; DBUS_SYSTEM_BUS_ADDRESS set incorrectly in the unit Environment.
Related errors
- checking NetworkManager version: %v
- getDeviceByIpIface: %w
- getAppliedConnection: %w
- reapply: %w
- unexpected NM config type %T
AI-assisted analysis of tailscale/tailscale@6e0912f979 (2026-08-18).
Data as JSON: /api/errors/f00a2fb1549c9c15.
Report an issue: GitHub.