infiniflow/ragflow · error · ValueError

Variable is not complete.

Error message

Variable is not complete.

What it means

ValueError from VariableAssigner._invoke(): an assignment item must contain both a truthy 'variable' (the target selector) and a truthy 'operator'. Either missing — e.g. empty selector or blank operator — makes the assignment incomplete.

Source

Thrown at agent/component/variable_assigner.py:54

        return {"items": {"type": "json", "name": "Items"}}


class VariableAssigner(ComponentBase, ABC):
    component_name = "VariableAssigner"
    _NO_PARAMETER_OPERATORS = {"clear", "remove_first", "remove_last"}

    @timeout(int(os.environ.get("COMPONENT_EXEC_TIMEOUT", 10 * 60)))
    def _invoke(self, **kwargs):
        if not isinstance(self._param.variables, list):
            return
        else:
            for item in self._param.variables:
                variable = item.get("variable")
                operator = item.get("operator")
                parameter = item.get("parameter")

                if any([not variable, not operator]):
                    raise ValueError("Variable is not complete.")
                if operator not in self._NO_PARAMETER_OPERATORS and parameter is None:
                    raise ValueError("Variable is not complete.")
                variable_value = self._canvas.get_variable_value(variable)
                new_variable = self._operate(variable_value, operator, parameter)
                self._canvas.set_variable_value(variable, new_variable)

    def _operate(self, variable, operator, parameter):
        if operator == "overwrite":
            return self._overwrite(parameter)
        elif operator == "clear":
            return self._clear(variable)
        elif operator == "set":
            return self._set(variable, parameter)
        elif operator == "append":
            return self._append(variable, parameter)
        elif operator == "extend":
            return self._extend(variable, parameter)
        elif operator == "remove_first":

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Complete every row: choose the target variable and the operator (overwrite/clear/set/append/add).
  2. Delete rows you do not need instead of leaving them blank.
  3. Re-open and re-save the VariableAssigner after graph refactors so selectors rebind.

Example fix

// before
"variables": [{"variable": "", "operator": "set", "parameter": 0}]

// after
"variables": [{"variable": "state@count", "operator": "set", "parameter": 0}]
Defensive patterns

Strategy: validation

Validate before calling

for item in assigner_param.variables:
    assert item.get('variable') and item.get('operator'), f'incomplete assignment row: {item}'

Type guard

def assignment_row_complete(item: dict) -> bool:
    return bool(item.get('variable')) and bool(item.get('operator'))

Try / catch

try:
    assigner._invoke()
except ValueError as e:
    if 'not complete' in str(e):
        # fill in target variable/operator and re-run
        ...

Prevention

When it happens

Trigger: A variables row {"variable": "", "operator": "append", ...} or {"variable": "x@y", "operator": ""}. The check is any([not variable, not operator]).

Common situations: Adding an assignment row in the UI without selecting the target variable; deleting the target component so the selector string becomes empty; partially filled duplicated rows.

Related errors


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