{"record":{"id":"c4361c02ce87e2f7","repo":"infiniflow/ragflow","slug":"variable-is-not-complete","errorCode":null,"errorMessage":"Variable is not complete.","messagePattern":"Variable is not complete\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/component/variable_assigner.py","lineNumber":54,"sourceCode":"        return {\"items\": {\"type\": \"json\", \"name\": \"Items\"}}\n\n\nclass VariableAssigner(ComponentBase, ABC):\n    component_name = \"VariableAssigner\"\n    _NO_PARAMETER_OPERATORS = {\"clear\", \"remove_first\", \"remove_last\"}\n\n    @timeout(int(os.environ.get(\"COMPONENT_EXEC_TIMEOUT\", 10 * 60)))\n    def _invoke(self, **kwargs):\n        if not isinstance(self._param.variables, list):\n            return\n        else:\n            for item in self._param.variables:\n                variable = item.get(\"variable\")\n                operator = item.get(\"operator\")\n                parameter = item.get(\"parameter\")\n\n                if any([not variable, not operator]):\n                    raise ValueError(\"Variable is not complete.\")\n                if operator not in self._NO_PARAMETER_OPERATORS and parameter is None:\n                    raise ValueError(\"Variable is not complete.\")\n                variable_value = self._canvas.get_variable_value(variable)\n                new_variable = self._operate(variable_value, operator, parameter)\n                self._canvas.set_variable_value(variable, new_variable)\n\n    def _operate(self, variable, operator, parameter):\n        if operator == \"overwrite\":\n            return self._overwrite(parameter)\n        elif operator == \"clear\":\n            return self._clear(variable)\n        elif operator == \"set\":\n            return self._set(variable, parameter)\n        elif operator == \"append\":\n            return self._append(variable, parameter)\n        elif operator == \"extend\":\n            return self._extend(variable, parameter)\n        elif operator == \"remove_first\":","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/component/variable_assigner.py#L36-L72","documentation":"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.","triggerScenarios":"A variables row {\"variable\": \"\", \"operator\": \"append\", ...} or {\"variable\": \"x@y\", \"operator\": \"\"}. The check is any([not variable, not operator]).","commonSituations":"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.","solutions":["Complete every row: choose the target variable and the operator (overwrite/clear/set/append/add).","Delete rows you do not need instead of leaving them blank.","Re-open and re-save the VariableAssigner after graph refactors so selectors rebind."],"exampleFix":"// before\n\"variables\": [{\"variable\": \"\", \"operator\": \"set\", \"parameter\": 0}]\n\n// after\n\"variables\": [{\"variable\": \"state@count\", \"operator\": \"set\", \"parameter\": 0}]","handlingStrategy":"validation","validationCode":"for item in assigner_param.variables:\n    assert item.get('variable') and item.get('operator'), f'incomplete assignment row: {item}'","typeGuard":"def assignment_row_complete(item: dict) -> bool:\n    return bool(item.get('variable')) and bool(item.get('operator'))","tryCatchPattern":"try:\n    assigner._invoke()\nexcept ValueError as e:\n    if 'not complete' in str(e):\n        # fill in target variable/operator and re-run\n        ...","preventionTips":["Select a target variable and operator for every assignment row.","Delete unused rows rather than leaving them blank.","Rebind selectors after renaming/deleting upstream components."],"tags":["variable-assigner","configuration","validation","agent-canvas"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}