{"record":{"id":"95f0e6a0799d7757","repo":"stablyai/orca","slug":"clone-failed-getgitclonefailuremessage-message","errorCode":null,"errorMessage":"Clone failed: ${getGitCloneFailureMessage(message, { clonePath })}","messagePattern":"Clone failed: (.+?)\\)\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/repos.ts","lineNumber":554,"sourceCode":"      ['clone', '--progress', '--', args.url.trim(), repoName],\n      trimmedDestination,\n      {\n        signal: controller.signal,\n        timeoutMs: 10 * 60_000,\n        onProgress: (progress) => {\n          if (!mainWindow.isDestroyed()) {\n            mainWindow.webContents.send('repos:clone-progress', progress)\n          }\n        }\n      }\n    )\n  } catch (err) {\n    if (controller.signal.aborted) {\n      throw new Error('Clone aborted')\n    }\n    const message = err instanceof Error ? err.message : String(err)\n    if (message.startsWith('Clone failed:')) {\n      throw new Error(`Clone failed: ${getGitCloneFailureMessage(message, { clonePath })}`)\n    }\n    throw err\n  } finally {\n    if (activeRemoteClone === metadata) {\n      activeRemoteClone = null\n    }\n    remoteCloneInFlightByPath.delete(remoteCloneKey)\n  }\n  if (existing && isFolderRepo(existing)) {\n    const updated = store.updateRepo(existing.id, {\n      kind: 'git',\n      projectHostSetupMethod: 'cloned'\n    })\n    if (updated) {\n      emitRepoAdded('clone_url', false)\n      getActiveMultiplexer(args.connectionId)?.notify('session.registerRoot', {\n        rootPath: clonePath\n      })","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/repos.ts#L536-L572","documentation":"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.'","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the formatted message — getGitCloneFailureMessage already extracted the actionable 'fatal:' line and scrubbed credentials.","For 'destination already exists': pick a different parent, delete the existing folder, or 'add existing repository' instead of clone.","For auth failures: confirm SSH key / token has read access to the remote, then retry.","For network failures: retry; the scrubbed message will indicate if the remote vanished.","For unknown errors: run the same `git clone --progress -- <url> <name>` manually on the SSH host to see the full stderr."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import { getGitCloneFailureMessage } from '../../shared/git-clone-failure-message'\n\n// preview the likely failure message locally before showing clone UI\nfunction previewCloneFailure(stderr: string, clonePath: string): string {\n  return getGitCloneFailureMessage(stderr, { clonePath })\n}","typeGuard":"function isCloneFailed(err: unknown): boolean {\n  return err instanceof Error && err.message.startsWith('Clone failed:')\n}","tryCatchPattern":"try {\n  await cloneRemoteRepo(store, mainWindow, { connectionId, url, destination })\n} catch (err) {\n  if (isCloneFailed(err)) {\n    // message is already scrubbed of credentials and formatted with the actionable fatal line\n    surfaceUserError(err.message)\n    return\n  }\n  throw err\n}","preventionTips":["Verify the URL is reachable and the SSH key/token has read access before cloning.","Pick an empty destination parent directory; if it exists and is non-empty, use 'add existing repository' instead of clone.","Never embed credentials in the clone URL — getGitCloneFailureMessage scrubs them but other log paths may not.","For opaque failures, run `git clone --progress -- <url> <name>` manually on the SSH host to see full stderr."],"tags":["ssh","clone","git","stderr","credentials","remote"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}