Skip to content

Better handle Cloud STT exception #70

@synesthesiam

Description

@synesthesiam
Logger: homeassistant.components.assist_pipeline.pipeline
Source: components/assist_pipeline/pipeline.py:958
integration: Assist pipeline (documentation, issues)
First occurred: 18:14:25 (1 occurrence)
Last logged: 18:14:25

Unexpected error during speech-to-text
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 958, in speech_to_text
    result = await self.stt_provider.async_process_audio_stream(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/components/cloud/stt.py", line 113, in async_process_audio_stream
    result = await self.cloud.voice.process_stt(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/hass_nabucasa/voice.py", line 535, in process_stt
    return await self.process_stt(
           ^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/hass_nabucasa/voice.py", line 520, in process_stt
    async with self.cloud.websession.post(
               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        f"{self._endpoint_stt}?language={language}&profanity=raw",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
        chunked=True,
        ^^^^^^^^^^^^^
    ) as resp:
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 1488, in __aenter__
    self._resp: _RetType = await self._coro
                           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 770, in _request
    resp = await handler(req)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 748, in _connect_and_send_request
    await resp.start(conn)
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client_reqrep.py", line 541, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/streams.py", line 680, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Later

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions