{"record":{"id":"019494ac1716421d","repo":"langchain-ai/deepagents","slug":"archive-filename-too-many-zip-entries","errorCode":null,"errorMessage":"{archive.filename}: too many zip entries","messagePattern":"(.+?): too many zip entries","errorType":"error_code","errorClass":"FleetImportError","httpStatus":null,"severity":"error","filePath":"libs/talon/deepagents_talon/fleet_import.py","lineNumber":229,"sourceCode":"        name = _normalized_zip_name(info.filename)\n        if name is None:\n            continue\n        if _is_unsafe_zip_path(name):\n            msg = f\"{info.filename}: unsafe zip path\"\n            raise FleetImportError(msg)\n        if _is_symlink(info):\n            msg = f\"{name}: symlink entries are not supported\"\n            raise FleetImportError(msg)\n        if info.is_dir():\n            continue\n        _validate_zip_entry_size(name, info)\n        if len(entries) >= _MAX_ZIP_ENTRY_COUNT:\n            msg = f\"{archive.filename}: too many zip entries\"\n            raise FleetImportError(msg)\n        total_size += info.file_size\n        if total_size > _MAX_ZIP_UNCOMPRESSED_BYTES:\n            msg = f\"{archive.filename}: zip uncompressed size exceeds limit\"\n            raise FleetImportError(msg)\n        entries[name] = info\n    return entries\n\n\ndef _normalized_zip_name(name: str) -> str | None:\n    normalized = name.replace(\"\\\\\", \"/\")\n    if not normalized or normalized.endswith(\"/\"):\n        return None\n    return normalized\n\n\ndef _is_unsafe_zip_path(name: str) -> bool:\n    posix = PurePosixPath(name)\n    windows = PureWindowsPath(name)\n    return (\n        posix.is_absolute()\n        or windows.is_absolute()\n        or windows.drive != \"\"","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/talon/deepagents_talon/fleet_import.py#L211-L247","documentation":"The archive contains more than `_MAX_ZIP_ENTRY_COUNT` (10,000) non-directory entries. The library caps entry count to bound extraction work and avoid resource exhaustion from zip bombs or bloated exports. The archive filename is reported.","triggerScenarios":"`import_fleet_zip` iterating `_validated_entries` reaches 10,000 accepted file entries before the archive is exhausted.","commonSituations":"Fleet exports that accidentally include `node_modules`, `.git`, virtualenvs, or generated artifacts; monorepo skill directories with thousands of files.","solutions":["Slim the export: exclude dependency/cache directories (`node_modules`, `.git`, `__pycache__`) before zipping","Check the entry count first: `len([n for n in zipfile.ZipFile(p).namelist() if not n.endswith('/')])` and trim below 10,000","Split the fleet into multiple imports or ship skills as separate packages","Regenerate the export from source control with a clean file list"],"exampleFix":"# before: zips everything\nzip -r fleet.zip .\n// after: excludes junk\nzip -r fleet.zip AGENTS.md skills subagents -x 'node_modules/*' '.git/*'","handlingStrategy":"validation","validationCode":"import zipfile\n\ndef count_zip_entries(path):\n    with zipfile.ZipFile(path) as z:\n        return len([zi for zi in z.infolist() if not zi.is_dir()])\n\nif count_zip_entries(zip_path) >= 10_000:\n    raise ValueError(\"export exceeds 10,000 entries; trim before importing\")","typeGuard":null,"tryCatchPattern":"try:\n    import_fleet_zip(zip_path, target_dir=target)\nexcept FleetImportError as exc:\n    if \"too many zip entries\" in str(exc):\n        print(\"Trim the export below 10,000 entries (exclude node_modules, .git)\")\n    raise","preventionTips":["Exclude dependency and VCS directories from exports","Keep fleets modular; split huge exports","Audit archive entry count before import"],"tags":["zip","limits","resource-exhaustion"],"backgroundTag":"zip-entry-limit-exceeded","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}