{"record":{"id":"5ee011b90f6e4160","repo":"AdguardTeam/AdGuardHome","slug":"invalid-pattern-q-w","errorCode":null,"errorMessage":"invalid pattern %q: %w","messagePattern":"invalid pattern %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/aghos/filewalker.go","lineNumber":69,"sourceCode":"\n\treturn c(f)\n}\n\n// handlePatterns parses the patterns in fsys and ignores duplicates using\n// srcSet.  srcSet must be non-nil.\nfunc handlePatterns(\n\tfsys fs.FS,\n\tsrcSet *container.MapSet[string],\n\tpatterns ...string,\n) (sub []string, err error) {\n\tsub = make([]string, 0, len(patterns))\n\tfor _, p := range patterns {\n\t\tvar matches []string\n\t\tmatches, err = fs.Glob(fsys, p)\n\t\tif err != nil {\n\t\t\t// Enrich error with the pattern because filepath.Glob\n\t\t\t// doesn't do it.\n\t\t\treturn nil, fmt.Errorf(\"invalid pattern %q: %w\", p, err)\n\t\t}\n\n\t\tfor _, m := range matches {\n\t\t\tif srcSet.Has(m) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tsrcSet.Add(m)\n\t\t\tsub = append(sub, m)\n\t\t}\n\t}\n\n\treturn sub, nil\n}\n\n// Walk starts walking the files in fsys defined by patterns from initial.\n// It only returns true if fw signed to stop walking.\nfunc (fw FileWalker) Walk(fsys fs.FS, initial ...string) (ok bool, err error) {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/aghos/filewalker.go#L51-L87","documentation":"dayRange.validate requires time values to be whole minutes; if the start value loses information when truncated to a minute (i.e. it has seconds or sub-seconds), the error 'start <val> isn't rounded to minutes' is returned during schedule unmarshalling.","triggerScenarios":"A schedule entry whose start includes seconds/sub-second precision, e.g. \"09:00:30\" or a millisecond-based duration value, in JSON or YAML weekly schedules.","commonSituations":"Scripts computing start times from seconds-based timestamps; copying ISO 8601 durations with seconds (PT9H30M30S); UI versions or third-party tools emitting second precision.","solutions":["Round start times to whole minutes in the schedule source","Fix the generating script to emit minute-precision durations","Use the built-in schedule editor, which enforces minute granularity","Re-parse the config after fixing to confirm the error is gone"],"exampleFix":"// before\n\"start\": \"09:00:30\"\n// after\n\"start\": \"09:00\"","handlingStrategy":"validation","validationCode":"if start%time.Minute != 0 { start = start.Truncate(time.Minute) }","typeGuard":"func isMinuteAligned(d time.Duration) bool { return d%time.Minute == 0 }","tryCatchPattern":"if err := unmarshalSchedule(data); err != nil && strings.Contains(err.Error(), \"isn't rounded to minutes\") {\n    // round start/end and retry\n}","preventionTips":["Emit only HH:MM precision from generators","Round computed times to minutes at the source","Add schema checks for second components"],"tags":["schedule","validation","time","config","go"],"backgroundTag":"config-validation-failed","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}