{"record":{"id":"b06c4b2e72a76dec","repo":"unslothai/unsloth","slug":"training-start-request-not-found","errorCode":null,"errorMessage":"Training start request not found","messagePattern":"Training start request not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"studio/backend/routes/training.py","lineNumber":1066,"sourceCode":"\n    # Off the event loop: the ROCm fallbacks shell out (Windows perf counters, sysfs) and the System view polls this route.\n    return await asyncio.to_thread(get_visible_gpu_utilization)\n\n\n@router.get(\"/start-requests/{start_request_id}\", response_model = TrainingStartRequestStatus)\nasync def get_training_start_request(\n    start_request_id: str = ApiPath(\n        ...,\n        min_length = 1,\n        max_length = 128,\n        pattern = TRAINING_REQUEST_ID_PATTERN,\n    ),\n    current_subject: str = Depends(get_current_subject),\n):\n    backend = get_training_backend()\n    record = backend.get_start_request(start_request_id)\n    if record is None:\n        raise HTTPException(status_code = 404, detail = \"Training start request not found\")\n    return _start_request_status_response(record)\n\n\ndef _start_request_status_response(record) -> TrainingStartRequestStatus:\n    return TrainingStartRequestStatus(\n        start_request_id = record.start_request_id,\n        job_id = record.job_id,\n        state = record.state,\n        message = record.message,\n        error = record.error,\n        error_code = record.error_code,\n    )\n\n\n@router.post(\"/start-requests/{start_request_id}/acknowledge\")\nasync def acknowledge_training_start_request(\n    start_request_id: str = ApiPath(\n        ...,","sourceCodeStart":1048,"sourceCodeEnd":1084,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/training.py#L1048-L1084","documentation":"HTTP 404 from GET /training/start-requests/{start_request_id} when the backend's get_start_request returns no record for the given id. The id either never existed, was mistyped, or the record was cleaned up/expired server-side.","triggerScenarios":"GET /training/start-requests/{id} with an id that does not match any recorded start request: wrong string, truncated id, or a request record already reaped after job completion.","commonSituations":"Client persisted an id across a backend restart that lost in-memory state; copy/paste truncation of the id; polling a request that finished and was garbage-collected.","solutions":["Re-fetch the list of start requests (listing endpoint or job status) to obtain the current valid start_request_id","Verify the id matches TRAINING_REQUEST_ID_PATTERN and was not truncated or altered in transit","If the backend restarted, submit a new training start request to get a fresh id"],"exampleFix":"// before\nresp = client.get(f\"/training/start-requests/{start_request_id}\")  # 404\n\n// after\nif resp.status_code == 404:\n    # id is gone (expired or backend restarted) - create a new start request\n    resp = client.post(\"/training/start\", payload)\n    start_request_id = resp.json()[\"start_request_id\"]","handlingStrategy":"validation","validationCode":"import re\nTRAINING_REQUEST_ID_PATTERN = r'^[A-Za-z0-9_-]{1,128}$'  # align with backend pattern\n\ndef valid_start_request_id(rid: str) -> bool:\n    return bool(rid) and re.fullmatch(TRAINING_REQUEST_ID_PATTERN, rid) is not None","typeGuard":"def is_start_request_id(v: object) -> TypeGuard[str]:\n    return isinstance(v, str) and valid_start_request_id(v)","tryCatchPattern":"resp = client.get(f\"/training/start-requests/{rid}\")\nif resp.status_code == 404:\n    # id unknown/expired: re-enumerate or submit a new start request\n    rid = client.post(\"/training/start\", payload).json()[\"start_request_id\"]","preventionTips":["Always take start_request_id from the POST /training/start response, never from memory","Re-enumerate start requests after a backend restart","Validate the id shape client-side before calling GET"],"tags":["training","http-404","start-request","not-found"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}