{"record":{"id":"ce978021285afc2a","repo":"deepset-ai/haystack","slug":"variable-var-name-from-prompt-source-is-alre","errorCode":null,"errorMessage":"Variable '{var_name}' from {prompt_source} is already defined in the state schema. Please rename the variable or remove it from the prompt to avoid conflicts.","messagePattern":"Variable '(.+?)' from (.+?) is already defined in the state schema\\. 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":578,"sourceCode":"        all_variables: dict[str, list[str]] = {}\n        for builder, label in [\n            (self._system_chat_prompt_builder, \"system_prompt\"),\n            (self._user_chat_prompt_builder, \"user_prompt\"),\n        ]:\n            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\"):","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/components/agents/agent.py#L560-L596","documentation":"After path-traversal checks, read_skill_file verifies the resolved target is an existing regular file. This FileNotFoundError is raised when the path resolves within the skill directory but points at a nonexistent file or a directory. The message includes the list of readable files so callers can retry with a valid path.","triggerScenarios":"store.read_skill_file('my-skill', 'README.md') when the skill only ships 'SKILL.md'; a misspelled filename; passing a directory path; case-mismatched filename on case-sensitive filesystems.","commonSituations":"Hardcoded asset names that differ across skill versions; agent guessing file names ('readme.md' vs 'README.md'); referencing files deleted from the skill package; Linux deployments where Windows-authored casing no longer matches.","solutions":["Use one of the file paths listed in the error's 'Readable files' hint.","Call the store's listing API (e.g. via load_skill/_list_skill_files) to enumerate actual files and correct the path.","Fix filename casing/spelling to exactly match the file on disk."],"exampleFix":"// before\nstore.read_skill_file(\"my-skill\", \"Readme.md\")\n// after\nstore.read_skill_file(\"my-skill\", \"README.md\")","handlingStrategy":"validation","validationCode":"def assert_file_in_skill(store, name: str, path: str) -> bool:\n    readable = store._list_skill_files(name) if hasattr(store, \"_list_skill_files\") else []\n    return path in readable","typeGuard":null,"tryCatchPattern":"try:\n    content = store.read_skill_file(name, path)\nexcept FileNotFoundError as e:\n    logger.warning(\"%s; falling back to skill main file\", e)\n    content = store.read_skill_file(name, \"SKILL.md\")","preventionTips":["Enumerate readable files via the store API before reading instead of guessing names","Match file names and casing exactly; Linux filesystems are case-sensitive","Reference assets that actually ship in the skill package; verify in CI","After skill version upgrades, re-check hardcoded asset paths"],"tags":["filenotfound","skill-store","filesystem","path"],"backgroundTag":"file-not-found","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}