{"record":{"id":"8d6d5a606dd0a66e","repo":"EveryInc/compound-engineering-plugin","slug":"failed-to-clone-source-stderr-trim","errorCode":null,"errorMessage":"Failed to clone ${source}. ${stderr.trim()}","messagePattern":"Failed to clone (.+?)\\. (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/commands/install.ts","lineNumber":341,"sourceCode":"\nfunction resolveGitHubSource(): string {\n  const override = process.env.COMPOUND_PLUGIN_GITHUB_SOURCE\n  if (override && override.trim()) return override.trim()\n  return \"https://github.com/EveryInc/compound-engineering-plugin\"\n}\n\nasync function cloneGitHubRepo(source: string, destination: string, branch?: string): Promise<void> {\n  const args = [\"git\", \"clone\", \"--depth\", \"1\"]\n  if (branch) args.push(\"--branch\", branch)\n  args.push(source, destination)\n  const proc = Bun.spawn(args, {\n    stdout: \"pipe\",\n    stderr: \"pipe\",\n  })\n  const exitCode = await proc.exited\n  const stderr = await new Response(proc.stderr).text()\n  if (exitCode !== 0) {\n    throw new Error(`Failed to clone ${source}. ${stderr.trim()}`)\n  }\n}\n","sourceCodeStart":323,"sourceCodeEnd":344,"githubUrl":"https://github.com/EveryInc/compound-engineering-plugin/blob/c9c10f8c75412c7232cb2bd663e5fd1cea98d84e/src/commands/install.ts#L323-L344","documentation":"During by-name installation the CLI shells out to `git clone <source> <tempdir>` via Bun.spawn. If git exits non-zero — bad URL, missing repo, no network, auth failure — the command surfaces git's stderr verbatim in this error so the underlying cause is visible.","triggerScenarios":"Calling `install <plugin-name>` when the git clone of the source repo fails: repo does not exist or is private (auth needed), no network/DNS failure, COMPOUND_PLUGIN_GITHUB_SOURCE set to an invalid URL, git not on PATH produces its own error, or proxy/firewall blocks github.com.","commonSituations":"Offline or corporate-proxy environment; SSH vs HTTPS mismatch for private repos; expired credentials/token; COMPOUND_PLUGIN_GITHUB_SOURCE typo; rate limiting or VPN issues.","solutions":["Read the stderr text embedded in the message — it is git's own diagnosis; fix that first.","Verify the source URL: `git ls-remote <source>` (or check COMPOUND_PLUGIN_GITHUB_SOURCE if set).","Check network/proxy connectivity to github.com; retry when offline.","For private repos, configure credentials (gh auth login, ssh keys, or token-based HTTPS).","Fall back to a local path: `install ./path/to/cloned/plugin`."],"exampleFix":"// before (message tail: 'Repository not found')\nCOMPOUND_PLUGIN_GITHUB_SOURCE=git@github.com:me/wrong-repo.git install compound-engineering\n// after\nunset COMPOUND_PLUGIN_GITHUB_SOURCE  # use the default marketplace source\ninstall compound-engineering","handlingStrategy":"retry","validationCode":"// Pre-flight: check the remote is reachable before install\nconst { exitCode } = Bun.spawnSync([\"git\", \"ls-remote\", source, \"HEAD\"])\nif (exitCode !== 0) throw new Error(`Cannot reach ${source}; fix network/auth first`)","typeGuard":null,"tryCatchPattern":"try {\n  await install(pluginName)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith(\"Failed to clone\")) {\n    // e.message contains git's stderr; retry with backoff on transient network errors\n    await sleep(2000)\n    await install(pluginName)\n  } else throw e\n}","preventionTips":["Run `git ls-remote <source>` before scripted installs to catch auth/network issues early.","Configure credentials once (gh auth login / ssh keys) for private sources.","Avoid typos in COMPOUND_PLUGIN_GITHUB_SOURCE; test it with ls-remote.","Retry transient failures instead of reinstalling from a changed source."],"tags":["git","clone","network","github"],"backgroundTag":"git-clone-failed","analyzedSha":"c9c10f8c75412c7232cb2bd663e5fd1cea98d84e","analyzedAt":"2026-08-31T15:18:07.959Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}