Skip to content

Unexpected error fetching DWD Weather Coordinator #238

@HomeAssistant310

Description

@HomeAssistant310

Hi,

first of all, thanks for this awesome integration!
However, after going through my logs because of another issue, I noticed that the DWD integration is causing some errors while trying to fetch data.

Yesterday there was a log entry about fetching data taking long, but nothing specific, thus I wanted to monitor the issue first.

Today I go the error below, which might be related:

Logger: custom_components.dwd_weather
Quelle: helpers/update_coordinator.py:416
Integration: Deutscher Wetterdienst (Dokumentation, Probleme)
Erstmals aufgetreten: 14:40:38 (1 Vorkommnis)
Zuletzt protokolliert: 14:40:38

Unexpected error fetching DWD Weather Coordinator for 10513 data
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.13/site-packages/httpx/_transports/default.py", line 250, in handle_request
    resp = self._pool.handle_request(req)
  File "/usr/local/lib/python3.13/site-packages/httpcore/_sync/connection_pool.py", line 256, in handle_request
    raise exc from None
  File "/usr/local/lib/python3.13/site-packages/httpcore/_sync/connection_pool.py", line 236, in handle_request
    response = connection.handle_request(
        pool_request.request
    )
  File "/usr/local/lib/python3.13/site-packages/httpcore/_sync/connection.py", line 101, in handle_request
    raise exc
  File "/usr/local/lib/python3.13/site-packages/httpcore/_sync/connection.py", line 78, in handle_request
    stream = self._connect(request)
  File "/usr/local/lib/python3.13/site-packages/httpcore/_sync/connection.py", line 156, in _connect
    stream = stream.start_tls(**kwargs)
  File "/usr/local/lib/python3.13/site-packages/httpcore/_backends/sync.py", line 154, in start_tls
    with map_exceptions(exc_map):
         ~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectTimeout: _ssl.c:1015: The handshake operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 416, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 307, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dwd_weather/connector.py", line 144, in async_update
    if await self._hass.async_add_executor_job(self._update):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/dwd_weather/connector.py", line 161, in _update
    self.dwd_weather.update(
    ~~~~~~~~~~~~~~~~~~~~~~~^
        force_hourly=self._config[CONF_HOURLY_UPDATE],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
        with_uv=True,
        ^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 730, in update
    self.download_latest_kml(self.station_id, force_hourly)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 1082, in download_latest_kml
    self.download_large_kml(stationid)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 1037, in download_large_kml
    for file_name, file_size, unzipped_chunks in stream_unzip(self.get_chunks(url)):
                                                 ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/stream_unzip/__init__.py", line 486, in stream_unzip
    for file_name, file_size, unzipped_chunks in all():
                                                 ~~~^^
  File "/usr/local/lib/python3.13/site-packages/stream_unzip/__init__.py", line 476, in all
    signature = get_num(len(local_file_header_signature))
  File "/usr/local/lib/python3.13/site-packages/stream_unzip/__init__.py", line 96, in _get_num
    return b''.join(_yield_num(num))
           ~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/stream_unzip/__init__.py", line 82, in _yield_num
    chunk, offset = _next()
                    ~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/stream_unzip/__init__.py", line 75, in _next
    return (next_or_truncated_error(it), 0)
            ~~~~~~~~~~~~~~~~~~~~~~~^^^^
  File "/usr/local/lib/python3.13/site-packages/stream_unzip/__init__.py", line 53, in next_or_truncated_error
    return next(it)
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 1018, in get_chunks
    with httpx.stream(
         ~~~~~~~~~~~~^
        "GET",
        ^^^^^^
        url,
        ^^^^
    ) as r:
    ^
  File "/usr/local/lib/python3.13/contextlib.py", line 141, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.13/site-packages/httpx/_api.py", line 159, in stream
    with client.stream(
         ~~~~~~~~~~~~~^
        method=method,
        ^^^^^^^^^^^^^^
    ...<8 lines>...
        follow_redirects=follow_redirects,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ) as response:
    ^
  File "/usr/local/lib/python3.13/contextlib.py", line 141, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 868, in stream
    response = self.send(
        request=request,
    ...<2 lines>...
        stream=True,
    )
  File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
        request,
    ...<2 lines>...
        history=[],
    )
  File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
        request,
        follow_redirects=follow_redirects,
        history=history,
    )
  File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
  File "/usr/local/lib/python3.13/site-packages/httpx/_client.py", line 1014, in _send_single_request
    response = transport.handle_request(request)
  File "/usr/local/lib/python3.13/site-packages/httpx/_transports/default.py", line 249, in handle_request
    with map_httpcore_exceptions():
         ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectTimeout: _ssl.c:1015: The handshake operation timed out

Hope this is of any assistance in making that integration even better!

Edit:
The other error just came up again:

Logger: homeassistant.helpers.entity
Quelle: helpers/entity.py:1214
Erstmals aufgetreten: 00:00:44 (1 Vorkommnis)
Zuletzt protokolliert: 00:00:44

Updating state for sensor.koeln_bonn_bewolkungsgrad (<class 'custom_components.dwd_weather.sensor.DWDWeatherForecastSensor'>) took 1.217 seconds. Please create a bug report at https://github.com/FL550/dwd_weather/issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions