jumpserver/jumpserver · error · FileExtractionError

File {uploaded.name} is not a valid PPTX presentation.

Error message

File {uploaded.name} is not a valid PPTX presentation.

What it means

_extract_pptx() finds no zip members matching ppt/slides/slideN.xml, meaning the archive contains no slides and is not a valid PPTX presentation.

Source

Thrown at apps/chat_ai/file_extractor.py:157

            raise FileExtractionError(f'File {uploaded.name} is not a valid DOCX document.')
        return _xml_text(archive.read('word/document.xml'))


def _natural_key(value):
    return [int(part) if part.isdigit() else part for part in re.split(r'(\d+)', value)]


def _extract_pptx(uploaded):
    with _open_office_archive(uploaded) as archive:
        slides = sorted(
            (
                name for name in archive.namelist()
                if re.fullmatch(r'ppt/slides/slide\d+\.xml', name)
            ),
            key=_natural_key,
        )
        if not slides:
            raise FileExtractionError(f'File {uploaded.name} is not a valid PPTX presentation.')
        return '\n\n'.join(
            f'[Slide {index}]\n{_xml_text(archive.read(name))}'
            for index, name in enumerate(slides[:200], start=1)
        )


def _extract_xlsx(uploaded, max_chars):
    with _open_office_archive(uploaded):
        pass
    uploaded.seek(0)
    workbook = load_workbook(uploaded, read_only=True, data_only=True)
    try:
        parts = []
        length = 0
        for sheet in workbook.worksheets:
            parts.append(f'[Sheet: {sheet.title}]')
            for row in sheet.iter_rows(values_only=True):
                values = ['' if value is None else str(value) for value in row]

View on GitHub (pinned to 6ec464fabd)

Solutions

  1. Ensure the presentation has at least one slide with content
  2. Re-save from PowerPoint/Keynote as standard .pptx
  3. Verify structure: unzip -l file.pptx | grep 'ppt/slides/'
Defensive patterns

Strategy: validation

Validate before calling

import zipfile, re
with zipfile.ZipFile(path) as z:
    slides = [n for n in z.namelist() if re.fullmatch(r'ppt/slides/slide\d+\.xml', n)]
    if not slides:
        reject_upload('Not a valid PPTX (no slides)')

Prevention

When it happens

Trigger: An empty presentation with zero slides, or a renamed zip that lacks the ppt/slides/ structure.

Common situations: Users uploading template files, empty decks, or renamed archives; also PPTX saved in unusual formats lacking standard slide parts.

Related errors


AI-assisted analysis of jumpserver/jumpserver@6ec464fabd (2026-08-28). Data as JSON: /api/errors/e5036fea37fd3385. Report an issue: GitHub.