stablyai/orca · error

SSH Git provider is not available. Reconnect to this target

Error message

SSH Git provider is not available. Reconnect to this target and try again.

What it means

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.

Source

Thrown at src/main/gitlab/mr-head-tracking-ref.ts:48

  if (!isSafeReviewHeadFetchRemote(remote)) {
    throw new Error('Merge request fetch remote must not start with "-".')
  }
  if (!repo.connectionId) {
    const localGitExecOptions = options.localGitExecOptions ?? { cwd: repo.path }
    const remoteComponent = await getReviewHeadRemoteComponent(remote, localGitExecOptions)
    // Why: return the same path the fetch wrote so callers don't re-resolve identity.
    const localRef = gitlabMergeRequestHeadLocalRef(remoteComponent, mrIid)
    await gitExecFileAsync(
      ['fetch', '--no-tags', remote, `+refs/merge-requests/${mrIid}/head:${localRef}`],
      {
        ...localGitExecOptions,
        timeout: REVIEW_HEAD_FETCH_TIMEOUT_MS
      }
    )
    return localRef
  }
  if (!sshGitProvider) {
    throw new Error('SSH Git provider is not available. Reconnect to this target and try again.')
  }
  return sshGitProvider.fetchGitLabMergeRequestHead(repo.path, remote, mrIid)
}

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Reconnect to the SSH/remote target so the sshGitProvider is re-established, then retry the fetch.
  2. Ensure the caller passes the current sshGitProvider instance (not a stale/closed one) when connectionId is set.
  3. If the connection is permanently gone, surface a reconnect prompt to the user rather than retrying blindly.
Defensive patterns

Strategy: try-catch

Type guard

function hasSshGitProvider(provider: unknown): provider is SshGitProvider {
  return provider !== null && provider !== undefined
    && typeof (provider as SshGitProvider).fetchGitLabMergeRequestHead === 'function'
}

Try / catch

try {
  return await fetchGitLabMergeRequestHeadRef(repo, sshGitProvider, remote, mrIid, options)
} catch (error) {
  if (error instanceof Error && /SSH Git provider is not available/.test(error.message)) {
    await promptReconnect(repo.connectionId)
    return await fetchGitLabMergeRequestHeadRef(repo, refreshedProvider, remote, mrIid, options)
  }
  throw error
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/917d49f89121f0dd. Report an issue: GitHub.