{"record":{"id":"16a668d0d3be4837","repo":"infiniflow/ragflow","slug":"100-16a668","errorCode":"100","errorMessage":"This type of file has not been supported yet!","messagePattern":"This type of file has not been supported yet!","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"api/apps/restful_apis/document_api.py","lineNumber":578,"sourceCode":"\n    try:\n        blob = await thread_pool_exec(html2pdf, url)\n    except Exception as e:\n        logging.warning(\"html2pdf failed for %s, %s\", dataset_id, str(e))\n        return get_error_data_result(message=str(e), code=RetCode.SERVER_ERROR)\n    if not blob:\n        return server_error_response(ValueError(\"Download failure.\"))\n\n    root_folder = FileService.get_root_folder(tenant_id)\n    FileService.init_knowledgebase_docs(root_folder[\"id\"], tenant_id)\n    kb_root_folder = FileService.get_kb_folder(tenant_id)\n    kb_folder = FileService.new_a_file_from_kb(kb.tenant_id, kb.name, kb_root_folder[\"id\"])\n\n    try:\n        filename = duplicate_name(DocumentService.query, name=f\"{name}.pdf\", kb_id=kb.id)\n        filetype = filename_type(filename)\n        if filetype == FileType.OTHER.value:\n            raise RuntimeError(\"This type of file has not been supported yet!\")\n\n        location = filename\n        while settings.STORAGE_IMPL.obj_exist(dataset_id, location):\n            location += \"_\"\n        settings.STORAGE_IMPL.put(dataset_id, location, blob)\n\n        doc = {\n            \"id\": get_uuid(),\n            \"kb_id\": kb.id,\n            \"parser_id\": kb.parser_id,\n            \"pipeline_id\": kb.pipeline_id,\n            \"parser_config\": kb.parser_config,\n            \"created_by\": tenant_id,\n            \"type\": filetype,\n            \"name\": filename,\n            \"location\": location,\n            \"size\": len(blob),\n            \"thumbnail\": thumbnail(filename, blob),","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/apps/restful_apis/document_api.py#L560-L596","documentation":"Raised during upload-to-dataset when the generated document filename's extension is classified by filename_type() as FileType.OTHER, i.e. an extension RAGFlow's parser registry does not recognize. The upload path force-appends '.pdf' after fetching a document as a PDF blob, so in practice this fires when the name/deduplication logic or filename_type mapping yields an unrecognized extension.","triggerScenarios":"POST a document by URL/blob to a dataset where the deduplicated filename (name + '.pdf' + possible '_' suffixes from obj_exist collisions) still resolves to an unmapped extension, or where filename_type's extension table lacks the produced suffix (e.g. case/format edge cases in the name such as trailing dots or unicode).","commonSituations":"Upstream code changes to filename_type or duplicate_name, unusual document names (trailing spaces/dots, double extensions), or a partially upgraded deployment where the supported-extension table and this endpoint disagree.","solutions":["Use a simple ASCII document name with a standard .pdf extension and retry.","Check filename_type()'s supported-extension table in the running code to see which suffixes map to real parsers.","If deploying a fork, ensure custom parser extensions are registered in both filename_type and the parser factory.","Inspect the computed `filename` variable in logs to see what deduplication produced."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from api import settings\n\ndef is_supported_name(filename):\n    from api.utils.file_utils import filename_type\n    from api.db import FileType\n    return filename_type(filename) != FileType.OTHER.value\n\nassert is_supported_name(f\"{name}.pdf\"), f\"{name}.pdf maps to an unsupported parser\"","typeGuard":null,"tryCatchPattern":"try:\n    doc = upload_document_to_dataset(dataset_id, name, blob)\nexcept RuntimeError as e:\n    if \"not been supported\" in str(e):\n        raise ValueError(\"Rename the document with a supported extension (e.g. .pdf)\") from e\n    raise","preventionTips":["Keep document names simple ASCII with a single standard extension.","Verify the supported-extension table matches your parser set when forking or upgrading.","Add an upload-path unit test asserting filename_type(name + '.pdf') classifies as PDF."],"tags":["document-api","upload","file-type","parser"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}