HumanSignal/label-studio · error · ValidationError
{ext} extension is not supported
Error message
{ext} extension is not supported What it means
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.
Source
Thrown at label_studio/data_import/uploader.py:63
# max tasks
if len(tasks) > settings.TASKS_MAX_NUMBER:
raise ValidationError(
f'Maximum task number is {settings.TASKS_MAX_NUMBER}, current task number is {len(tasks)}'
)
def check_tasks_max_file_size(value):
if value >= settings.TASKS_MAX_FILE_SIZE:
raise ValidationError(
f'Maximum total size of all files is {settings.TASKS_MAX_FILE_SIZE} bytes, current size is {value} bytes'
)
def check_extensions(files):
for filename, file_obj in files.items():
_, ext = os.path.splitext(file_obj.name)
if ext.lower() not in settings.SUPPORTED_EXTENSIONS:
raise ValidationError(f'{ext} extension is not supported')
def check_request_files_size(files):
total = sum([file.size for _, file in files.items()])
check_tasks_max_file_size(total)
def create_file_upload(user, project, file):
instance = FileUpload(user=user, project=project, file=file)
if settings.SVG_SECURITY_CLEANUP:
content_type, encoding = mimetypes.guess_type(str(instance.file.name))
if content_type in ['image/svg+xml']:
clean_xml = allowlist_svg(instance.file.read().decode())
instance.file.seek(0)
instance.file.write(clean_xml.encode())
instance.file.truncate()
instance.save()View on GitHub (pinned to 0b49e9b539)
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.
Example fix
// before
const fd = new FormData();
fd.append('file', new File([data], 'export.xlsx'));
// after
csv = xlsxToCsv(data);
fd.append('file', new File([csv], 'export.csv')); Defensive patterns
Strategy: validation
Validate before calling
import os
SUPPORTED = {'.csv', '.tsv', '.txt', '.json'}
for f in files:
_, ext = os.path.splitext(f.name)
if ext.lower() not in SUPPORTED:
raise ValueError(f'{f.name}: {ext} not supported — convert to csv/tsv/txt/json first') Try / catch
try:
upload(files)
except ValidationError as e:
if 'extension is not supported' in str(e):
ext = e.message.split()[0]
converted = [to_csv_or_json(f) for f in files if not supported(f)]
upload(converted)
else:
raise Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Maximum task number is {settings.TASKS_MAX_NUMBER}, current
- Maximum total size of all files is {settings.TASKS_MAX_FILE_
- extract_message(e)
- load_tasks: Data root must be list
- load_tasks: No tasks added
AI-assisted analysis of HumanSignal/label-studio@0b49e9b539 (2026-08-29).
Data as JSON: /api/errors/0044d15c6f625f7c.
Report an issue: GitHub.