{"record":{"id":"7d7181bf0cd50425","repo":"HumanSignal/label-studio","slug":"maximum-total-size-of-all-files-is-settings-tasks","errorCode":null,"errorMessage":"Maximum total size of all files is {settings.TASKS_MAX_FILE_SIZE} bytes, current size is {value} bytes","messagePattern":"Maximum total size of all files is (.+?) bytes, current size is (.+?) bytes","errorType":"validation","errorClass":"ValidationError","httpStatus":400,"severity":"error","filePath":"label_studio/data_import/uploader.py","lineNumber":54,"sourceCode":"\n    num_columns = len(line.split(b',' if isinstance(line, bytes) else ','))\n    for i in range(num_columns):\n        names.append('column' + str(i + 1))\n    file.seek(0)\n    return names\n\n\ndef check_max_task_number(tasks):\n    # 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):","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/HumanSignal/label-studio/blob/0b49e9b53917880baf1dd85d574fe5541a9aafb2/label_studio/data_import/uploader.py#L36-L72","documentation":"ValidationError raised by check_tasks_max_file_size in label_studio/data_import/uploader.py. Label Studio caps the combined size of all uploaded files per import request at settings.TASKS_MAX_FILE_SIZE (default 100 MB). When the computed total (sum of file.size, or a Content-Length header) is >= the limit, the import is rejected before download/processing.","triggerScenarios":"check_request_files_size summing uploaded file sizes to >= TASKS_MAX_FILE_SIZE, or tasks_from_url reading a Content-Length header >= the limit before downloading a URL import.","commonSituations":"Uploading one huge CSV/JSON dump; multi-file upload where the combined size crosses the cap; URL import pointing at a large file; operator lowered TASKS_MAX_FILE_SIZE without telling users.","solutions":["Split the upload into multiple smaller files / requests, each under TASKS_MAX_FILE_SIZE (default 100 MB).","Increase the limit via the TASKS_MAX_FILE_SIZE env var (or settings) and restart Label Studio.","Compress or trim the input data (e.g. keep only needed columns) before importing.","For URL imports, serve/point to a file below the limit or use storage synchronization instead of direct download."],"exampleFix":"// before\nconst fd = new FormData();\nfd.append('file', hugeFile); // 300MB\n\n// after: chunk into <100MB pieces and import sequentially\nconst CHUNK = 90 * 1024 * 1024;\nfor (const part of sliceFile(hugeFile, CHUNK)) await importOne(part);","handlingStrategy":"validation","validationCode":"import os\nMAX = int(os.environ.get('TASKS_MAX_FILE_SIZE', 104857600))\ntotal = sum(f.size for f in files)\nif total >= MAX:\n    raise ValueError(f'Upload total {total} bytes >= limit {MAX}; split or raise TASKS_MAX_FILE_SIZE')","typeGuard":null,"tryCatchPattern":"try:\n    upload_files(files)\nexcept ValidationError as e:\n    if 'Maximum total size of all files' in str(e):\n        for chunk in chunk_files(files, MAX // 2):\n            upload_files(chunk)\n    else:\n        raise","preventionTips":["Sum file sizes client-side and compare to TASKS_MAX_FILE_SIZE before upload.","Chunk large uploads into pieces well under the limit (e.g. 90MB).","For URL imports, check the Content-Length header first before handing the URL to the API.","Keep the limit setting documented for users of your Label Studio instance."],"tags":["django","validation","file-size-limit","label-studio"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"0b49e9b53917880baf1dd85d574fe5541a9aafb2","analyzedAt":"2026-08-29T00:39:52.578Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}