unslothai/unsloth · error · ValueError

No supported dataset files ({', '.join(SUPPORTED_EXTENSIONS)

Error message

No supported dataset files ({', '.join(SUPPORTED_EXTENSIONS)}) found under {where}

What it means

ValueError raised when _list_dataset_keys returns no S3 objects whose keys end with a supported extension (.parquet, .json, .jsonl, .csv). Listing succeeded and ignored directory placeholders and metadata filenames, but nothing loadable remained, so the loader aborts before creating a temp dir. The message interpolates the supported extensions and the s3://bucket/prefix location that came up empty.

Source

Thrown at studio/backend/core/training/s3_dataset.py:176

    Raises ``RuntimeError`` if boto3 is missing, and ``ValueError`` if the
    bucket/prefix contains no supported dataset files.
    """
    if not boto3_available():
        raise RuntimeError("S3 dataset loading requires boto3. Install it with: pip install boto3")

    bucket = s3_config.get("bucket")
    if not bucket:
        raise ValueError("s3_config.bucket is required")
    prefix = s3_config.get("prefix")

    _raise_if_cancelled(cancel_callback)
    client = _build_s3_client(s3_config)

    keys = _list_dataset_keys(client, bucket, prefix)
    _raise_if_cancelled(cancel_callback)
    if not keys:
        where = f"s3://{bucket}/{prefix}" if prefix else f"s3://{bucket}"
        raise ValueError(
            f"No supported dataset files ({', '.join(SUPPORTED_EXTENSIONS)}) "
            f"found under {where}"
        )

    _validate_single_extension_family(keys)

    owns_temp_dir = dest_dir is None
    target_dir = dest_dir or tempfile.mkdtemp(prefix = "unsloth_s3_dataset_")
    try:
        os.makedirs(target_dir, exist_ok = True)

        local_files: list[str] = []
        used_paths: set[str] = set()
        for key in keys:
            _raise_if_cancelled(cancel_callback)
            filename = os.path.basename(key)
            local_path = _unique_local_path(target_dir, filename, used_paths)
            download_kwargs = {}

View on GitHub (pinned to 203007d190)

Solutions

  1. Verify objects exist under the exact prefix: aws s3 ls s3://bucket/prefix --recursive.
  2. Convert/re-upload the dataset in a supported format (.parquet recommended, or .jsonl/.csv).
  3. Fix the prefix string (leading/trailing slashes, wrong folder name) to point at the dataset objects.
  4. Remove reliance on unsupported extensions — rename only if the file genuinely is that format.

Example fix

// before
prepare_s3_dataset_download({"bucket": "data", "prefix": "runs/"})  # only .txt files there
// after  # convert and upload parquet
aws s3 cp data.parquet s3://data/runs/parquet/
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED = ('.parquet', '.json', '.jsonl', '.csv')

def has_supported_objects(client, bucket: str, prefix: str) -> bool:
    resp = client.list_objects_v2(Bucket=bucket, Prefix=prefix)
    return any(k['Key'].lower().endswith(SUPPORTED) for k in resp.get('Contents', []))

assert has_supported_objects(client, bucket, prefix), "no supported dataset files under prefix"

Try / catch

try:
    dl = prepare_s3_dataset_download(cfg)
except ValueError as e:
    if 'No supported dataset files' in str(e):
        # check prefix spelling, upload converted data, then retry
        ...

Prevention

When it happens

Trigger: prepare_s3_dataset_download with a prefix that contains only unsupported files (.txt, .arrow, .zip), a wrong bucket/prefix with no objects at all, or a prefix typo (missing/extra trailing segment) that matches nothing.

Common situations: Dataset uploaded as .arrow or .txt which the loader does not support; prefix points at the wrong 'folder' level; files live in a sub-prefix the flat listing does not cover; case-sensitive extension mismatch is NOT an issue here (extensions are matched case-insensitively) but wrong names like 'data.parquet2' are.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/13576e75128886c7. Report an issue: GitHub.