{"record":{"id":"d928ed308283ea8a","repo":"unslothai/unsloth","slug":"the-source-run-contains-invalid-training-configura","errorCode":null,"errorMessage":"The source run contains invalid training configuration and cannot be resumed safely.","messagePattern":"The source run contains invalid training configuration and cannot be resumed safely\\.","errorType":"http","errorClass":"HTTPException","httpStatus":409,"severity":"error","filePath":"studio/backend/routes/training.py","lineNumber":1008,"sourceCode":"        raise HTTPException(\n            status_code = 409,\n            detail = \"The selected dataset does not match the dataset used by the source run.\",\n        )\n\n    request.model_name = stored_model\n    for field, default in _RESUME_DATASET_DEFAULTS.items():\n        value = stored.get(field, default)\n        setattr(request, field, list(value) if isinstance(value, list) else value)\n    request.s3_config = None\n    for field in _RESUME_CACHE_FIELDS:\n        default = False if field.endswith(\"_known_cached\") else None\n        setattr(request, field, stored.get(field, default))\n    try:\n        validated_request = TrainingStartRequest.model_validate(\n            {field: getattr(request, field) for field in TrainingStartRequest.model_fields}\n        )\n    except ValidationError as error:\n        raise HTTPException(\n            status_code = 409,\n            detail = (\n                \"The source run contains invalid training configuration and cannot \"\n                \"be resumed safely.\"\n            ),\n        ) from error\n    for field in TrainingStartRequest.model_fields:\n        setattr(request, field, getattr(validated_request, field))\n    marker = stored.get(RESOURCE_PROVENANCE_KEY)\n    model_load_mode = (\n        _normalized_optional_string(marker.get(\"model_load_mode\"))\n        if requires_exact_model and isinstance(marker, dict)\n        else None\n    )\n    return (\n        _normalized_optional_string(stored.get(\"actual_model_repo_id\")),\n        requires_exact_model,\n        requires_exact_dataset,","sourceCodeStart":990,"sourceCodeEnd":1026,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/training.py#L990-L1026","documentation":"Thrown (HTTP 409) when resuming a training run whose persisted configuration fails re-validation against the current TrainingStartRequest schema. The resume flow copies stored field values back onto the request and re-runs model_validate; any field that no longer satisfies the schema (type, constraint, or enum change) triggers this error. It is a safety refusal: silently resuming with an invalid config could corrupt the run.","triggerScenarios":"POST to resume training with resume_from_checkpoint pointing at a run saved by an older backend version whose stored config contains values now invalid under the current TrainingStartRequest model (renamed enums, tightened min/max constraints, changed types).","commonSituations":"Upgrading the studio backend after schema migrations; resuming runs created before a validation rule was added; hand-edited run config files in the output directory.","solutions":["Check the server log for the chained ValidationError ('from error') to see exactly which stored field fails validation","Edit or remove the offending stored config values in the source run's stored record / output dir, then retry the resume","If the stored config is irreconcilable with the current schema, start a fresh training run instead of resuming","Re-create the run with an older backend version that matches the schema the run was saved with, save a clean checkpoint, then upgrade"],"exampleFix":"// before\nPOST /training/start {\"resume_from_checkpoint\": \"/runs/old-run\"}  // 409\n\n// after\n# 1) server log shows: field 'learning_rate' stored as string, now requires float\n# 2) fix stored value in the run record, then\nPOST /training/start {\"resume_from_checkpoint\": \"/runs/old-run\"}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = client.post(\"/training/start\", payload)\nexcept HTTPStatusError as e:\n    if e.response.status_code == 409 and \"cannot be resumed safely\" in e.response.text:\n        # inspect server logs for the chained ValidationError; fix stored config or start fresh\n        raise ResumeConfigIncompatible(run_id=payload[\"resume_from_checkpoint\"])\n    raise","preventionTips":["Keep the backend version aligned with the version that created the runs you resume","Do not hand-edit stored run configuration files","Log the original run's config at creation time so mismatches are diagnosable later"],"tags":["training","resume","validation","schema-mismatch","http-409"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}