FL550 / dwd_weather

Deutscher Wetterdienst integration for Home-Assistant
MIT License
173 stars 11 forks source link

Log errors since 1.2.20 #52

Closed VDRainer closed 2 years ago

VDRainer commented 2 years ago

Version of home_assistant

2022.5.3

Version of the custom_component

1.2.20

Describe the bug

My log fills with errors since 1.2.20. I installed HA 2022.5.3 and 1.2.20 at the same time.

Debug log


2022-05-08 23:19:15 ERROR (MainThread) [custom_components.dwd_weather] Unexpected error fetching DWD Weather Coordinator for wuerzburg data: list index out of range
Traceback (most recent call last):
  File "/srv/ha/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 191, in _async_refresh
    self.data = await self._async_update_data()
  File "/srv/ha/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data
    return await self.update_method()
  File "/home/homeassi/.homeassistant/custom_components/dwd_weather/connector.py", line 58, in async_update
    return await self._hass.async_add_executor_job(self._update)
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassi/.homeassistant/custom_components/dwd_weather/connector.py", line 65, in _update
    self.dwd_weather.update()
  File "/srv/ha/lib/python3.9/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 469, in update
    self.parse_kml(kml)
  File "/srv/ha/lib/python3.9/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 496, in parse_kml
    result = tree.xpath("//dwd:IssueTime", namespaces=self.namespaces)[0].text
IndexError: list index out of range
2022-05-08 23:19:15 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/ha/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 137, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/srv/ha/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 270, in _async_refresh
    update_callback()
  File "/srv/ha/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
    self._async_write_ha_state()
  File "/srv/ha/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/srv/ha/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 539, in _stringify_state
    if (state := self.state) is None:
  File "/srv/ha/lib/python3.9/site-packages/homeassistant/components/weather/__init__.py", line 306, in state
    return self.condition
  File "/home/homeassi/.homeassistant/custom_components/dwd_weather/weather.py", line 63, in condition
    return self._connector.get_condition()
  File "/home/homeassi/.homeassistant/custom_components/dwd_weather/connector.py", line 168, in get_condition
    return self.dwd_weather.get_forecast_condition(
  File "/srv/ha/lib/python3.9/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 177, in get_forecast_condition
    if self.is_in_timerange(timestamp):
  File "/srv/ha/lib/python3.9/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 152, in is_in_timerange
    list(self.forecast_data.keys())[0]
AttributeError: 'NoneType' object has no attribute 'keys'
GerdRuetten commented 2 years ago

I have the same issue.

The problem is, that the SSL-Certificat from DWD is expired, so the https-URL are invalid

NET::ERR_CERT_DATE_INVALID
Subject: opendata.dwd.de
Issuer: DFN-Verein Global Issuing CA
Expires on: 08.05.2022
Current date: 09.05.2022

V 1.2.19 crashed about this SSL-error on DWD-side and V 1.2.20 crashed with an unsafe http-URL because the DWD-Side use HSTS!

Wait for DWD to fix the error

Friedi1970 commented 2 years ago

I tried to delete and reinstall again the integration but I only get "unknown error" :(

arboeh commented 2 years ago

Error for me also, deleted integration because I had the same error described at the top and on adding I get this now:

Traceback (most recent call last):
  File "/config/custom_components/dwd_weather/config_flow.py", line 71, in async_step_user
    info = await validate_input(self.hass, user_input)
  File "/config/custom_components/dwd_weather/config_flow.py", line 49, in validate_input
    await dwd_weather_data.async_update()
  File "/config/custom_components/dwd_weather/connector.py", line 58, in async_update
    return await self._hass.async_add_executor_job(self._update)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/dwd_weather/connector.py", line 65, in _update
    self.dwd_weather.update()
  File "/usr/local/lib/python3.9/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 469, in update
    self.parse_kml(kml)
  File "/usr/local/lib/python3.9/site-packages/simple_dwd_weatherforecast/dwdforecast.py", line 496, in parse_kml
    result = tree.xpath("//dwd:IssueTime", namespaces=self.namespaces)[0].text
IndexError: list index out of range
FL550 commented 2 years ago

Hi, this is all related to the SSL error of the DWD site. My quick attempt to fix this wasn't successful, because I forgot about HSTS.

So please wait until DWD renews their certificate.

GerdRuetten commented 2 years ago

Hi, this is all related to the SSL error of the DWD site. My quick attempt to fix this wasn't successful, because I forgot about HSTS.

So please wait until DWD renews their certificate.

Release you a new version with the correct SSL-URL after DWD fixed his SSL-Cert?

GerdRuetten commented 2 years ago

DWD has fix the problem. The side is reach over a new SSL-Cert.

VDRainer commented 2 years ago

Yepp, DWD Weather is back. :smile:

damanti-me commented 2 years ago

sadly the same error still persists as i installed the update to 1.2.20 like in https://github.com/FL550/dwd_weather/issues/52#issue-1228991097 . core-2022.5.1 Python-Version | 3.9.6 Tried reboots and reinstalls. any tips for me?

VDRainer commented 2 years ago

Downgrade to 1.2.17 works for me.

arboeh commented 2 years ago

Downgrade to 1.2.17 works for me.

πŸ‘

GerdRuetten commented 2 years ago

sadly the same error still persists as i installed the update to 1.2.20 like in #52 (comment) . core-2022.5.1 Python-Version | 3.9.6 Tried reboots and reinstalls. any tips for me?

Change in the file

custom_components/dwd_weather/manifest.json

"requirements": ["simple_dwd_weatherforecast==1.1.3","markdownify==0.6.5"] to

"requirements": ["simple_dwd_weatherforecast==1.1.4","markdownify==0.6.5"]

or downgrade to version 1.2.19

@FL550

I think, you must release a new version from the Add-on with this change

FL550 commented 2 years ago

The new release is now live.

arboeh commented 2 years ago

The new release is now live.

Works for me. πŸ‘ Thanks!

Friedi1970 commented 2 years ago

Fine for me :) Thanks so much!!!