{"record":{"id":"1ec6b437601ab795","repo":"usestrix/strix","slug":"invalid-path-target-e-s","errorCode":null,"errorMessage":"Invalid path: {target} - {e!s}","messagePattern":"Invalid path: (.+?) - (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"strix/interface/utils.py","lineNumber":1177,"sourceCode":"        pass\n    else:\n        return \"ip_address\", {\"target_ip\": str(ip_obj)}\n\n    path = Path(target).expanduser()\n    try:\n        if path.exists():\n            if path.is_dir():\n                check_mountable_dir(path)\n                return \"local_code\", {\"target_path\": str(path.resolve())}\n            spec_format = detect_spec_format(path)\n            if spec_format is not None:\n                return \"api_spec\", {\n                    \"target_spec\": str(path.resolve()),\n                    \"spec_format\": spec_format,\n                }\n            raise ValueError(f\"Path exists but is not a directory: {target}\")\n    except (OSError, RuntimeError) as e:\n        raise ValueError(f\"Invalid path: {target} - {e!s}\") from e\n\n    if target.endswith(\".git\"):\n        return \"repository\", {\"target_repo\": target}\n\n    if \"/\" in target:\n        host_part, _, path_part = target.partition(\"/\")\n        if \".\" in host_part and not host_part.startswith(\".\") and path_part:\n            full_url = f\"https://{target}\"\n            if _is_http_git_repo(full_url):\n                return \"repository\", {\"target_repo\": full_url}\n            return \"web_application\", {\"target_url\": full_url}\n\n    if \".\" in target and \"/\" not in target and not target.startswith(\".\"):\n        parts = target.split(\".\")\n        if len(parts) >= 2 and all(p and p.strip() for p in parts):\n            return \"web_application\", {\"target_url\": f\"https://{target}\"}\n\n    raise ValueError(","sourceCodeStart":1159,"sourceCodeEnd":1195,"githubUrl":"https://github.com/usestrix/strix/blob/85513391305171ecc6faffe03da4a8bda5e3febb/strix/interface/utils.py#L1159-L1195","documentation":"Wraps OSError/RuntimeError raised while inspecting the target path (existence checks, is_dir, resolve, or check_mountable_dir) into a ValueError with context. This is a fail-fast wrapper: the original exception is chained via 'from e', so the underlying filesystem problem (permission denied, broken symlink loops, I/O errors) is preserved in the cause.","triggerScenarios":"Target path on an unreadable mount, permission-denied directory in stat/resolve, a symlink loop (RuntimeError from resolve(strict=False) is rare but OSError ELOOP is common), or check_mountable_dir raising on an OS error during Path.resolve() of symlinked system dirs.","commonSituations":"Scanning paths on network mounts that dropped; docker volume paths with odd permissions; macOS /private symlink edge cases; paths on drives removed between check and use.","solutions":["Check the underlying cause in the traceback (the 'from e' chain) to see the real OS error.","Fix permissions or remount the filesystem: ls -ld <path> and retry after access is restored.","Copy or move the code to a stable local directory and target that."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"from pathlib import Path\n\ndef is_readable_path(target: str) -> bool:\n    try:\n        p = Path(target).expanduser()\n        return p.exists() and (p.is_dir() or p.is_file())\n    except OSError:\n        return False\n\nif not is_readable_path(target):\n    raise SystemExit(f\"Target path is not accessible: {target}\")","typeGuard":null,"tryCatchPattern":"try:\n    ttype, details = infer_target_type(target)\nexcept ValueError as e:\n    if str(e).startswith(\"Invalid path:\"):\n        raise SystemExit(f\"Filesystem problem with {target!r}: check mounts and permissions ({e})\") from e\n    raise","preventionTips":["Pre-scan path accessibility checks in automation before launching long jobs","Keep scan targets on reliable local storage, not transient network mounts"],"tags":["filesystem","targets","permissions","environment"],"backgroundTag":null,"analyzedSha":"85513391305171ecc6faffe03da4a8bda5e3febb","analyzedAt":"2026-08-15T05:03:57.275Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}