home-assistant/core · error · SpeechToTextError

stt-stream-failed

stt-stream-failed

Error message

Unexpected error during speech-to-text

What it means

SpeechToTextError with code stt-stream-failed wraps any unexpected exception thrown while streaming audio to the STT provider (async_process_audio_stream or the internal _speech_to_text_stream generator). The original traceback is logged via _LOGGER.exception before rethrowing, so the underlying cause is visible in the logs but hidden behind this generic pipeline error.

Solutions

  1. Check the Home Assistant log for the 'Unexpected error during speech-to-text' traceback — the chained source exception names the real failure.
  2. Restart the STT backend (e.g. Wyoming Whisper add-on) and confirm it stays healthy during a request.
  3. If the traceback points at audio handling, verify the stream yields chunks in the announced format until a clean end-of-stream.
  4. For recurring provider crashes, inspect the provider's own logs (add-on logs) for OOM or model-load errors.
Defensive patterns

Strategy: retry

Try / catch

from homeassistant.components.assist_pipeline.error import SpeechToTextError
try:
    await pipeline_job.run()
except SpeechToTextError as err:
    if err.code == "stt-stream-failed":
        _LOGGER.error("STT failed: %s", err.__cause__)  # original traceback is in logs
        # optionally retry once after provider restart
        ...

Prevention

When it happens

Trigger: Any non-auth, non-timeout exception during STT: the Wyoming connection drops mid-stream, the provider process crashes, a malformed audio chunk breaks the stream generator, or a custom provider raises a bug.

Common situations: Whisper add-on/container running out of memory or restarting mid-request, network interruption to a remote STT service, bugs in custom stt provider integrations, or audio streams that end prematurely.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/246ff8432034270c. Report an issue: GitHub.

Appendix: source

Thrown at homeassistant/components/assist_pipeline/pipeline.py:972

            ):
                stt_vad = VoiceCommandSegmenter(
                    silence_seconds=self.audio_settings.silence_seconds
                )

            result = await self.stt_provider.async_process_audio_stream(
                metadata,
                self._speech_to_text_stream(audio_stream=stream, stt_vad=stt_vad),
            )
        except asyncio.CancelledError, TimeoutError:
            raise  # expected
        except hass_nabucasa.auth.Unauthenticated as src_error:
            raise SpeechToTextError(
                code="cloud-auth-failed",
                message="Home Assistant Cloud authentication failed",
            ) from src_error
        except Exception as src_error:
            _LOGGER.exception("Unexpected error during speech-to-text")
            raise SpeechToTextError(
                code="stt-stream-failed",
                message="Unexpected error during speech-to-text",
            ) from src_error

        _LOGGER.debug("speech-to-text result %s", result)

        if result.result != stt.SpeechResultState.SUCCESS:
            raise SpeechToTextError(
                code="stt-stream-failed",
                message="speech-to-text failed",
            )

        if not result.text:
            raise SpeechToTextError(
                code="stt-no-text-recognized", message="No text recognized"
            )

        self.process_event(

View on GitHub (pinned to 58a3fdb3ea)