unslothai/unsloth · warning · HTTPException

Multiple cached differ only by case. Delete the exact repo…

Error message

Multiple cached {noun} differ only by case. Delete the exact repo casing from On Device.

What it means

HTTPException 409 raised by resolve_destructive_repo_ids when the HF cache dir contains multiple repos whose ids differ from the requested one only by letter case (resolved by resolve_destructive_case_matches returning None). Deleting could hit the wrong casing on case-insensitive filesystems, so the API refuses the destructive operation and asks the user to delete the exact casing from the On Device UI.

Solutions

  1. Open the On Device page and delete the exact repo casing you want removed, one entry at a time.
  2. Clean duplicates by deleting both case variants and re-downloading the correctly-cased repo.
  3. Audit scripts that normalize repo ids to lowercase before download.

Example fix

# before
DELETE /hub/datasets/user/model   # cache holds both User/Model and user/model -> 409

# after
# On Device UI: delete 'User/Model' explicitly, then retry the API call for the remaining casing
Defensive patterns

Strategy: try-catch

Try / catch

import httpx

resp = httpx.delete(f"{api}/hub/datasets/{repo_id}")
if resp.status_code == 409 and "differ only by case" in resp.text:
    # direct the user to On Device to pick the exact casing
    show_message("Multiple cached casings exist; delete the exact one from On Device.")

Prevention

When it happens

Trigger: Calling a delete endpoint for a repo while the cache holds e.g. both 'User/Model' and 'user/model' (or other case variants) matching case-insensitively; common after downloading the same repo under differently-cased ids at different times.

Common situations: macOS/Windows (case-insensitive FS) caches where both casings were snapshotted; scripts that lowercase repo ids before downloading; re-adding a repo with different capitalization.

Related errors


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

Appendix: source

Thrown at studio/backend/hub/services/__init__.py:22

"""Shared helpers for the Hub service layer."""

from __future__ import annotations

from typing import Iterable

from fastapi import HTTPException

from hub.utils.hf_cache_state import resolve_destructive_case_matches


def resolve_destructive_repo_ids(repo_id: str, candidates: Iterable[str], *, noun: str) -> set[str]:
    """Cache-dir repo ids a destructive op on *repo_id* may target.

    Refuses with 409 on ambiguous case-only matches so a delete never removes
    the wrong casing. *noun* is the plural shown to the user."""
    resolved = resolve_destructive_case_matches(repo_id, candidates)
    if resolved is None:
        raise HTTPException(
            status_code = 409,
            detail = (
                f"Multiple cached {noun} differ only by case. "
                "Delete the exact repo casing from On Device."
            ),
        )
    return resolved

View on GitHub (pinned to 203007d190)