{"record":{"id":"86600e5419ff9e26","repo":"AdguardTeam/AdGuardHome","slug":"found-no-dns-servers-in-s","errorCode":null,"errorMessage":"found no dns servers in %s","messagePattern":"found no dns servers in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/aghnet/net_darwin.go","lineNumber":214,"sourceCode":"\t_, err = aghos.FileWalker(func(r io.Reader) (_ []string, _ bool, err error) {\n\t\tsc := bufio.NewScanner(r)\n\t\tfor sc.Scan() {\n\t\t\tmatches := etcResolvConfReg.FindAllStringSubmatch(sc.Text(), -1)\n\t\t\tif len(matches) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor _, m := range matches {\n\t\t\t\taddrs = append(addrs, m[1])\n\t\t\t}\n\t\t}\n\n\t\treturn nil, false, sc.Err()\n\t}).Walk(rootDirFS, filename)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parsing etc/resolv.conf file: %w\", err)\n\t} else if len(addrs) == 0 {\n\t\treturn nil, fmt.Errorf(\"found no dns servers in %s\", filename)\n\t}\n\n\treturn addrs, nil\n}\n","sourceCodeStart":196,"sourceCodeEnd":219,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/aghnet/net_darwin.go#L196-L219","documentation":"When unmarshalling a WeeklySchedule from JSON, each weekday's dayRange is validated. If any day's range is invalid (negative times, start >= end, sub-minute precision, out-of-day bounds), UnmarshalJSON returns 'weekday <Day>: <cause>'. This happens during config load.","triggerScenarios":"Providing a JSON weekly schedule where at least one day object has start/end values that fail dayRange.validate — e.g. negative milliseconds, start >= end, or second-level precision.","commonSituations":"Hand-editing the parental-control/schedule JSON; generating schedules from a script that emits seconds or negative values; copying a schedule example from docs of a different version.","solutions":["Read the weekday and wrapped cause in the message to locate the bad day and rule","Fix start/end to non-negative minute-rounded values with start < end within one day","Validate the schedule with a JSON schema or the UI before writing it to config","Regenerate schedules from your tooling using minute-precision durations"],"exampleFix":"// before\n{\"mon\":{\"start\":\"-3600000000000\",\"end\":\"36000000000000\"}}\n// after\n{\"mon\":{\"start\":0,\"end\":36000000000000}} // start >= 0, minute-aligned","handlingStrategy":"validation","validationCode":"// Validate each day's range before marshalling\nfor i, d := range days {\n    if err := validateDayRange(d); err != nil { return fmt.Errorf(\"day %d: %w\", i, err) }\n}","typeGuard":"func isValidDayRange(start, end time.Duration) bool {\n    return (start == 0 && end == 0) ||\n        (start >= 0 && end >= 0 && start < end &&\n         start%time.Minute == 0 && end%time.Minute == 0 &&\n         end <= 24*time.Hour)\n}","tryCatchPattern":"if err := json.Unmarshal(data, &sched); err != nil {\n    if strings.HasPrefix(err.Error(), \"weekday \") {\n        // locate named day, fix range, re-unmarshal\n    }\n}","preventionTips":["Use the UI schedule editor or a validating serializer","Compute ranges as minute-aligned durations","Add schedule validation to config CI"],"tags":["schedule","json","validation","config","go"],"backgroundTag":"config-validation-failed","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}