{"record":{"id":"5f2191f2b90eedf8","repo":"google-gemini/gemini-cli","slug":"failed-to-clone-repository-e","errorCode":null,"errorMessage":"Failed to clone repository: {e}","messagePattern":"Failed to clone repository: (.+?)","errorType":"exception","errorClass":"OrchestrationError","httpStatus":null,"severity":"error","filePath":"tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py","lineNumber":127,"sourceCode":"            try:\n                CommandExecutor.run([\"git\", \"reset\", \"--hard\", \"HEAD\"], self.config.pr_repo_path)\n                CommandExecutor.run([\"git\", \"clean\", \"-fd\"], self.config.pr_repo_path)\n                CommandExecutor.run([\"git\", \"checkout\", \"main\"], self.config.pr_repo_path)\n                CommandExecutor.run([\"git\", \"pull\", \"origin\", \"main\"], self.config.pr_repo_path)\n            except CommandExecutionError as e:\n                logging.warning(\"Repository sync failed: %s. Re-cloning from scratch.\", e)\n                try:\n                    shutil.rmtree(self.config.pr_repo_path)\n                except OSError as rm_err:\n                    logging.error(\"Failed to remove existing repo path: %s\", rm_err)\n                repo_exists = False\n\n        if not repo_exists:\n            logging.info(\"Cloning repository %s into %s\", self.config.repo_url, self.config.pr_dir)\n            try:\n                CommandExecutor.run([\"git\", \"clone\", self.config.repo_url, self.config.repo_name], self.config.pr_dir)\n            except CommandExecutionError as e:\n                raise OrchestrationError(f\"Failed to clone repository: {e}\") from e\n\n            # Establish safe bot git identity\n            CommandExecutor.run([\"git\", \"config\", \"user.name\", \"Jetski Bot\"], self.config.pr_repo_path)\n            CommandExecutor.run([\"git\", \"config\", \"user.email\", \"jetski-bot@google.com\"], self.config.pr_repo_path)\n\n            # Ignore agent/orch file writes to prevent pollution of git status\n            exclude_file = os.path.join(self.config.pr_repo_path, \".git\", \"info\", \"exclude\")\n            os.makedirs(os.path.dirname(exclude_file), exist_ok=True)\n            try:\n                with open(exclude_file, \"a\", encoding=\"utf-8\") as f:\n                    f.write(\n                        \"\\nfirestore_doc.json\\npr_feedback.md\\nfeedback.md\\n\"\n                        \"changes.diff\\nverdict.json\\npr_details.md\\n\"\n                    )\n            except IOError as io_err:\n                logging.warning(\"Failed to configure git exclude file: %s\", io_err)\n\n    async def run(self) -> None:","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py#L109-L145","documentation":"Error \"Failed to clone repository: {e}\" thrown in google-gemini/gemini-cli.","triggerScenarios":"Thrown at tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py:127 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}