{"record":{"id":"917d49f89121f0dd","repo":"stablyai/orca","slug":"ssh-git-provider-is-not-available-reconnect-to-th-917d49","errorCode":null,"errorMessage":"SSH Git provider is not available. Reconnect to this target and try again.","messagePattern":"SSH Git provider is not available\\. Reconnect to this target and try again\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main/gitlab/mr-head-tracking-ref.ts","lineNumber":48,"sourceCode":"  if (!isSafeReviewHeadFetchRemote(remote)) {\n    throw new Error('Merge request fetch remote must not start with \"-\".')\n  }\n  if (!repo.connectionId) {\n    const localGitExecOptions = options.localGitExecOptions ?? { cwd: repo.path }\n    const remoteComponent = await getReviewHeadRemoteComponent(remote, localGitExecOptions)\n    // Why: return the same path the fetch wrote so callers don't re-resolve identity.\n    const localRef = gitlabMergeRequestHeadLocalRef(remoteComponent, mrIid)\n    await gitExecFileAsync(\n      ['fetch', '--no-tags', remote, `+refs/merge-requests/${mrIid}/head:${localRef}`],\n      {\n        ...localGitExecOptions,\n        timeout: REVIEW_HEAD_FETCH_TIMEOUT_MS\n      }\n    )\n    return localRef\n  }\n  if (!sshGitProvider) {\n    throw new Error('SSH Git provider is not available. Reconnect to this target and try again.')\n  }\n  return sshGitProvider.fetchGitLabMergeRequestHead(repo.path, remote, mrIid)\n}\n","sourceCodeStart":30,"sourceCodeEnd":52,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/gitlab/mr-head-tracking-ref.ts#L30-L52","documentation":"Thrown by fetchGitLabMergeRequestHeadRef when repo.connectionId is set (the repo lives on an SSH/remote host whose git.exec channel is read-only and rejects `fetch`) but no sshGitProvider was supplied. The dedicated RPC provider is mandatory for fetching MR head refs over an SSH connection; without it the fetch cannot run.","triggerScenarios":"Calling fetchGitLabMergeRequestHeadRef for a repo bound to a remote/SSH target (connectionId set) after the SSH session dropped, the provider was torn down, or the caller forgot to pass the sshGitProvider argument.","commonSituations":"SSH connection timed out or was closed by the host; reconnect/restart of the remote target cleared the provider; a code path that handles both local and SSH repos but doesn't thread the provider through; race between disconnect and a pending MR-head fetch.","solutions":["Reconnect to the SSH/remote target so the sshGitProvider is re-established, then retry the fetch.","Ensure the caller passes the current sshGitProvider instance (not a stale/closed one) when connectionId is set.","If the connection is permanently gone, surface a reconnect prompt to the user rather than retrying blindly."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function hasSshGitProvider(provider: unknown): provider is SshGitProvider {\n  return provider !== null && provider !== undefined\n    && typeof (provider as SshGitProvider).fetchGitLabMergeRequestHead === 'function'\n}","tryCatchPattern":"try {\n  return await fetchGitLabMergeRequestHeadRef(repo, sshGitProvider, remote, mrIid, options)\n} catch (error) {\n  if (error instanceof Error && /SSH Git provider is not available/.test(error.message)) {\n    await promptReconnect(repo.connectionId)\n    return await fetchGitLabMergeRequestHeadRef(repo, refreshedProvider, remote, mrIid, options)\n  }\n  throw error\n}","preventionTips":["Pass the live sshGitProvider instance whenever repo.connectionId is set.","Handle provider teardown before enqueuing fetches, or cancel in-flight fetches on disconnect.","Surface a reconnect prompt immediately when the provider is missing for a connected repo."],"tags":["ssh","gitlab","connection","remote-host","fetch"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}