{"record":{"id":"02ca0463c9abad41","repo":"unslothai/unsloth","slug":"the-local-transcription-runtime-is-being-updated","errorCode":null,"errorMessage":"The local transcription runtime is being updated. Try dictation again shortly.","messagePattern":"The local transcription runtime is being updated\\. Try dictation again shortly\\.","errorType":"exception","errorClass":"SttEngineUnavailableError","httpStatus":501,"severity":"warning","filePath":"studio/backend/core/inference/stt_ggml_sidecar.py","lineNumber":860,"sourceCode":"    ) -> None:\n        \"\"\"Release the resident model. ``wait=False`` skips a sidecar mid-request.\n\n        `transcribe` holds ``_lock`` across the whole round trip, so a caller releasing\n        engines it does not own must not block behind one. ``expected_model`` scopes the\n        release to one model, compared under the lock.\n        \"\"\"\n        if not self._lock.acquire(blocking = wait):\n            return\n        try:\n            if not self._holds_expected_model(expected_model):\n                return\n            self._release_locked()\n        finally:\n            self._lock.release()\n\n    def _raise_if_update_in_progress(self) -> None:\n        if self._update_in_progress:\n            raise SttEngineUnavailableError(\n                \"The local transcription runtime is being updated. Try dictation again shortly.\"\n            )\n\n    @contextmanager\n    def update_maintenance(self) -> Iterator[bool]:\n        \"\"\"Block new loads while the managed whisper.cpp tree is replaced.\n\n        The flag is published before waiting for an existing transcription to\n        release ``_lock``. Holding that lock across the yielded installer phase\n        prevents Windows from relocking the executable and prevents every host\n        from starting a process against a partially swapped tree. The yielded\n        value records whether a warm model had to be unloaded.\n        \"\"\"\n        self._update_in_progress = True\n        try:\n            with self._lock:\n                model_was_active = self._process_alive()\n                self._release_locked()","sourceCodeStart":842,"sourceCodeEnd":878,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/stt_ggml_sidecar.py#L842-L878","documentation":"Raised by GgmlSttSidecar._raise_if_update_in_progress when a whisper.cpp runtime update is mid-swap. The update_maintenance() context manager publishes this flag before replacing the managed whisper.cpp tree, so any load() or transcribe() call during that window is rejected instead of racing a partially swapped binary. It is a transient, deliberate unavailability rather than a defect.","triggerScenarios":"Calling load() or transcribe() on GgmlSttSidecar while another thread holds update_maintenance() (e.g. `unsloth studio update` or an engine auto-update is reinstalling whisper.cpp). Both the pre-lock check and the in-lock re-check after acquiring _lock raise it.","commonSituations":"User triggers a Studio engine update while a dictation hotkey/shortcut fires; an auto-updater runs in the background during a voice session; a queued transcription request lands during the installer phase of the maintenance window.","solutions":["Wait for the update to finish and retry the dictation request; the flag clears when update_maintenance() exits.","Surface the 'try again shortly' message to the user instead of disabling the GGML engine — this error must not count as a runtime failure.","If it persists, check that no update_maintenance() call deadlocked (e.g. an installer crashed while holding the flag) and restart Studio."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if sidecar._update_in_progress:  # prefer a public accessor if exposed\n    schedule_retry_later()\nelse:\n    sidecar.load(model)","typeGuard":null,"tryCatchPattern":"try:\n    sidecar.load(model_id)\nexcept SttEngineUnavailableError as exc:\n    if \"being updated\" in str(exc):\n        backoff_and_retry()  # transient maintenance window\n    else:\n        raise","preventionTips":["Do not fire dictation requests during an engine update; gate the UI on the update state.","Never count this error toward runtime-failure marks that disable the GGML engine.","Retry with a short backoff; the maintenance window is bounded by the installer phase."],"tags":["stt","ggml","whisper-cpp","maintenance","transient"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}