{"record":{"id":"818025a587f72a2c","repo":"deepset-ai/haystack","slug":"variable-var-name-from-prompt-source-conflic","errorCode":null,"errorMessage":"Variable '{var_name}' from {prompt_source} conflicts with input names in the run method. Please rename the variable or remove it from the prompt to avoid conflicts.","messagePattern":"Variable '(.+?)' from (.+?) conflicts with input names in the run method\\. Please rename the variable or remove it from the prompt to avoid conflicts\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"haystack/components/agents/agent.py","lineNumber":583,"sourceCode":"            if builder is not None:\n                # set required_variables on the builder, filtered to its own variables\n                if required_variables == \"*\":\n                    builder.required_variables = \"*\"\n                elif isinstance(self.required_variables, list):\n                    builder.required_variables = [v for v in self.required_variables if v in builder.variables]\n\n                for var_name in builder.variables:\n                    all_variables.setdefault(var_name, []).append(label)\n\n        for var_name, sources in all_variables.items():\n            prompt_source = \" and \".join(sources)\n            if var_name in self.resolved_state_schema:\n                raise ValueError(\n                    f\"Variable '{var_name}' from {prompt_source} is already defined in the state schema. \"\n                    \"Please rename the variable or remove it from the prompt to avoid conflicts.\"\n                )\n            if var_name in self._run_method_params:\n                raise ValueError(\n                    f\"Variable '{var_name}' from {prompt_source} conflicts with input names in the run method. \"\n                    \"Please rename the variable or remove it from the prompt to avoid conflicts.\"\n                )\n            if required_variables == \"*\" or (isinstance(required_variables, list) and var_name in required_variables):\n                component.set_input_type(self, name=var_name, type=Any)\n            else:\n                component.set_input_type(self, name=var_name, type=Any, default=None)\n\n    def warm_up(self) -> None:\n        \"\"\"Warm up the tools, hooks, and the underlying chat generator.\"\"\"\n        warm_up_tools(tools=self.tools)\n        warm_up_hooks(self.hooks)\n        if hasattr(self.chat_generator, \"warm_up\"):\n            self.chat_generator.warm_up()\n\n    async def warm_up_async(self) -> None:\n        \"\"\"Warm up the tools, hooks, and the underlying chat generator on the serving event loop.\"\"\"\n        warm_up_tools(tools=self.tools)","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/components/agents/agent.py#L565-L601","documentation":"read_skill_file supports three content kinds: UTF-8 text, images (by MIME type), and PDFs. When the target file is none of those — its bytes fail UTF-8 decoding and it isn't a recognized image or PDF — this ValueError is raised (chained from UnicodeDecodeError). It guards against handing binary garbage to the model as text.","triggerScenarios":"Reading binary assets like .zip, .xlsx, .docx, .exe, or unknown-extension binary blobs from a skill directory via read_skill_file; also corrupted text files with invalid byte sequences.","commonSituations":"Skills bundling datasets/archives that the store can't render; users expecting every bundled file to be readable; files saved in a non-UTF-8 encoding (e.g. latin-1) with exotic characters; truncated downloads.","solutions":["Read a supported file instead: convert the asset to UTF-8 text, PNG/JPEG image, or PDF and rebundle the skill.","If the file is text in another encoding, re-save it as UTF-8 (e.g. iconv -f latin-1 -t utf-8 file.txt).","Read the file yourself with plain I/O outside the skill store if you genuinely need raw binary bytes."],"exampleFix":"// before\ncontent = store.read_skill_file(\"my-skill\", \"data.xlsx\")\n// after\nwith open(\"skills/my-skill/data.xlsx\", \"rb\") as f:\n    raw = f.read()  # or convert the data to CSV and read that via the store","handlingStrategy":"try-catch","validationCode":"import mimetypes\nfrom pathlib import Path\n\nSUPPORTED = {\"text/plain\", \"application/pdf\", \"image/png\", \"image/jpeg\", \"image/gif\", \"image/webp\"}\n\ndef is_readable_asset(path: str) -> bool:\n    mime, _ = mimetypes.guess_type(path)\n    if mime and mime in SUPPORTED:\n        return True\n    try:\n        Path(path).read_text(encoding=\"utf-8\")\n        return True\n    except (UnicodeDecodeError, OSError):\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    content = store.read_skill_file(name, path)\nexcept ValueError as e:\n    if \"not a readable asset\" in str(e):\n        logger.warning(\"Skipping unsupported binary asset %r\", path)\n        content = None\n    else:\n        raise","preventionTips":["Bundle only UTF-8 text, images, or PDFs in skill directories","Re-encode text files to UTF-8 (avoid latin-1/UTF-16 encodings)","Skip files by MIME type before calling read_skill_file on unknown binaries","Keep archives/datasets outside the skill bundle or expose them via a different mechanism"],"tags":["encoding","skill-store","file-type","utf-8"],"backgroundTag":"unsupported-file-type","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}