infiniflow/ragflow · error · ValueError

[VariableAggregator] variables of group `{g.get('group_name'

Error message

[VariableAggregator] variables of group `{g.get('group_name')}` can not be empty

What it means

ValueError from VariableAggregatorParam.check(): a group passes the group_name check but its 'variables' field is falsy (missing, None, or empty list). An aggregator group with nothing to aggregate is invalid.

Source

Thrown at agent/component/variable_aggregator.py:41

class VariableAggregatorParam(ComponentParamBase):
    """
    Parameters for VariableAggregator

    - groups: list of dicts {"group_name": str, "variables": [variable selectors]}
    """

    def __init__(self):
        super().__init__()
        # each group expects: {"group_name": str, "variables": List[str]}
        self.groups = []

    def check(self):
        self.check_empty(self.groups, "[VariableAggregator] groups")
        for g in self.groups:
            if not g.get("group_name"):
                raise ValueError("[VariableAggregator] group_name can not be empty!")
            if not g.get("variables"):
                raise ValueError(f"[VariableAggregator] variables of group `{g.get('group_name')}` can not be empty")
            if not isinstance(g.get("variables"), list):
                raise ValueError(f"[VariableAggregator] variables of group `{g.get('group_name')}` should be a list of strings")

    def get_input_form(self) -> dict[str, dict]:
        return {
            "variables": {
                "name": "Variables",
                "type": "list",
            }
        }


class VariableAggregator(ComponentBase):
    component_name = "VariableAggregator"

    @timeout(int(os.environ.get("COMPONENT_EXEC_TIMEOUT", 3)))
    def _invoke(self, **kwargs):
        # Group mode: for each group, pick the first available variable

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Add at least one variable selector to the group.
  2. Remove the group entirely if it is no longer needed.
  3. When generating canvases, skip emitting groups whose variables list is empty.

Example fix

// before
{"group_name": "inputs", "variables": []}

// after
{"group_name": "inputs", "variables": ["begin@usr_q"]}
Defensive patterns

Strategy: validation

Validate before calling

for g in aggregator_param.groups:
    assert g.get('variables'), f'group {g.get("group_name")} has no variables'

Type guard

def group_has_variables(g: dict) -> bool:
    return isinstance(g.get('variables'), list) and len(g['variables']) > 0

Try / catch

try:
    aggregator_param.check()
except ValueError as e:
    if 'can not be empty' in str(e):
        # add selectors to the group or remove the group
        ...

Prevention

When it happens

Trigger: A groups entry {"group_name": "g1"} with no variables key, or "variables": [] after the user removed all selectors from a group.

Common situations: Creating a group ahead of wiring its members; upstream components deleted leaving selectors removed; DSL generation that emits the name but skips empty variable arrays.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/2d039017dbe50539. Report an issue: GitHub.