{"record":{"id":"ff9748a247dd234e","repo":"AdguardTeam/AdGuardHome","slug":"creating-dhcpv6-srv-w","errorCode":null,"errorMessage":"creating dhcpv6 srv: %w","messagePattern":"creating dhcpv6 srv: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/dhcpd/dhcpd.go","lineNumber":190,"sourceCode":"\n\ts.srv4, err = v4Create(&v4conf)\n\tif err != nil {\n\t\tif v4conf.Enabled {\n\t\t\treturn false, false, fmt.Errorf(\"creating dhcpv4 srv: %w\", err)\n\t\t}\n\n\t\ts.conf.Logger.DebugContext(ctx, \"creating dhcpv4 server\", slogutil.KeyError, err)\n\t}\n\n\tv6conf := conf.Conf6\n\tv6conf.Logger = s.conf.Logger.With(\"ip_version\", \"6\")\n\tv6conf.InterfaceName = s.conf.InterfaceName\n\tv6conf.notify = s.onNotify\n\tv6conf.Enabled = s.conf.Enabled && len(v6conf.RangeStart) != 0\n\n\ts.srv6, err = v6Create(v6conf)\n\tif err != nil {\n\t\treturn v4conf.Enabled, false, fmt.Errorf(\"creating dhcpv6 srv: %w\", err)\n\t}\n\n\treturn v4conf.Enabled, v6conf.Enabled, nil\n}\n\n// Enabled returns true when the server is enabled.\nfunc (s *server) Enabled() (ok bool) {\n\treturn s.conf.Enabled\n}\n\n// resetLeases resets all leases in the lease database.\nfunc (s *server) resetLeases() (err error) {\n\terr = s.srv4.ResetLeases(nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif s.srv6 != nil {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/dhcpd/dhcpd.go#L172-L208","documentation":"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.","triggerScenarios":"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.","commonSituations":"Enabling DHCPv6 with an invalid prefix or range; interface renamed/removed since last run; OS lacking IPv6 support.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(conf.Conf6.RangeStart) > 0 {\n    if _, err := netip.ParseAddr(string(conf.Conf6.RangeStart)); err != nil { return err }\n}","typeGuard":null,"tryCatchPattern":"if _, err := dhcpd.Create(ctx, conf); err != nil && strings.Contains(err.Error(), \"creating dhcpv6\") { /* inspect wrapped cause, adjust v6 config */ }","preventionTips":["Verify IPv6 support and interface presence","Validate v6 range/prefix syntax before enabling"],"tags":["dhcp","ipv6","startup","validation"],"backgroundTag":"dhcp-server-create-failed","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}