HKUDS/DeepTutor · error · ManimRenderError
Rendered {suffix} artifact not found.
Error message
Rendered {suffix} artifact not found. What it means
Raised by _validate_epub_archive as DocumentTooLargeError when a non-directory member count exceeds _EPUB_MAX_MEMBERS. It is a zip-bomb / resource-exhaustion guard applied before any member is read.
Source
Thrown at deeptutor/agents/math_animator/renderer.py:219
)
async def _emit_progress(self, message: str, raw: bool = False) -> None:
if self.progress_callback is None:
return
await self.progress_callback(message, raw)
def _find_rendered_file(self, suffix: str) -> Path:
# Manim stores many transient chunks under ``partial_movie_files``.
# We only want the final exported artifact for the scene.
matches = [
path
for path in self.media_dir.rglob(f"*{suffix}")
if "partial_movie_files" not in path.parts
]
if not matches:
matches = list(self.media_dir.rglob(f"*{suffix}"))
if not matches:
raise ManimRenderError(f"Rendered {suffix} artifact not found.")
return max(matches, key=lambda path: path.stat().st_mtime)
@staticmethod
def _extract_scene_name(code: str) -> str:
match = SCENE_PATTERN.search(code)
if not match:
raise ManimRenderError("Generated code does not define a renderable Manim Scene class.")
return match.group(1)
def _build_artifact(
self,
artifact_path: Path,
artifact_type: str,
content_type: str,
label: str,
) -> RenderedArtifact:
rel_path = artifact_path.resolve().relative_to(self.path_service.user_data_dir.resolve())
return RenderedArtifact(View on GitHub (pinned to 3e82f13042)
Solutions
- Rebuild/normalize the EPUB (ebook-convert) to reduce member count
- Reject the file upstream with a clear size/complexity limit in the upload UI
- Catch DocumentTooLargeError and skip with a warning during batch ingest
Example fix
// before
text = extract_text_from_bytes(data, filename="huge.epub") # raises
// after
subprocess.run(["ebook-convert","huge.epub","huge2.epub"], check=True) # normalizes archive
text = extract_text_from_bytes(Path("huge2.epub").read_bytes(), filename="huge2.epub") Defensive patterns
Strategy: validation
Validate before calling
import zipfile, io
zf = zipfile.ZipFile(io.BytesIO(data))
members = [i for i in zf.infolist() if not i.is_dir()]
if len(members) > 10_000: # mirror _EPUB_MAX_MEMBERS
reject(fn, "EPUB too complex") Try / catch
from deeptutor.utils.document_extractor import DocumentTooLargeError
except DocumentTooLargeError as e:
if "too many archive members" in str(e):
skip_file(fn, reason=e) Prevention
- Apply archive-complexity limits at the upload boundary
- Normalize EPUBs through Calibre before ingestion
When it happens
Trigger: Ingesting an EPUB with tens of thousands of archive entries; a maliciously crafted EPUB designed to exhaust file handles or memory during member iteration.
Common situations: User-created EPUBs from tools that emit one file per HTML fragment; adversarial uploads to a public ingestion endpoint.
Related errors
- Generated code does not define a renderable Manim Scene clas
- Math animator config must be an object.
- Invalid math animator config: {details}
- Model not configured for agent {self.agent_name}. Please act
- The model provider interrupted this response. Please retry.
AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27).
Data as JSON: /api/errors/dc0d428dfc2aea20.
Report an issue: GitHub.