{"record":{"id":"819736a47ffbbbbe","repo":"muesli/duf","slug":"unknown-device-group-s","errorCode":null,"errorMessage":"unknown device group: %s","messagePattern":"unknown device group: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"main.go","lineNumber":130,"sourceCode":"\t\tv = strings.ToLower(v)\n\t\tm[v] = struct{}{}\n\t}\n\treturn m\n}\n\n// validateGroups validates the parsed group maps.\nfunc validateGroups(m map[string]struct{}) error {\n\tfor k := range m {\n\t\tfound := false\n\t\tfor _, g := range groups {\n\t\t\tif g == k {\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"unknown device group: %s\", k)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// findInKey parse a slice of pattern to match the given key.\nfunc findInKey(str string, km map[string]struct{}) bool {\n\tfor p := range km {\n\t\tif wildcard.Match(p, str) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc printVersion() {","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/muesli/duf/blob/4636deb4a7b707a9f04c602db033f9837e50b3f6/main.go#L112-L148","documentation":"validateGroups checks each key in the user-supplied device groups map against the known group definitions. If a key is not found among the recognized device groups, it returns \"unknown device group: %s\" naming the offending key. This is a configuration validation step before rendering.","triggerScenarios":"Passing a --groups (or equivalent) comma-separated list containing a name that does not match any defined device group key, e.g. a typo like \"netowrk\" instead of \"network\".","commonSituations":"Typo'd group names, groups renamed between tool versions, copy-pasted configuration from another tool with different group names.","solutions":["Correct the group name to match one of the known device group keys.","List available groups (docs/help output or the group definitions in the source) and pick a valid one.","If a genuinely new grouping is needed, add it to the group definitions rather than passing an unknown key."],"exampleFix":"// before\n--groups netowrk,local\n// after\n--groups network,local","handlingStrategy":"validation","validationCode":"for _, g := range strings.Split(groupsFlag, \",\") {\n\tif !knownGroups[g] {\n\t\treturn fmt.Errorf(\"unknown device group %q\", g)\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := validateGroups(groups); err != nil {\n\tfmt.Fprintln(os.Stderr, err)\n\tos.Exit(1)\n}","preventionTips":["Copy group names from the tool's documentation, not memory.","Keep a shared constants list of valid group names in scripts.","Re-check group names after upgrading the tool."],"tags":["go","cli","validation","config"],"backgroundTag":"invalid-config-value","analyzedSha":"4636deb4a7b707a9f04c602db033f9837e50b3f6","analyzedAt":"2026-09-06T02:31:58.576Z","contentChangedAt":"2026-09-06T02:31:58.576Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}