muesli/duf · error

unknown device group: %s

Error message

unknown device group: %s

What it means

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.

Source

Thrown at main.go:130

		v = strings.ToLower(v)
		m[v] = struct{}{}
	}
	return m
}

// validateGroups validates the parsed group maps.
func validateGroups(m map[string]struct{}) error {
	for k := range m {
		found := false
		for _, g := range groups {
			if g == k {
				found = true
				break
			}
		}

		if !found {
			return fmt.Errorf("unknown device group: %s", k)
		}
	}

	return nil
}

// findInKey parse a slice of pattern to match the given key.
func findInKey(str string, km map[string]struct{}) bool {
	for p := range km {
		if wildcard.Match(p, str) {
			return true
		}
	}

	return false
}

func printVersion() {

View on GitHub (pinned to 4636deb4a7)

Solutions

  1. Correct the group name to match one of the known device group keys.
  2. List available groups (docs/help output or the group definitions in the source) and pick a valid one.
  3. If a genuinely new grouping is needed, add it to the group definitions rather than passing an unknown key.

Example fix

// before
--groups netowrk,local
// after
--groups network,local
Defensive patterns

Strategy: validation

Validate before calling

for _, g := range strings.Split(groupsFlag, ",") {
	if !knownGroups[g] {
		return fmt.Errorf("unknown device group %q", g)
	}
}

Try / catch

if err := validateGroups(groups); err != nil {
	fmt.Fprintln(os.Stderr, err)
	os.Exit(1)
}

Prevention

When it happens

Trigger: 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".

Common situations: Typo'd group names, groups renamed between tool versions, copy-pasted configuration from another tool with different group names.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of muesli/duf@4636deb4a7 (2026-09-06). Data as JSON: /api/errors/819736a47ffbbbbe. Report an issue: GitHub.