{"record":{"id":"cec3c8d682f7eb84","repo":"coollabsio/coolify","slug":"failed-to-read-git-source-please-verify-repositor","errorCode":null,"errorMessage":"Failed to read Git source. Please verify repository access and try again.","messagePattern":"Failed to read Git source\\. Please verify repository access and try again\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Models/Application.php","lineNumber":2114,"sourceCode":"\n    public function loadComposeFile($isInit = false, ?string $restoreBaseDirectory = null, ?string $restoreDockerComposeLocation = null)\n    {\n        // Use provided restore values or capture current values as fallback\n        $initialDockerComposeLocation = $restoreDockerComposeLocation ?? $this->docker_compose_location;\n        $initialBaseDirectory = $restoreBaseDirectory ?? $this->base_directory;\n        if ($isInit && $this->docker_compose_raw) {\n            return;\n        }\n        $uuid = new_public_id();\n        ['commands' => $cloneCommand] = $this->generateGitImportCommands(deployment_uuid: $uuid, only_checkout: true, exec_in_docker: false, custom_base_dir: 'checkout');\n        $cloneCommand = $this->gitCommandsAsShellCommand($cloneCommand);\n        $cloneCommand = str_replace(' clone ', ' clone --quiet ', $cloneCommand);\n        $workdir = rtrim($this->base_directory, '/');\n        $composeFile = $this->docker_compose_location;\n        $fileList = collect([\".$workdir$composeFile\"]);\n        $gitRemoteStatus = $this->getGitRemoteStatus(deployment_uuid: $uuid);\n        if (! $gitRemoteStatus['is_accessible']) {\n            throw new RuntimeException('Failed to read Git source. Please verify repository access and try again.');\n        }\n        $getGitVersion = instant_remote_process(['git --version'], $this->destination->server, false);\n        $gitVersion = str($getGitVersion)->explode(' ')->last();\n\n        if (version_compare($gitVersion, '2.35.1', '<')) {\n            $fileList = $fileList->map(function ($file) {\n                $parts = explode('/', trim($file, '.'));\n                $paths = collect();\n                $currentPath = '';\n                foreach ($parts as $part) {\n                    $currentPath .= ($currentPath ? '/' : '').$part;\n                    if (str($currentPath)->isNotEmpty()) {\n                        $paths->push($currentPath);\n                    }\n                }\n\n                return $paths;\n            })->flatten()->unique()->values();","sourceCodeStart":2096,"sourceCodeEnd":2132,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Models/Application.php#L2096-L2132","documentation":"Before parsing a Docker Compose file straight from Git, Coolify performs getGitRemoteStatus(); when is_accessible comes back false the destination server could not authenticate to or read the repository at all, so it aborts with this message rather than attempting a clone. The concrete credential/network failure is in the underlying check, not in this message.","triggerScenarios":"Repository URL typo'd or renamed; private repo with an expired/revoked PAT, wrong deploy key, or GitHub App installation removed; destination server lacks outbound DNS/network to the git host; self-hosted Git (Gitea/GitLab) down.","commonSituations":"GitHub PATs with expiry dates lapsing; deploy keys regenerated after rotation; firewall blocking port 22/443 from the server; organization removed the Coolify GitHub App; switching servers to one without network egress to the git host.","solutions":["Use the application's Git settings connection test to surface the concrete auth error for the repo.","From the destination server run git ls-remote <url> with the same credential to confirm access and see the raw Git error.","Rotate/re-attach the credential (new PAT, reinstall the GitHub App, re-add the deploy key's public half to the repo).","Check outbound DNS/connectivity from the destination server to the git host if credentials are fine."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-flight before compose-from-git flows\n$gitRemoteStatus = $application->getGitRemoteStatus(deployment_uuid: $uuid);\nif (! $gitRemoteStatus['is_accessible']) { /* block with 'check URL/credentials/network' before cloning */ }","typeGuard":null,"tryCatchPattern":"catch (RuntimeException $e) { if (str_contains($e->getMessage(), 'Failed to read Git source')) { surface credential/network hint and the last getGitRemoteStatus error detail; no auto-retry until credentials verified. } else { throw $e; } }","preventionTips":["Run the repo connection test from the application settings after any credential change.","Monitor PAT expiry dates and GitHub App installations; rotate before they lapse.","From the destination server, keep a working 'git ls-remote' baseline for each repo."],"tags":["git","authentication","network","coolify"],"backgroundTag":"git-repository-access-failed","analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}