HKUDS/DeepTutor · error · HTTPException

PageIndex knowledge bases accept

Error message

PageIndex knowledge bases accept: {supported}. Unsupported: {', '.join(unsupported[:5])}.

What it means

Raised by _enforce_provider_formats when one or more files in an upload batch have extensions outside the provider's allowed set (Page Index zip archives are the one exemption). HTTP 400; the message lists the supported extensions and up to five offending filenames.

Solutions

  1. Convert offending files to one of the supported extensions listed in the message
  2. Bundle mixed files into a .zip (explicitly allowed for PageIndex) and upload that
  3. Filter the batch client-side against the provider's extension list before sending

Example fix

# before
upload(files=['slides.pptx'])
# after
upload(files=['slides.pdf'])  # or zip the bundle
Defensive patterns

Strategy: validation

Validate before calling

exts = fetch_allowed_extensions(provider)  # from provider metadata
bad = [f for f in files if Path(f.filename).suffix.lower() not in exts
       and not (provider=='pageindex' and f.filename.lower().endswith('.zip'))]
assert not bad, bad

Prevention

When it happens

Trigger: Uploading to a PageIndex KB with files like .docx/.mp4 that the provider cannot ingest (only its documented formats, plus .zip bundles, pass).

Common situations: Mixing general document uploads with a provider that only accepts a narrow format list; converting files to a format the provider rejects; forgetting to zip a bundle of supported types.

Related errors


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/c71410249749c76f. Report an issue: GitHub.

Appendix: source

Thrown at deeptutor/api/routers/knowledge.py:749

    from deeptutor.services.rag.pipelines.pageindex.pipeline import (
        OSS_SUPPORTED_EXTENSIONS,
        SUPPORTED_EXTENSIONS,
    )

    extensions = (
        OSS_SUPPORTED_EXTENSIONS if provider == PAGEINDEX_OSS_PROVIDER else SUPPORTED_EXTENSIONS
    )

    unsupported = [
        f.filename
        for f in files
        if f.filename
        and not (provider == PAGEINDEX_PROVIDER and f.filename.lower().endswith(".zip"))
        and Path(f.filename).suffix.lower() not in extensions
    ]
    if unsupported:
        supported = ", ".join(sorted(extensions))
        raise HTTPException(
            status_code=400,
            detail=(
                f"PageIndex knowledge bases accept: {supported}. "
                f"Unsupported: {', '.join(unsupported[:5])}."
            ),
        )


def _resolve_registered_kb_name(manager: KnowledgeBaseManager, kb_name: str | None) -> str:
    """Resolve route-level default aliases to the configured default KB."""
    requested = str(kb_name or "").strip()
    kb_names = manager.list_knowledge_bases()
    if requested and requested in kb_names:
        return requested

    if requested.lower() in DEFAULT_KB_ALIASES:
        default_kb = manager.get_default()
        if default_kb and default_kb in kb_names:

View on GitHub (pinned to 3e82f13042)