infiniflow/ragflow · warning · RuntimeError

This type of file has not been supported yet!

Error message

This type of file has not been supported yet!

What it means

Raised during document upload in upload_document when filename_type() classifies the file as FileType.OTHER, i.e. the extension/MIME is not in RAGFlow's supported set (pdf, doc/docx, xlsx, ppt, images, txt/md, html, json, etc.). It is a validation error, not a system fault.

Source

Thrown at api/db/services/file_service.py:598

                    new_hash = incoming_fp or xxhash.xxh128(blob).hexdigest()
                    old_hash = doc.content_hash or ""
                    settings.STORAGE_IMPL.put(kb.id, doc.location, blob, kb.tenant_id)
                    doc.size = len(blob)
                    doc.content_hash = new_hash
                    doc = doc.to_dict()
                    DocumentService.update_by_id(doc["id"], doc)
                    if new_hash != old_hash:
                        files.append((doc, blob))
                except Exception as exc:
                    logger.exception("Failed to update document %s", doc_id)
                    err.append(file.filename + ": " + str(exc))
                continue
            try:
                DocumentService.check_doc_health(kb.tenant_id, file.filename)
                filename = duplicate_name(DocumentService.query, name=file.filename, kb_id=kb.id)
                filetype = filename_type(filename)
                if filetype == FileType.OTHER.value:
                    raise RuntimeError("This type of file has not been supported yet!")

                location = filename if not safe_parent_path else f"{safe_parent_path}/{filename}"
                while settings.STORAGE_IMPL.obj_exist(kb.id, location):
                    location += "_"

                blob = file.read()
                if filetype == FileType.PDF.value:
                    blob = read_potential_broken_pdf(blob)
                settings.STORAGE_IMPL.put(kb.id, location, blob)

                img = thumbnail_img(filename, blob)
                thumbnail_location = ""
                if img is not None:
                    thumbnail_location = f"thumbnail_{doc_id}.png"
                    settings.STORAGE_IMPL.put(kb.id, thumbnail_location, img)

                incoming_fp = getattr(file, "fingerprint", None)
                doc = {

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Convert the file to a supported format first (e.g. extract text to .md/.txt, convert .csv to .xlsx).
  2. Check api/utils/file_utils.py filename_type for the exact accepted extension list in your version and rename accordingly.
  3. Reject unsupported files client-side before upload based on extension.
  4. If the format is genuinely needed, request/add support or pre-process outside RAGFlow and upload the text output.

Example fix

# before
upload('presentation.key')  # unsupported -> RuntimeError

# after
# convert to a supported format first, then upload
subprocess.run(['libreoffice', '--convert-to', 'pptx', 'presentation.key'])
upload('presentation.pptx')
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED = {'.pdf', '.doc', '.docx', '.xlsx', '.xls', '.ppt', '.pptx', '.txt', '.md', '.jpg', '.jpeg', '.png', '.html', '.json'}
ext = os.path.splitext(filename)[1].lower()
if ext not in SUPPORTED:
    return json_error_response(f'unsupported file type: {ext}', 400)

Type guard

from api.utils.file_utils import filename_type
from api.db import FileType

def is_supported_upload(filename: str) -> bool:
    return filename_type(filename) != FileType.OTHER.value

Try / catch

try:
    errs, files = FileService.upload_document(kb, file_objs, user_id)
except RuntimeError as e:
    if 'not been supported' in str(e):
        return json_error_response('unsupported file type', 400)
    raise

Prevention

When it happens

Trigger: Uploading a file whose extension is unsupported (e.g. .exe, .zip, .csv depending on build, .mp4) via the web upload or the upload API; also files with no extension or a renamed extension that content sniffing rejects.

Common situations: Users uploading archives, binaries, or media; automated pipelines forwarding any office attachment; extension renamed to something unsupported before upload.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/669d9271cb1f24a4. Report an issue: GitHub.