grpc/grpc-go · error

LB policy name %q found in Children field (%v) is not found

Error message

LB policy name %q found in Children field (%v) is not found in Priorities field (%+v)

What it means

Returned by the priority balancer's parseConfig (internal/xds/balancer/priority/config.go:62) when a key exists in the `children` map but is not listed in the `priorities` array. Every defined child must appear in priorities; an orphaned child is rejected.

Source

Thrown at internal/xds/balancer/priority/config.go:63

	Priorities []string `json:"priorities,omitempty"`
}

func parseConfig(c json.RawMessage) (*LBConfig, error) {
	var cfg LBConfig
	if err := json.Unmarshal(c, &cfg); err != nil {
		return nil, err
	}

	prioritiesSet := make(map[string]bool)
	for _, name := range cfg.Priorities {
		if _, ok := cfg.Children[name]; !ok {
			return nil, fmt.Errorf("LB policy name %q found in Priorities field (%v) is not found in Children field (%+v)", name, cfg.Priorities, cfg.Children)
		}
		prioritiesSet[name] = true
	}
	for name := range cfg.Children {
		if _, ok := prioritiesSet[name]; !ok {
			return nil, fmt.Errorf("LB policy name %q found in Children field (%v) is not found in Priorities field (%+v)", name, cfg.Children, cfg.Priorities)
		}
	}
	return &cfg, nil
}

View on GitHub (pinned to 03255a9237)

Solutions

  1. Add every child name to the `priorities` list, or remove unused children
  2. Correct the upstream xDS resource to keep children and priorities in sync
  3. Validate that the children key set equals the priorities set before publishing

Example fix

// before
{"children":{"a":{...},"b":{...}},"priorities":["a"]}
// after
{"children":{"a":{...},"b":{...}},"priorities":["a","b"]}
Defensive patterns

Strategy: validation

Validate before calling

var probe struct {
    Children   map[string]json.RawMessage `json:"children"`
    Priorities []string                   `json:"priorities"`
}
_ = json.Unmarshal(raw, &probe)
pset := make(map[string]bool, len(probe.Priorities))
for _, p := range probe.Priorities { pset[p] = true }
for name := range probe.Children {
    if !pset[name] {
        return fmt.Errorf("child %q is not listed in priorities", name)
    }
}

Try / catch

cfg, err := priorityParseConfig(raw)
if err != nil {
    logger.Warningf("rejecting priority config: %v", err)
    return fallbackLBConfig
}

Prevention

When it happens

Trigger: parseConfig receives JSON where `children` defines a name that does not appear in `priorities` — e.g. children:{"a","b"} but priorities:["a"].

Common situations: Control plane adds a child but forgets to add it to priorities; typo in the priorities list; stale child left in the map after a priorities edit.

Related errors


AI-assisted analysis of grpc/grpc-go@03255a9237 (2026-08-07). Data as JSON: /api/errors/6c4d3c6964f8aab8. Report an issue: GitHub.