{"record":{"id":"f4367c2103e06375","repo":"unslothai/unsloth","slug":"unknown-example-dataset-example-id","errorCode":null,"errorMessage":"Unknown example dataset '{example_id}'.","messagePattern":"Unknown example dataset '(.+?)'\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"studio/backend/routes/training.py","lineNumber":4023,"sourceCode":"        \"id\": \"pixel-nouns\",\n        \"label\": \"Nouns (pixel avatars)\",\n        \"repo\": \"m1guelpf/nouns\",\n        \"description\": \"100 captioned pixel-art avatars. A style set, no trigger needed.\",\n        \"license\": \"cc0-1.0\",\n        \"image_cap\": 100,\n        \"suggested_trigger\": None,\n        \"loader\": \"hf_dataset\",\n        \"caption_column\": \"text\",\n        \"no_checks\": False,\n    },\n]\n\n\ndef _example_by_id(example_id: str) -> dict:\n    for entry in _DATASET_EXAMPLES:\n        if entry[\"id\"] == example_id:\n            return entry\n    raise HTTPException(status_code = 404, detail = f\"Unknown example dataset '{example_id}'.\")\n\n\n@router.get(\"/diffusion/dataset-examples\", response_model = DiffusionDatasetExamplesResponse)\nasync def list_diffusion_dataset_examples(current_subject: str = Depends(get_current_subject)):\n    \"\"\"List the curated example datasets available for one-click import.\"\"\"\n    return DiffusionDatasetExamplesResponse(\n        examples = [\n            DiffusionDatasetExample(\n                id = e[\"id\"],\n                label = e[\"label\"],\n                repo = e[\"repo\"],\n                description = e[\"description\"],\n                license = e[\"license\"],\n                image_cap = e[\"image_cap\"],\n                suggested_trigger = e[\"suggested_trigger\"],\n            )\n            for e in _DATASET_EXAMPLES\n        ]","sourceCodeStart":4005,"sourceCodeEnd":4041,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/training.py#L4005-L4041","documentation":"HTTP 404 from _example_by_id: the requested example-dataset id does not match any entry in the curated _DATASET_EXAMPLES list. This is a pure lookup failure on a static, server-defined list — the id was never valid at this server version (or was removed/renamed).","triggerScenarios":"POST/GET an example-dataset route with an unknown id: GET /diffusion/dataset-examples/{id} or an import request referencing e.g. 'old-example' after an upgrade that renamed ids; client hardcodes an id from an older release.","commonSituations":"Client shipped with a hardcoded example id; server upgraded and the curated list changed names; user manually types an id from stale docs; typos in automation scripts.","solutions":["List valid ids from GET /diffusion/dataset-examples and use one of those.","Update hardcoded ids after server upgrades; prefer reading the list at runtime instead of hardcoding.","Check release notes/changelog for renamed example datasets."],"exampleFix":"// before\nawait api.importExample('pokemon-old');\n// after\nconst examples = await api.listExamples();\nawait api.importExample(examples.find(e => e.label.includes('Pokemon')).id);","handlingStrategy":"validation","validationCode":"ids = {e['id'] for e in (await api.listExamples()).examples}\nassert example_id in ids, f'unknown example {example_id}'","typeGuard":"def is_unknown_example(exc: HTTPException) -> bool:\n    return exc.status_code == 404 and 'Unknown example dataset' in str(exc.detail)","tryCatchPattern":"try:\n    await api.importExample(example_id)\nexcept HTTPStatusError as e:\n    if e.response.status_code == 404 and 'Unknown example' in e.response.text:\n        example_id = await pick_from_live_list()  # re-enumerate\n    else:\n        raise","preventionTips":["Never hardcode example ids; resolve them from the list endpoint at runtime.","Re-fetch the examples list after every server upgrade."],"tags":["http-404","fastapi","dataset","examples"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}