{"record":{"id":"d15308570cf416b2","repo":"unslothai/unsloth","slug":"the-pinned-spec-name-archive-expands-too-large","errorCode":null,"errorMessage":"The pinned {spec.name} archive expands too large","messagePattern":"The pinned (.+?) archive expands too large","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"studio/backend/utils/third_party_source.py","lineNumber":662,"sourceCode":"                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(\n                                    f\"The pinned {spec.name} archive has too many entries\"\n                                )\n                            parts = _archive_member_parts(member, spec)\n                            if member.isdir():\n                                continue\n                            if not member.isfile() or member.size < 0:\n                                raise RuntimeError(\n                                    f\"The pinned {spec.name} archive contains a non-regular file\"\n                                )\n                            uncompressed_bytes += member.size\n                            if uncompressed_bytes > _ARCHIVE_MAX_UNCOMPRESSED_BYTES:\n                                raise RuntimeError(\n                                    f\"The pinned {spec.name} archive expands too large\"\n                                )\n                            if len(parts) < 3 or parts[1] != spec.package:\n                                continue\n                            relative = \"/\".join(parts[1:])\n                            _package_path_parts(relative, spec, kind = \"archive\")\n                            if relative in extracted:\n                                raise RuntimeError(\n                                    f\"The pinned {spec.name} archive contains duplicate files\"\n                                )\n                            extracted.add(relative)\n                            source_file = bundle.extractfile(member)\n                            if source_file is None:\n                                raise RuntimeError(\n                                    f\"The pinned {spec.name} archive contains an unreadable file\"\n                                )\n                            destination_file = staging.joinpath(*parts[1:])\n                            destination_file.parent.mkdir(parents = True, exist_ok = True)","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/utils/third_party_source.py#L644-L680","documentation":"Running sum of every member.size (for regular files) is compared against _ARCHIVE_MAX_UNCOMPRESSED_BYTES; exceeding it aborts extraction. Distinct from the 1586 cap (which bounds raw decompressed TAR stream bytes via _BoundedArchiveReader, _ARCHIVE_MAX_TAR_BYTES), this bounds the declared file payload that would actually land on disk.","triggerScenarios":"Sum of member.size across all regular-file entries in the archive exceeds _ARCHIVE_MAX_UNCOMPRESSED_BYTES while iterating — e.g. a legitimate tree larger than the on-disk budget, or headers declaring huge sizes (the copy loop would attempt to write member.size bytes per file).","commonSituations":"Vendoring large binary assets in the dependency's repo; generated-data-heavy packages; mismatch between _ARCHIVE_MAX_TAR_BYTES and this tighter on-disk cap causing big-but-legal archives to fail here.","solutions":["Estimate extracted size: tar -tzvf source.tar.gz | awk '{s+=$3} END {print s}' and compare with _ARCHIVE_MAX_UNCOMPRESSED_BYTES","Repin to a subtree export containing only spec.package's files instead of the whole snapshot","If legitimate, raise _ARCHIVE_MAX_UNCOMPRESSED_BYTES (and companion caps) in your build after checking available disk","Confirm the digest matches the pin to rule out a crafted header attack"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import tarfile\ntotal = 0\nwith tarfile.open(\"source.tar.gz\") as tf:\n    for m in tf:\n        if m.isfile():\n            total += m.size\nassert total <= _ARCHIVE_MAX_UNCOMPRESSED_BYTES, f\"payload {total} exceeds disk cap\"","typeGuard":null,"tryCatchPattern":"try:\n    ensure_pinned_source(spec)\nexcept RuntimeError as e:\n    if \"expands too large\" in str(e):\n        # distinguish via pre-checks which cap tripped; trim the export or adjust the constant","preventionTips":["Exclude vendored binaries and generated data from pinned exports","Check available disk on the cache volume before bootstrap; the caps exist partly to protect it"],"tags":["tarfile","resource-limit","disk-usage","extraction"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}