{"record":{"id":"c9f03c05aa89bf7a","repo":"unslothai/unsloth","slug":"execution-artifact-path-is-not-a-dataset-folder","errorCode":null,"errorMessage":"Execution artifact path is not a dataset folder.","messagePattern":"Execution artifact path is not a dataset folder\\.","errorType":"exception","errorClass":"RecipeDatasetPublishError","httpStatus":400,"severity":"error","filePath":"studio/backend/core/data_recipe/huggingface.py","lineNumber":39,"sourceCode":"    \"\"\"Raised when a recipe dataset cannot be published to Hugging Face.\"\"\"\n\n\ndef _resolve_recipe_artifact_path(artifact_path: str) -> Path:\n    root = recipe_datasets_root().expanduser().resolve()\n    candidate = resolve_dataset_path(artifact_path).expanduser()\n    resolved = candidate.resolve(strict = False)\n\n    try:\n        resolved.relative_to(root)\n    except ValueError as exc:\n        raise RecipeDatasetPublishError(\n            \"This execution artifact is outside the Recipe Studio dataset storage.\"\n        ) from exc\n\n    if not resolved.exists():\n        raise RecipeDatasetPublishError(\"Execution artifacts are no longer available.\")\n    if not resolved.is_dir():\n        raise RecipeDatasetPublishError(\"Execution artifact path is not a dataset folder.\")\n\n    return resolved\n\n\ndef publish_recipe_dataset(\n    *,\n    artifact_path: str,\n    repo_id: str,\n    description: str,\n    hf_token: str | None = None,\n    private: bool = False,\n) -> str:\n    dataset_path = _resolve_recipe_artifact_path(artifact_path)\n\n    try:\n        from data_designer.engine.storage.artifact_storage import (\n            FINAL_DATASET_FOLDER_NAME,\n            METADATA_FILENAME,","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/data_recipe/huggingface.py#L21-L57","documentation":"RecipeDatasetPublishError raised when the artifact path exists but is not a directory (resolved.is_dir() is False). Publishing to Hugging Face requires a dataset folder (with metadata/config files); a plain file, a broken symlink that still resolves, or a special file at the path fails this check.","triggerScenarios":"Passing a path to a single output file (e.g. a .jsonl or .parquet file) instead of the run's output directory; the artifact dir replaced by a file of the same name.","commonSituations":"Clients deriving artifact_path from a reported file location rather than the run's folder; partially cleaned storage where only a marker file remains.","solutions":["Pass the run's output directory (the artifact_path from the execution result), not a file inside it.","Verify with os.path.isdir(...) before calling publish.","If the directory was replaced, re-run the recipe."],"exampleFix":"# before\npublish_recipe_dataset(artifact_path=str(run_dir / \"data.jsonl\"), ...)\n\n# after\npublish_recipe_dataset(artifact_path=str(run_dir), ...)","handlingStrategy":"validation","validationCode":"import os\nassert os.path.isdir(os.path.expanduser(artifact_path)), 'artifact_path must be the run output directory, not a file'","typeGuard":"def is_dataset_dir(path: str) -> bool:\n    p = Path(path).expanduser()\n    return p.is_dir()","tryCatchPattern":"try:\n    publish_recipe_dataset(artifact_path=p, repo_id=r)\nexcept RecipeDatasetPublishError as e:\n    if 'not a dataset folder' in str(e):\n        p = str(Path(p).parent); retry(p)","preventionTips":["Pass the run's output directory, never a file inside it.","Check isdir() client-side before the publish call."],"tags":["validation","filesystem","huggingface","data-recipe","studio"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}