google-gemini/gemini-cli · error · OrchestrationError

Failed to clone repository: {e}

Error message

Failed to clone repository: {e}

What it means

Error "Failed to clone repository: {e}" thrown in google-gemini/gemini-cli.

Source

Thrown at tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py:127

            try:
                CommandExecutor.run(["git", "reset", "--hard", "HEAD"], self.config.pr_repo_path)
                CommandExecutor.run(["git", "clean", "-fd"], self.config.pr_repo_path)
                CommandExecutor.run(["git", "checkout", "main"], self.config.pr_repo_path)
                CommandExecutor.run(["git", "pull", "origin", "main"], self.config.pr_repo_path)
            except CommandExecutionError as e:
                logging.warning("Repository sync failed: %s. Re-cloning from scratch.", e)
                try:
                    shutil.rmtree(self.config.pr_repo_path)
                except OSError as rm_err:
                    logging.error("Failed to remove existing repo path: %s", rm_err)
                repo_exists = False

        if not repo_exists:
            logging.info("Cloning repository %s into %s", self.config.repo_url, self.config.pr_dir)
            try:
                CommandExecutor.run(["git", "clone", self.config.repo_url, self.config.repo_name], self.config.pr_dir)
            except CommandExecutionError as e:
                raise OrchestrationError(f"Failed to clone repository: {e}") from e

            # Establish safe bot git identity
            CommandExecutor.run(["git", "config", "user.name", "Jetski Bot"], self.config.pr_repo_path)
            CommandExecutor.run(["git", "config", "user.email", "jetski-bot@google.com"], self.config.pr_repo_path)

            # Ignore agent/orch file writes to prevent pollution of git status
            exclude_file = os.path.join(self.config.pr_repo_path, ".git", "info", "exclude")
            os.makedirs(os.path.dirname(exclude_file), exist_ok=True)
            try:
                with open(exclude_file, "a", encoding="utf-8") as f:
                    f.write(
                        "\nfirestore_doc.json\npr_feedback.md\nfeedback.md\n"
                        "changes.diff\nverdict.json\npr_details.md\n"
                    )
            except IOError as io_err:
                logging.warning("Failed to configure git exclude file: %s", io_err)

    async def run(self) -> None:

View on GitHub (pinned to 5024443c72)

When it happens

Trigger: Thrown at tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py:127 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of google-gemini/gemini-cli@5024443c72 (2026-08-12). Data as JSON: /api/errors/5f2191f2b90eedf8. Report an issue: GitHub.