AdguardTeam/AdGuardHome · error

checking static ip: %w

Error message

checking static ip: %w

What it means

While enabling DHCP (set-config), the pre-flight check to determine whether the machine's interface IP is static failed with an unexpected error (not ErrNoStaticIPInfo). Wrapped as 'checking static ip' and returned with HTTP 500.

Source

Thrown at internal/dhcpd/http_unix.go:203

			// is installed using Snap.  That doesn't necessarily mean that the
			// machine doesn't have a static IP, so we can assume that it has
			// and go on.  If the machine doesn't, we'll get an error later.
			//
			// See https://github.com/AdguardTeam/AdGuardHome/issues/2667.
			//
			// TODO(a.garipov): I was thinking about moving this into
			// IfaceHasStaticIP, but then we wouldn't be able to log it.  Think
			// about it more.
			log.Info("error while checking static ip: %s; "+
				"assuming machine has static ip and going on", err)
			hasStaticIP = true
		} else if errors.Is(err, aghnet.ErrNoStaticIPInfo) {
			// Couldn't obtain a definitive answer.  Assume static IP an go on.
			log.Info("can't check for static ip; " +
				"assuming machine has static ip and going on")
			hasStaticIP = true
		} else {
			err = fmt.Errorf("checking static ip: %w", err)

			return http.StatusInternalServerError, err
		}
	}

	if !hasStaticIP {
		err = aghnet.IfaceSetStaticIP(ctx, s.conf.Logger, cmdCons, ifaceName)
		if err != nil {
			err = fmt.Errorf("setting static ip: %w", err)

			return http.StatusInternalServerError, err
		}
	}

	err = s.Start(ctx)
	if err != nil {
		return http.StatusBadRequest, fmt.Errorf("starting dhcp server: %w", err)
	}

View on GitHub (pinned to b41aefbe51)

Solutions

  1. Check the wrapped error for the underlying cause
  2. Run in a standard environment with network utilities available, or grant the needed privileges
  3. If running in a container/DIY setup, ensure the host network info is inspectable
Defensive patterns

Strategy: try-catch

Try / catch

if err := enableDHCP(...); err != nil {
    if errors.Is(err, aghnet.ErrNoStaticIPInfo) { /* proceed, treated as static */ }
    if strings.Contains(err.Error(), "checking static ip") { /* 500: surface env issue */ }
}

Prevention

When it happens

Trigger: Calling handleDHCPSetConfig to enable DHCP when the static-IP detection (aghnet) fails — e.g. cannot query system network configuration, unsupported platform network stack, or command execution failure.

Common situations: Running in containers or minimal environments lacking standard network config utilities; changed system permissions; OS/distro where the detection mechanism doesn't work.

Related errors


AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27). Data as JSON: /api/errors/685b2e9a2e94e0e8. Report an issue: GitHub.