{"record":{"id":"c71410249749c76f","repo":"HKUDS/DeepTutor","slug":"pageindex-knowledge-bases-accept-supported-uns","errorCode":null,"errorMessage":"PageIndex knowledge bases accept: {supported}. Unsupported: {', '.join(unsupported[:5])}.","messagePattern":"PageIndex knowledge bases accept: (.+?)\\. Unsupported: (.+?)\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"deeptutor/api/routers/knowledge.py","lineNumber":749,"sourceCode":"    from deeptutor.services.rag.pipelines.pageindex.pipeline import (\n        OSS_SUPPORTED_EXTENSIONS,\n        SUPPORTED_EXTENSIONS,\n    )\n\n    extensions = (\n        OSS_SUPPORTED_EXTENSIONS if provider == PAGEINDEX_OSS_PROVIDER else SUPPORTED_EXTENSIONS\n    )\n\n    unsupported = [\n        f.filename\n        for f in files\n        if f.filename\n        and not (provider == PAGEINDEX_PROVIDER and f.filename.lower().endswith(\".zip\"))\n        and Path(f.filename).suffix.lower() not in extensions\n    ]\n    if unsupported:\n        supported = \", \".join(sorted(extensions))\n        raise HTTPException(\n            status_code=400,\n            detail=(\n                f\"PageIndex knowledge bases accept: {supported}. \"\n                f\"Unsupported: {', '.join(unsupported[:5])}.\"\n            ),\n        )\n\n\ndef _resolve_registered_kb_name(manager: KnowledgeBaseManager, kb_name: str | None) -> str:\n    \"\"\"Resolve route-level default aliases to the configured default KB.\"\"\"\n    requested = str(kb_name or \"\").strip()\n    kb_names = manager.list_knowledge_bases()\n    if requested and requested in kb_names:\n        return requested\n\n    if requested.lower() in DEFAULT_KB_ALIASES:\n        default_kb = manager.get_default()\n        if default_kb and default_kb in kb_names:","sourceCodeStart":731,"sourceCodeEnd":767,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/knowledge.py#L731-L767","documentation":"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.","triggerScenarios":"Uploading to a PageIndex KB with files like .docx/.mp4 that the provider cannot ingest (only its documented formats, plus .zip bundles, pass).","commonSituations":"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.","solutions":["Convert offending files to one of the supported extensions listed in the message","Bundle mixed files into a .zip (explicitly allowed for PageIndex) and upload that","Filter the batch client-side against the provider's extension list before sending"],"exampleFix":"# before\nupload(files=['slides.pptx'])\n# after\nupload(files=['slides.pdf'])  # or zip the bundle","handlingStrategy":"validation","validationCode":"exts = fetch_allowed_extensions(provider)  # from provider metadata\nbad = [f for f in files if Path(f.filename).suffix.lower() not in exts\n       and not (provider=='pageindex' and f.filename.lower().endswith('.zip'))]\nassert not bad, bad","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Filter uploads against the provider's extension list client-side","Use .zip bundles for PageIndex when in doubt","Convert documents to a supported format before upload"],"tags":["pageindex","file-format","upload","http-400"],"backgroundTag":"unsupported-file-format","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}