{"record":{"id":"5154cd61b2274772","repo":"HKUDS/Vibe-Trading","slug":"manifest-path-manifest-path-could-not-be-resolve","errorCode":null,"errorMessage":"manifest path {manifest_path} could not be resolved: {exc}","messagePattern":"manifest path (.+?) could not be resolved: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/tools/strategy_discovery_tool.py","lineNumber":455,"sourceCode":"\n    Two shapes are accepted (plan §4.6): a JSON object with a ``runs`` array\n    (``{\"runs\": [{strategy_id, run_dir, position_size?}, ...]}``) or a bare\n    JSON array of the same entries. The manifest itself must sit inside the\n    runtime root or an allowed run root (same containment discipline as the\n    run_dir entries it names).\n\n    Raises:\n        ValueError: With an operator-facing message when the path escapes the\n            allowed roots, the file is missing or unreadable, is not valid\n            JSON, or has the wrong shape. The agent tool and the CLI share\n            this helper so both surfaces report the same failure the same\n            way.\n    \"\"\"\n    manifest_path = Path(str(path)).expanduser()\n    try:\n        resolved_manifest = manifest_path.resolve()\n    except (OSError, RuntimeError) as exc:\n        raise ValueError(\n            f\"manifest path {manifest_path} could not be resolved: {exc}\"\n        ) from exc\n    if not _manifest_path_allowed(resolved_manifest):\n        raise ValueError(\n            f\"manifest path {manifest_path} is outside the runtime root and \"\n            \"the allowed run roots; place the manifest under one of them \"\n            \"(e.g. next to the runs it lists)\"\n        )\n    try:\n        raw = manifest_path.read_text(encoding=\"utf-8\")\n    except OSError as exc:\n        raise ValueError(\n            f\"manifest file {manifest_path} is missing or unreadable \"\n            f\"({exc.strerror or 'I/O error'})\"\n        ) from exc\n    try:\n        parsed = json.loads(raw)\n    except json.JSONDecodeError as exc:","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/tools/strategy_discovery_tool.py#L437-L473","documentation":"load_manifest resolves the given manifest path with Path.resolve() and wraps OSError/RuntimeError (symlink loops, permission issues on resolution, filesystem errors) into a ValueError. This fires before any allowed-root or content checks, meaning the path itself couldn't even be canonicalized.","triggerScenarios":"Passing a path containing a symlink loop (ELOOP -> RuntimeError), a path component on an inaccessible filesystem, or a path with an overlong/invalid encoding causing OSError during resolve(); e.g. manifest_path=\"/tmp/loop/link.json\" where link points to itself.","commonSituations":"Broken symlinks created by deployment scripts; containerized runs where a mounted path disappeared mid-flight; deeply nested or OS-limit-exceeding paths.","solutions":["Check the path manually: run `readlink -f <path>` or Path(path).resolve() in a REPL to reproduce and see the underlying OSError/RuntimeError","Remove/fix broken or looping symlinks in the path chain","Use a plain, direct file path under the runtime root instead of symlink-heavy paths"],"exampleFix":"# before\ncore(manifest_path=\"/srv/links/self_loop.json\", ...)\n# after\n# fix the symlink: ln -sfn /srv/data/manifest.json /srv/links/manifest.json\ncore(manifest_path=\"/srv/data/manifest.json\", ...)","handlingStrategy":"validation","validationCode":"from pathlib import Path\nresolved = Path(manifest_path).expanduser().resolve()  # raises the same errors early\nprint(\"resolved ok:\", resolved)","typeGuard":null,"tryCatchPattern":"try: core(...); except ValueError as e: report e and ask the operator to fix the path/symlinks","preventionTips":["Avoid symlink chains for runtime data files","Smoke-test path resolution at deploy time from the tool's user"],"tags":["strategy-discovery","manifest","path-resolution","filesystem"],"backgroundTag":"path-resolution-failed","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}