{"record":{"id":"6cf8bc9b90843fef","repo":"usestrix/strix","slug":"could-not-clone-repository-repo-url-detail","errorCode":null,"errorMessage":"Could not clone repository {repo_url}: {detail}","messagePattern":"Could not clone repository (.+?): (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"strix/interface/utils.py","lineNumber":1572,"sourceCode":"    try:\n        with console.status(f\"[bold cyan]Cloning repository {repo_url}...\", spinner=\"dots\"):\n            subprocess.run(  # noqa: S603\n                [\n                    git_executable,\n                    \"clone\",\n                    repo_url,\n                    str(clone_path),\n                ],\n                capture_output=True,\n                text=True,\n                check=True,\n            )\n\n        return str(clone_path.absolute())\n\n    except subprocess.CalledProcessError as e:\n        detail = e.stderr if hasattr(e, \"stderr\") and e.stderr else str(e)\n        raise ValueError(f\"Could not clone repository {repo_url}: {detail}\") from e\n    except FileNotFoundError as e:\n        raise ValueError(\n            \"Git is not installed or not available in PATH. \"\n            \"Please install Git to clone repositories.\"\n        ) from e\n\n\ndef check_docker_connection() -> Any:\n    try:\n        return docker.from_env()\n    except DockerException:\n        console = Console()\n        error_text = Text()\n        error_text.append(\"DOCKER NOT AVAILABLE\", style=\"bold red\")\n        error_text.append(\"\\n\\n\", style=\"white\")\n        error_text.append(\"Cannot connect to Docker daemon.\\n\", style=\"white\")\n        error_text.append(\n            \"Please ensure Docker Desktop is installed and running, and try running strix again.\\n\",","sourceCodeStart":1554,"sourceCodeEnd":1590,"githubUrl":"https://github.com/usestrix/strix/blob/85513391305171ecc6faffe03da4a8bda5e3febb/strix/interface/utils.py#L1554-L1590","documentation":"Raised when the underlying `git clone` subprocess exits non-zero: subprocess.CalledProcessError is caught and re-raised as ValueError with the repo URL and stderr detail. Typical stderr causes: repository not found (404), authentication failed, no network, or the ref already checked out at the clone path.","triggerScenarios":"clone_repository('https://github.com/org/nonexistent', ...) -> git exits 128 with 'repository not found'; cloning a private repo without credentials; proxy/firewall blocking github.com; DNS failure.","commonSituations":"Typo in the org/repo name; targeting a private repo in CI without an SSH key or token; corporate proxies rejecting git traffic; internet-down air-gapped environments.","solutions":["Read the {detail} portion — it is git's stderr and names the exact failure (not found, auth, timeout).","For private repos, ensure credentials exist: SSH agent/key for git@ URLs, or an https URL with a token (and GIT_ASKPASS/git credential helper configured).","Verify connectivity and the URL: git ls-remote <repo_url> from the same environment.","Check that /tmp/strix_repos/<run_name>/<repo> from a previous run is not blocking the clone; clear stale staging dirs."],"exampleFix":"# before\nstrix -n -t https://github.com/myorg/private-repo   # no creds in env\n\n# after\ngit ls-remote git@github.com:myorg/private-repo.git   # confirm SSH access works\nstrix -n -t git@github.com:myorg/private-repo.git","handlingStrategy":"try-catch","validationCode":"import subprocess\n\ndef can_reach_repo(repo_url: str) -> bool:\n    try:\n        subprocess.run([\"git\", \"ls-remote\", repo_url], check=True, capture_output=True, timeout=30)\n        return True\n    except (subprocess.SubprocessError, OSError):\n        return False\n\nif not can_reach_repo(repo_url):\n    raise SystemExit(f\"Cannot access {repo_url}: check the URL, credentials, and network\")","typeGuard":null,"tryCatchPattern":"try:\n    clone_path = clone_repository(repo_url, run_name)\nexcept ValueError as e:\n    if \"Could not clone repository\" in str(e):\n        detail = str(e.__cause__) if e.__cause__ else str(e)\n        if \"not found\" in detail.lower():\n            raise SystemExit(f\"Repo not found: {repo_url} (check org/name)\") from e\n        if \"authentication\" in detail.lower() or \"403\" in detail:\n            raise SystemExit(f\"Auth failed for {repo_url}: configure SSH keys or a token\") from e\n        raise SystemExit(f\"Clone failed: {detail}\") from e\n    raise","preventionTips":["Verify repo access with git ls-remote in the same environment/credentials before scanning","Use SSH URLs for private repos in CI with a configured deploy key","Clear stale /tmp/strix_repos/<run_name> dirs if re-running with the same run name"],"tags":["git","network","authentication","clone"],"backgroundTag":null,"analyzedSha":"85513391305171ecc6faffe03da4a8bda5e3febb","analyzedAt":"2026-08-15T05:03:57.275Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}