AdguardTeam/AdGuardHome · error
creating dhcpv6 srv: %w
Error message
creating dhcpv6 srv: %w
What it means
Creating the DHCPv6 server (v6Create) failed during setServers, wrapped as 'creating dhcpv6 srv'. The v6 server is always required when constructed here, so any creation failure aborts Create.
Source
Thrown at internal/dhcpd/dhcpd.go:190
s.srv4, err = v4Create(&v4conf)
if err != nil {
if v4conf.Enabled {
return false, false, fmt.Errorf("creating dhcpv4 srv: %w", err)
}
s.conf.Logger.DebugContext(ctx, "creating dhcpv4 server", slogutil.KeyError, err)
}
v6conf := conf.Conf6
v6conf.Logger = s.conf.Logger.With("ip_version", "6")
v6conf.InterfaceName = s.conf.InterfaceName
v6conf.notify = s.onNotify
v6conf.Enabled = s.conf.Enabled && len(v6conf.RangeStart) != 0
s.srv6, err = v6Create(v6conf)
if err != nil {
return v4conf.Enabled, false, fmt.Errorf("creating dhcpv6 srv: %w", err)
}
return v4conf.Enabled, v6conf.Enabled, nil
}
// Enabled returns true when the server is enabled.
func (s *server) Enabled() (ok bool) {
return s.conf.Enabled
}
// resetLeases resets all leases in the lease database.
func (s *server) resetLeases() (err error) {
err = s.srv4.ResetLeases(nil)
if err != nil {
return err
}
if s.srv6 != nil {View on GitHub (pinned to b41aefbe51)
Solutions
- Check the wrapped error for the exact v6 creation failure
- Fix the DHCPv6 range/interface configuration
- Disable the v6 block (empty RangeStart) if v6 is not needed, noting Create still constructs the server
Defensive patterns
Strategy: validation
Validate before calling
if len(conf.Conf6.RangeStart) > 0 {
if _, err := netip.ParseAddr(string(conf.Conf6.RangeStart)); err != nil { return err }
} Try / catch
if _, err := dhcpd.Create(ctx, conf); err != nil && strings.Contains(err.Error(), "creating dhcpv6") { /* inspect wrapped cause, adjust v6 config */ } Prevention
- Verify IPv6 support and interface presence
- Validate v6 range/prefix syntax before enabling
When it happens
Trigger: Calling Create with a DHCPv6 config (RangeStart non-empty making it enabled, or construction failure regardless) — e.g. invalid v6 range, bad interface name, or RA settings rejected by v6Create.
Common situations: Enabling DHCPv6 with an invalid prefix or range; interface renamed/removed since last run; OS lacking IPv6 support.
Related errors
- creating dhcpv4 srv: %w
- bad dhcpv6 configuration: %w
- creating packet: %w
- %v is not an IPv4 %s
- gateway ip %v in the ip range: %v-%v
AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27).
Data as JSON: /api/errors/ff9748a247dd234e.
Report an issue: GitHub.