stablyai/orca · error · Error

Clone failed: ${getGitCloneFailureMessage(message, { clonePa

Error message

Clone failed: ${getGitCloneFailureMessage(message, { clonePath })}

What it means

Thrown in the clone catch block when the caught error message starts with 'Clone failed:' — the prefix the SSH git provider uses for git stderr-derived failures. The rethrow wraps getGitCloneFailureMessage(message, { clonePath }), which scrubs embedded credentials, walks stderr lines from the end, and formats the first 'fatal:'/'error:' line. Common remap: 'destination path already exists' becomes 'Destination already exists and is not empty: <path>. Choose a different parent folder, delete the existing folder, or add the existing repository instead.'

Source

Thrown at src/main/ipc/repos.ts:554

      ['clone', '--progress', '--', args.url.trim(), repoName],
      trimmedDestination,
      {
        signal: controller.signal,
        timeoutMs: 10 * 60_000,
        onProgress: (progress) => {
          if (!mainWindow.isDestroyed()) {
            mainWindow.webContents.send('repos:clone-progress', progress)
          }
        }
      }
    )
  } catch (err) {
    if (controller.signal.aborted) {
      throw new Error('Clone aborted')
    }
    const message = err instanceof Error ? err.message : String(err)
    if (message.startsWith('Clone failed:')) {
      throw new Error(`Clone failed: ${getGitCloneFailureMessage(message, { clonePath })}`)
    }
    throw err
  } finally {
    if (activeRemoteClone === metadata) {
      activeRemoteClone = null
    }
    remoteCloneInFlightByPath.delete(remoteCloneKey)
  }
  if (existing && isFolderRepo(existing)) {
    const updated = store.updateRepo(existing.id, {
      kind: 'git',
      projectHostSetupMethod: 'cloned'
    })
    if (updated) {
      emitRepoAdded('clone_url', false)
      getActiveMultiplexer(args.connectionId)?.notify('session.registerRoot', {
        rootPath: clonePath
      })

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Read the formatted message — getGitCloneFailureMessage already extracted the actionable 'fatal:' line and scrubbed credentials.
  2. For 'destination already exists': pick a different parent, delete the existing folder, or 'add existing repository' instead of clone.
  3. For auth failures: confirm SSH key / token has read access to the remote, then retry.
  4. For network failures: retry; the scrubbed message will indicate if the remote vanished.
  5. For unknown errors: run the same `git clone --progress -- <url> <name>` manually on the SSH host to see the full stderr.
Defensive patterns

Strategy: try-catch

Validate before calling

import { getGitCloneFailureMessage } from '../../shared/git-clone-failure-message'

// preview the likely failure message locally before showing clone UI
function previewCloneFailure(stderr: string, clonePath: string): string {
  return getGitCloneFailureMessage(stderr, { clonePath })
}

Type guard

function isCloneFailed(err: unknown): boolean {
  return err instanceof Error && err.message.startsWith('Clone failed:')
}

Try / catch

try {
  await cloneRemoteRepo(store, mainWindow, { connectionId, url, destination })
} catch (err) {
  if (isCloneFailed(err)) {
    // message is already scrubbed of credentials and formatted with the actionable fatal line
    surfaceUserError(err.message)
    return
  }
  throw err
}

Prevention

When it happens

Trigger: gitProvider.clone threw an Error whose message starts with 'Clone failed:' — i.e. git ran on the remote and returned a non-zero exit with stderr. Examples: 'repository not found', authentication failed, destination exists and is not empty, network dropped mid-clone.

Common situations: Wrong URL or private repo the user can't access; SSH key lacking read permission; destination folder already populated; remote disconnected mid-clone; git credentials embedded in the URL expired; disk full on the remote host.

Related errors


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