{"record":{"id":"0044d15c6f625f7c","repo":"HumanSignal/label-studio","slug":"ext-extension-is-not-supported","errorCode":null,"errorMessage":"{ext} extension is not supported","messagePattern":"(.+?) extension is not supported","errorType":"validation","errorClass":"ValidationError","httpStatus":400,"severity":"error","filePath":"label_studio/data_import/uploader.py","lineNumber":63,"sourceCode":"    # max tasks\n    if len(tasks) > settings.TASKS_MAX_NUMBER:\n        raise ValidationError(\n            f'Maximum task number is {settings.TASKS_MAX_NUMBER}, current task number is {len(tasks)}'\n        )\n\n\ndef check_tasks_max_file_size(value):\n    if value >= settings.TASKS_MAX_FILE_SIZE:\n        raise ValidationError(\n            f'Maximum total size of all files is {settings.TASKS_MAX_FILE_SIZE} bytes, current size is {value} bytes'\n        )\n\n\ndef check_extensions(files):\n    for filename, file_obj in files.items():\n        _, ext = os.path.splitext(file_obj.name)\n        if ext.lower() not in settings.SUPPORTED_EXTENSIONS:\n            raise ValidationError(f'{ext} extension is not supported')\n\n\ndef check_request_files_size(files):\n    total = sum([file.size for _, file in files.items()])\n\n    check_tasks_max_file_size(total)\n\n\ndef create_file_upload(user, project, file):\n    instance = FileUpload(user=user, project=project, file=file)\n    if settings.SVG_SECURITY_CLEANUP:\n        content_type, encoding = mimetypes.guess_type(str(instance.file.name))\n        if content_type in ['image/svg+xml']:\n            clean_xml = allowlist_svg(instance.file.read().decode())\n            instance.file.seek(0)\n            instance.file.write(clean_xml.encode())\n            instance.file.truncate()\n    instance.save()","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/HumanSignal/label-studio/blob/0b49e9b53917880baf1dd85d574fe5541a9aafb2/label_studio/data_import/uploader.py#L45-L81","documentation":"ValidationError raised by check_extensions in label_studio/data_import/uploader.py. For each uploaded file, the extension (from os.path.splitext, lowercased) must appear in settings.SUPPORTED_EXTENSIONS (e.g. .csv, .json, .txt, .tsv); otherwise the upload is rejected because Label Studio cannot parse it into tasks.","triggerScenarios":"POSTing a file upload to the import API (create_file_uploads -> check_extensions) with a file whose extension is not in SUPPORTED_EXTENSIONS — e.g. .xlsx, .parquet, .zip, or a file with no extension.","commonSituations":"Uploading Excel or parquet files directly; zipped datasets; files saved without an extension; a deployment where SUPPORTED_EXTENSIONS was narrowed by config; misnamed files like data.json.txt being treated as .txt.","solutions":["Convert the file to a supported format (.csv, .tsv, .json, or .txt) before upload.","If it's a text file without extension, rename it to include .txt/.csv/.json.","Extend settings.SUPPORTED_EXTENSIONS if you genuinely need the extension and have a converter path.","Unzip archives locally and upload the contained supported files one by one."],"exampleFix":"// before\nconst fd = new FormData();\nfd.append('file', new File([data], 'export.xlsx'));\n\n// after\ncsv = xlsxToCsv(data);\nfd.append('file', new File([csv], 'export.csv'));","handlingStrategy":"validation","validationCode":"import os\nSUPPORTED = {'.csv', '.tsv', '.txt', '.json'}\nfor f in files:\n    _, ext = os.path.splitext(f.name)\n    if ext.lower() not in SUPPORTED:\n        raise ValueError(f'{f.name}: {ext} not supported — convert to csv/tsv/txt/json first')","typeGuard":null,"tryCatchPattern":"try:\n    upload(files)\nexcept ValidationError as e:\n    if 'extension is not supported' in str(e):\n        ext = e.message.split()[0]\n        converted = [to_csv_or_json(f) for f in files if not supported(f)]\n        upload(converted)\n    else:\n        raise","preventionTips":["Convert xlsx/parquet/zip inputs to CSV or JSON in your import pipeline before upload.","Name files with an explicit supported extension; never upload extension-less files.","Keep a small pre-upload validation step listing accepted extensions from settings.SUPPORTED_EXTENSIONS.","Unzip archives locally and upload the contained supported files individually."],"tags":["django","validation","file-extension","label-studio"],"backgroundTag":"unsupported-file-extension","analyzedSha":"0b49e9b53917880baf1dd85d574fe5541a9aafb2","analyzedAt":"2026-08-29T00:39:52.578Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}