nodejs/node · error · Exception

%s cannot have child configs.

Error message

%s cannot have child configs.

What it means

LeafTraceConfig is, by design, a terminal node in the suite tree. Calling AppendChild on it is a programmer error: leaves cannot have children. The exception message names the offending class.

Source

Thrown at deps/v8/tools/run_perf.py:465

      assert "name" in variant, \
          "Variant must have 'name' property: " + str(variant)[:100]
      assert len(variant) >= 2, \
          "Variant must define other properties than 'name': " + str(variant)


class LeafTraceConfig(GraphConfig):
  """Represents a leaf in the suite tree structure."""
  def __init__(self, suite, parent, arch):
    super(LeafTraceConfig, self).__init__(suite, parent, arch)
    assert self.results_regexp
    if '%s' in self.results_regexp:
      raise Exception(
          "results_regexp at the wrong level. "
          "Regexp should not contain '%%s': results_regexp='%s' name=%s" %
          (self.results_regexp, self.name))

  def AppendChild(self, node):
    raise Exception("%s cannot have child configs." % type(self).__name__)

  def ConsumeOutput(self, output, result_tracker):
    """Extracts trace results from the output.

    Args:
      output: Output object from the test run.
      result_tracker: Result tracker to be updated.

    Returns:
      The raw extracted result value or None if an error occurred.
    """

    if len(self.children) > 0:
      results_for_total = []
      for trace in self.children:
        result = trace.ConsumeOutput(output, result_tracker)
        if result is not None:
          results_for_total.append(result)

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Use a non-leaf GraphConfig subclass (e.g. VariantConfig) for any node that needs children.
  2. Refactor the suite tree so children attach to an interior node, not to the leaf.
  3. Treat this as a programmer error in the suite config classes — fix the caller, not the data.

Example fix

// before
leaf = LeafTraceConfig(suite, parent, arch)
leaf.AppendChild(child)  // raises
// after
interior = GraphConfig(suite, parent, arch)
interior.AppendChild(LeafTraceConfig(child_suite, interior, arch))
Defensive patterns

Strategy: type-guard

Validate before calling

# Before appending, make sure the parent is not a leaf.
from run_perf import LeafTraceConfig
assert not isinstance(node, LeafTraceConfig), (
    f'cannot append child to leaf node of type {type(node).__name__}')

Type guard

def can_have_children(node):
    from run_perf import LeafTraceConfig
    return not isinstance(node, LeafTraceConfig)

Prevention

When it happens

Trigger: Suite-tree construction code calling node.AppendChild(...) on a node that was instantiated as a LeafTraceConfig.

Common situations: A bug in suite-builder logic; a config type that should have been an interior GraphConfig/VariantConfig was wrongly instantiated as a leaf; refactor that broke node-type selection.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/a1c943efbdad18db. Report an issue: GitHub.