{"id":"d6245926751fb96c","repo":"python-poetry/poetry","slug":"error-failed-to-clone-info-url-check-your","errorCode":null,"errorMessage":"<error>Failed to clone <info>{url}</>, check your git configuration and permissions for this repository.</>","messagePattern":"<error>Failed to clone <info>(.+?)</>, check your git configuration and permissions for this repository\\.</>","errorType":"exception","errorClass":"PoetryRuntimeError","httpStatus":null,"severity":"error","filePath":"src/poetry/vcs/git/backend.py","lineNumber":293,"sourceCode":"    @staticmethod\n    def _clone_legacy(url: str, refspec: GitRefSpec, target: Path) -> Repo:\n        \"\"\"\n        Helper method to facilitate fallback to using system provided git client via\n        subprocess calls.\n        \"\"\"\n        from poetry.vcs.git.system import SystemGit\n\n        logger.debug(\"Cloning '%s' using system git client\", url)\n\n        if target.exists():\n            remove_directory(path=target, force=True)\n\n        revision = refspec.tag or refspec.branch or refspec.revision or \"HEAD\"\n\n        try:\n            SystemGit.clone(url, target)\n        except CalledProcessError as e:\n            raise PoetryRuntimeError.create(\n                reason=f\"<error>Failed to clone <info>{url}</>, check your git configuration and permissions for this repository.</>\",\n                exception=e,\n                info=[\n                    ERROR_MESSAGE_NOTE,\n                    ERROR_MESSAGE_PROBLEMS_SECTION_START_NETWORK_ISSUES,\n                    ERROR_MESSAGE_BAD_REMOTE.format(remote=url),\n                ],\n            )\n\n        if revision:\n            revision = revision.removeprefix(\"refs/heads/\")\n            revision = revision.removeprefix(\"refs/tags/\")\n\n        try:\n            SystemGit.checkout(revision, target)\n        except CalledProcessError as e:\n            raise PoetryRuntimeError.create(\n                reason=f\"<error>Failed to checkout {url} at '{revision}'.</>\",","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/python-poetry/poetry/blob/92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54/src/poetry/vcs/git/backend.py#L275-L311","documentation":"In the legacy clone path (_clone_legacy), Poetry falls back to the system `git` binary via SystemGit.clone. If that subprocess returns non-zero (CalledProcessError), it raises PoetryRuntimeError with hints to check git config and permissions. This is the 'system git clone failed' error, used when dulwich is not used for cloning.","triggerScenarios":"Cloning a git dependency via the system-git fallback when `git clone <url>` fails: wrong/unreachable URL, private repo without credentials, no network, proxy block, or git not installed.","commonSituations":"HTTPS private repo with no token configured; SSH repo without a deployed key; corporate proxy/firewall blocking the host; misspelled git URL; git missing on PATH.","solutions":["Manually run `git clone <url>` in a shell to reproduce and read git's own error.","Configure credentials: HTTPS via `poetry config http-basic.<repo>` or a token, SSH via a usable key + known_hosts.","Check network/proxy reachability and that git is installed and on PATH.","Correct the repository URL in pyproject.toml / source config."],"exampleFix":"# before - private https repo, no credentials\ngit = 'git+https://gitlab.internal/acme/lib.git'\n# after - configure auth and use a reachable url\npoetry config http-basic.gitlab '$USER' '$TOKEN'\ngit = 'git+https://gitlab.internal/acme/lib.git'","handlingStrategy":"try-catch","validationCode":"import subprocess\n\ndef git_clone_ok(url: str) -> bool:\n    return subprocess.run(\n        ['git', 'ls-remote', '--exit-code', url],\n        capture_output=True,\n    ).returncode == 0","typeGuard":null,"tryCatchPattern":"from poetry.exceptions import PoetryRuntimeError\ntry:\n    # operation that triggers a clone\n    ...\nexcept PoetryRuntimeError as e:\n    if 'Failed to clone' in str(e):\n        # check creds, network, url\n        raise","preventionTips":["Verify `git clone <url>` works manually first.","Configure HTTPS tokens or SSH keys for private repos.","Ensure git is installed and reachable through any proxy."],"tags":["git","vcs","clone","authentication","network"],"analyzedSha":"92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54","analyzedAt":"2026-08-04T20:33:34.072Z","schemaVersion":2}