{"record":{"id":"3d840055d65fba80","repo":"unslothai/unsloth","slug":"the-pinned-spec-name-source-archive-is-not-confi","errorCode":null,"errorMessage":"The pinned {spec.name} source archive is not configured","messagePattern":"The pinned (.+?) source archive is not configured","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"studio/backend/utils/third_party_source.py","lineNumber":632,"sourceCode":"class _BoundedArchiveReader:\n    def __init__(self, handle, limit: int):\n        self._handle = handle\n        self._limit = limit\n        self._read = 0\n\n    def read(self, size: int = -1) -> bytes:\n        remaining = self._limit - self._read\n        requested = remaining + 1 if size < 0 else min(size, remaining + 1)\n        data = self._handle.read(requested)\n        self._read += len(data)\n        if self._read > self._limit:\n            raise RuntimeError(\"The pinned source archive expands too large\")\n        return data\n\n\ndef _install_archive_source(destination: Path, spec: PinnedSource) -> None:\n    if spec.archive_url is None or spec.source_tree_digest is None:\n        raise RuntimeError(f\"The pinned {spec.name} source archive is not configured\")\n    workspace = Path(tempfile.mkdtemp(prefix = \".archive-\", dir = destination.parent))\n    archive = workspace / \"source.tar.gz\"\n    staging = workspace / \"source\"\n    staging.mkdir()\n    try:\n        _download_archive(spec.archive_url, archive, spec)\n        member_count = 0\n        uncompressed_bytes = 0\n        extracted = set()\n        try:\n            with archive.open(\"rb\") as compressed:\n                with gzip.GzipFile(fileobj = compressed, mode = \"rb\") as decompressed:\n                    reader = _BoundedArchiveReader(decompressed, _ARCHIVE_MAX_TAR_BYTES)\n                    with tarfile.open(fileobj = reader, mode = \"r|\") as bundle:\n                        for member in bundle:\n                            member_count += 1\n                            if member_count > _ARCHIVE_MAX_MEMBERS:\n                                raise RuntimeError(","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/utils/third_party_source.py#L614-L650","documentation":"Guard at the top of _install_archive_source: the code path requires both spec.archive_url and spec.source_tree_digest, and refuses to run if either is None. Sealed (digest-pinned) archive installation is all-or-nothing by design — an archive without a verified tree digest would be an untrusted input.","triggerScenarios":"Constructing a PinnedSource with archive_url set but source_tree_digest None (or vice versa), or with both None while the environment/config routes installation through the archive path instead of the git-clone path.","commonSituations":"Hand-writing a PinnedSource entry and forgetting the digest; migrating config where a new archive_url field was added but digests were never populated; an internal-only package pinned without a published digest.","solutions":["Compute the digest for the pinned tree and set source_tree_digest (and runtime_tree_digest) — note ensure_pinned_source also enforces both digests configured together","If you cannot produce a digest, use the non-sealed configuration consistently: leave archive_url unset so the git-clone path is used with _checkout_manifest","Audit the PinnedSource construction site for partially-filled entries"],"exampleFix":"# before\nPinnedSource(\n    name=\"foo\", package=\"foo\", revision=SHA,\n    archive_url=\"https://codeload.github.com/org/foo/tar.gz/\" + SHA,\n    source_tree_digest=None,  # incomplete pin\n)\n\n# after\nPinnedSource(\n    name=\"foo\", package=\"foo\", revision=SHA,\n    archive_url=\"https://codeload.github.com/org/foo/tar.gz/\" + SHA,\n    source_tree_digest=compute_tree_digest(checkout),\n    runtime_tree_digest=compute_runtime_digest(...),\n)","handlingStrategy":"validation","validationCode":"assert spec.archive_url is not None and spec.source_tree_digest is not None, (\n    \"archive installation requires both archive_url and source_tree_digest\"\n)","typeGuard":"from dataclasses import is_dataclass\n\ndef pin_ready_for_archive_install(spec) -> bool:\n    return spec.archive_url is not None and spec.source_tree_digest is not None and spec.runtime_tree_digest is not None","tryCatchPattern":null,"preventionTips":["Validate PinnedSource records at config load time (all-or-nothing digest/URL fields) so startup fails fast with a clear message","Add a unit test asserting every shipped pin has paired digests"],"tags":["configuration","pinned-source","validation","digest"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}