{"record":{"id":"368797f13d204157","repo":"unslothai/unsloth","slug":"could-not-install-the-pinned-source-name-source","errorCode":null,"errorMessage":"Could not install the pinned {source_name} source: {detail}","messagePattern":"Could not install the pinned (.+?) source: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"studio/backend/utils/third_party_source.py","lineNumber":141,"sourceCode":"        return subprocess.run(\n            [\"git\", *_GIT_LONG_PATHS, *arguments],\n            check = True,\n            capture_output = True,\n            text = True,\n            encoding = \"utf-8\",\n            errors = \"replace\",\n            timeout = 300,\n            env = env,\n            **_windows_hidden_subprocess_kwargs(),\n        )\n    except FileNotFoundError as error:\n        raise RuntimeError(f\"Git is required to install the pinned {source_name} source\") from error\n    except subprocess.TimeoutExpired as error:\n        raise RuntimeError(f\"Timed out while installing the pinned {source_name} source\") from error\n    except subprocess.CalledProcessError as error:\n        detail = (error.stderr or error.stdout or \"\").strip()\n        message = f\"Could not install the pinned {source_name} source\"\n        raise RuntimeError(f\"{message}: {detail}\" if detail else message) from error\n\n\ndef _git_bytes(\n    arguments: list[str], *, source_name: str, input_data: bytes\n) -> subprocess.CompletedProcess:\n    env = child_env_without_native_path_secret()\n    env[\"GIT_TERMINAL_PROMPT\"] = \"0\"\n    env[\"GIT_LFS_SKIP_SMUDGE\"] = \"1\"\n    env[\"GIT_NO_REPLACE_OBJECTS\"] = \"1\"\n    try:\n        return subprocess.run(\n            [\"git\", *_GIT_LONG_PATHS, *arguments],\n            check = True,\n            capture_output = True,\n            input = input_data,\n            timeout = 300,\n            env = env,\n            **_windows_hidden_subprocess_kwargs(),","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/utils/third_party_source.py#L123-L159","documentation":"Raised by _git() when the git subprocess exits nonzero (CalledProcessError) — the git operation itself failed (auth, bad ref, disk full, corrupt cache). The handler extracts stderr or stdout as detail and appends it to 'Could not install the pinned {source_name} source', so the message carries git's own error text; if no output was captured, the bare message is raised.","triggerScenarios":"Any failing git invocation during pinned-source install: checkout of a tag that no longer exists upstream, permission denied on the cache directory, HTTP 404/403 fetching from a restricted remote, corrupt object database in a partially-cloned cache, or a replaced ref (GIT_NO_REPLACE_OBJECTS=1 is forced, so replace refs fail).","commonSituations":"Pinned tag/commit deleted or repo made private upstream; stale/corrupted local clone cache from an interrupted earlier install; disk full; credential prompts disabled (GIT_TERMINAL_PROMPT=0) on a repo requiring auth.","solutions":["Read the detail suffix — it is git's stderr and names the exact failure.","If the cache is corrupt or stale, delete the pinned source's cached clone directory and retry so it re-clones.","If the remote is private or the ref vanished, verify the pin (source_name's URL/tag) is still fetchable: run the same git fetch/clone manually.","Free disk space / fix permissions on the cache root if the detail says so."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"def pinned_source_cache_ok(cache_dir: Path) -> bool:\n    if not cache_dir.exists():\n        return True  # fresh clone will happen\n    r = subprocess.run(['git', '-C', str(cache_dir), 'fsck', '--no-progress'],\n                       capture_output=True, text=True)\n    return r.returncode == 0","typeGuard":null,"tryCatchPattern":"try:\n    install_pinned_source(source)\nexcept RuntimeError as e:\n    msg = str(e)\n    if 'Could not install the pinned' in msg:\n        detail = msg.split(':', 1)[-1].strip()\n        if 'fatal:' in detail or 'error:' in detail:\n            log.error('git failure: %s', detail)  # act on git's own message\n        if cache_dir.exists() and not pinned_source_cache_ok(cache_dir):\n            shutil.rmtree(cache_dir)\n            install_pinned_source(source)  # re-clone fixes corrupt cache\n    else:\n        raise","preventionTips":["On failure, prefer deleting the corrupt cached clone over retrying in place.","Keep pinned refs on reachable, public remotes — GIT_TERMINAL_PROMPT=0 means auth prompts fail hard.","Watch disk space; git fails messily on a full disk mid-fetch."],"tags":["git","dependency-install","subprocess","caching","python"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}