{"record":{"id":"7c12ab49c9285176","repo":"unslothai/unsloth","slug":"model-id-is-still-cancelling-try-again-in-a-m","errorCode":null,"errorMessage":"'{model_id}' is still cancelling; try again in a moment.","messagePattern":"'(.+?)' is still cancelling; try again in a moment\\.","errorType":"exception","errorClass":"SttModelIdError","httpStatus":422,"severity":"warning","filePath":"studio/backend/core/inference/stt_ggml_sidecar.py","lineNumber":548,"sourceCode":"                revision = revision,\n            )\n        except Exception:\n            return None\n\n    def start(\n        self,\n        model_id: str,\n        hf_token: Optional[str] = None,\n    ) -> None:\n        model_id = resolve_ggml_model_id(model_id)\n        hub_cache = _capture_stt_hub_cache()\n        with self._lock:\n            if self._thread is not None and self._thread.is_alive():\n                if self._model_id == model_id:\n                    # Joining a cancelling run would silently download nothing.\n                    if not self._cancelled:\n                        return\n                    raise SttModelIdError(\n                        f\"'{model_id}' is still cancelling; try again in a moment.\"\n                    )\n                raise SttModelIdError(\n                    f\"Another GGUF dictation model ('{self._model_id}') is still \"\n                    \"downloading; wait for it to finish.\"\n                )\n            self._model_id = model_id\n            self._error = None\n            self._total_bytes = None\n            self._etag = None\n            self._revision = None\n            self._hub_cache = hub_cache\n            self._cancelled = False\n            self._process = None\n            thread = threading.Thread(\n                target = self._run,\n                args = (model_id, hf_token),\n                daemon = True,","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/stt_ggml_sidecar.py#L530-L566","documentation":"Raised by the GGUF model downloader when a download thread for the SAME model is alive and its cancelled flag is set — the previous run is tearing down (stopping its subprocess, clearing state) and re-entering ensure() for that model right now would join a dying run and silently download nothing. The lock-protected state machine rejects the call until the cancellation finishes. It is a transient 'try again' condition, exposed as SttModelIdError.","triggerScenarios":"Cancelling a model download and immediately calling ensure(model) again for the same model id before the cancellation path completes.","commonSituations":"UI 'Cancel' followed instantly by 'Retry' on the same model; automated retry logic that does not wait for cancel to settle.","solutions":["Wait a moment and call ensure() again — cancellation completion clears the flag and a fresh download starts.","In retry loops, add a short backoff after a cancelled download instead of immediate retry.","Do not treat this as a bad model id; the id matched — only the timing is wrong."],"exampleFix":"# before\ntry:\n    downloader.ensure(model_id)\nexcept SttModelIdError:\n    raise\n# after\nfor _ in range(10):\n    try:\n        downloader.ensure(model_id); break\n    except SttModelIdError as e:\n        if \"still cancelling\" not in str(e): raise\n        time.sleep(0.5)","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"import time\nfor attempt in range(20):\n    try:\n        downloader.ensure(model_id); break\n    except SttModelIdError as e:\n        if \"still cancelling\" not in str(e):\n            raise\n        time.sleep(0.5)","preventionTips":["Debounce cancel-then-retry in UIs (wait for cancel to settle).","Add small backoff in automated retry loops after a cancelled download.","Check the downloader's state before re-invoking ensure()."],"tags":["stt","whisper","ggml","download","cancellation","race"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}