langchain-ai/deepagents · error · FleetImportError
{archive.filename}: too many zip entries
Error message
{archive.filename}: too many zip entries What it means
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.
Source
Thrown at libs/talon/deepagents_talon/fleet_import.py:229
name = _normalized_zip_name(info.filename)
if name is None:
continue
if _is_unsafe_zip_path(name):
msg = f"{info.filename}: unsafe zip path"
raise FleetImportError(msg)
if _is_symlink(info):
msg = f"{name}: symlink entries are not supported"
raise FleetImportError(msg)
if info.is_dir():
continue
_validate_zip_entry_size(name, info)
if len(entries) >= _MAX_ZIP_ENTRY_COUNT:
msg = f"{archive.filename}: too many zip entries"
raise FleetImportError(msg)
total_size += info.file_size
if total_size > _MAX_ZIP_UNCOMPRESSED_BYTES:
msg = f"{archive.filename}: zip uncompressed size exceeds limit"
raise FleetImportError(msg)
entries[name] = info
return entries
def _normalized_zip_name(name: str) -> str | None:
normalized = name.replace("\\", "/")
if not normalized or normalized.endswith("/"):
return None
return normalized
def _is_unsafe_zip_path(name: str) -> bool:
posix = PurePosixPath(name)
windows = PureWindowsPath(name)
return (
posix.is_absolute()
or windows.is_absolute()
or windows.drive != ""View on GitHub (pinned to a1af029e6e)
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
Example fix
# before: zips everything zip -r fleet.zip . // after: excludes junk zip -r fleet.zip AGENTS.md skills subagents -x 'node_modules/*' '.git/*'
Defensive patterns
Strategy: validation
Validate before calling
import zipfile
def count_zip_entries(path):
with zipfile.ZipFile(path) as z:
return len([zi for zi in z.infolist() if not zi.is_dir()])
if count_zip_entries(zip_path) >= 10_000:
raise ValueError("export exceeds 10,000 entries; trim before importing") Try / catch
try:
import_fleet_zip(zip_path, target_dir=target)
except FleetImportError as exc:
if "too many zip entries" in str(exc):
print("Trim the export below 10,000 entries (exclude node_modules, .git)")
raise Prevention
- Exclude dependency and VCS directories from exports
- Keep fleets modular; split huge exports
- Audit archive entry count before import
When it happens
Trigger: `import_fleet_zip` iterating `_validated_entries` reaches 10,000 accepted file entries before the archive is exhausted.
Common situations: Fleet exports that accidentally include `node_modules`, `.git`, virtualenvs, or generated artifacts; monorepo skill directories with thousands of files.
Related errors
- {name}: zip entry uncompressed size exceeds limit
- response_schema exceeds {_SCHEMA_MAX_BYTES} byte limit ({len
- response_schema exceeds maximum nesting depth of {_SCHEMA_MA
- response_schema exceeds maximum of {_SCHEMA_MAX_PROPERTIES}
- `max_ptc_calls` must be >= 1 or None
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/019494ac1716421d.
Report an issue: GitHub.