{"record":{"id":"e86bd1ed4133a431","repo":"NousResearch/hermes-agent","slug":"dataset-file-not-found-self-dataset-file","errorCode":null,"errorMessage":"Dataset file not found: {self.dataset_file}","messagePattern":"Dataset file not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"batch_runner.py","lineNumber":652,"sourceCode":"        print(f\"   Batch size: {self.batch_size}\")\n        print(f\"   Total batches: {len(self.batches)}\")\n        print(f\"   Run name: {self.run_name}\")\n        print(f\"   Distribution: {self.distribution}\")\n        print(f\"   Output directory: {self.output_dir}\")\n        print(f\"   Workers: {self.num_workers}\")\n        if self.ephemeral_system_prompt:\n            prompt_preview = self.ephemeral_system_prompt[:60] + \"...\" if len(self.ephemeral_system_prompt) > 60 else self.ephemeral_system_prompt\n            print(f\"   🔒 Ephemeral system prompt: '{prompt_preview}'\")\n    \n    def _load_dataset(self) -> List[Dict[str, Any]]:\n        \"\"\"\n        Load dataset from JSONL file.\n        \n        Returns:\n            List[Dict]: List of dataset entries\n        \"\"\"\n        if not self.dataset_file.exists():\n            raise FileNotFoundError(f\"Dataset file not found: {self.dataset_file}\")\n        \n        dataset = []\n        with open(self.dataset_file, 'r', encoding='utf-8') as f:\n            for line_num, line in enumerate(f, 1):\n                line = line.strip()\n                if not line:\n                    continue\n                \n                try:\n                    entry = json.loads(line)\n                    if 'prompt' not in entry:\n                        print(f\"⚠️  Warning: Line {line_num} missing 'prompt' field, skipping\")\n                        continue\n                    dataset.append(entry)\n                except json.JSONDecodeError as e:\n                    print(f\"⚠️  Warning: Invalid JSON on line {line_num}: {e}\")\n                    continue\n        ","sourceCodeStart":634,"sourceCodeEnd":670,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/batch_runner.py#L634-L670","documentation":"FileNotFoundError from BatchRunner._load_dataset() (batch_runner.py:652): the JSONL dataset path passed to the runner does not exist on disk, so nothing can be loaded. Raised at dataset-load time, before any batches are created.","triggerScenarios":"Passing a relative dataset path while running from a different working directory; typo in the filename; the file lives on another machine/share that is not mounted; the generating step upstream failed so the file was never written.","commonSituations":"Cron/CI jobs whose cwd differs from the dev shell; run_name/output paths that imply the dataset should exist but the preprocessing step was skipped; moved or renamed datasets after a refactor.","solutions":["Check the path exists from the same cwd the runner uses: `ls -l <dataset_file>` — resolve to an absolute path if cwd varies.","If a preprocessing step produces the dataset, verify it ran and wrote output before BatchRunner starts.","Fix the path in the CLI invocation/config (absolute paths avoid cwd sensitivity in scheduled contexts)."],"exampleFix":"# before\nrunner = BatchRunner(run_name=\"r1\", dataset_file=\"data/prompts.jsonl\", ...)\n# run from another cwd -> FileNotFoundError\n\n# after\nfrom pathlib import Path\ndataset = Path(\"data/prompts.jsonl\").resolve()\nif not dataset.exists():\n    raise SystemExit(f\"missing dataset: {dataset}\")\nrunner = BatchRunner(run_name=\"r1\", dataset_file=str(dataset), ...)","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndataset = Path(dataset_file).expanduser().resolve()\nif not dataset.is_file():\n    raise SystemExit(f\"dataset not found: {dataset}\")","typeGuard":null,"tryCatchPattern":"try:\n    runner = BatchRunner(run_name=r, dataset_file=dataset_file, ...)\nexcept FileNotFoundError as exc:\n    raise SystemExit(f\"check dataset path/cwd: {exc}\") from exc","preventionTips":["Use absolute dataset paths in cron/CI where cwd is unpredictable.","Resolve and assert existence before constructing BatchRunner.","If a pipeline step generates the dataset, gate the run on that step's success."],"tags":["batch","file-not-found","path","cwd"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}