jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
MIT License
308 stars 48 forks source link

Error Handling Request when Updating Zones #300

Closed dlindnegm closed 7 months ago

dlindnegm commented 8 months ago

What happened?

Noticing the following error in the HA system logs any time an Update All Zones or a single zone is performed:

"Error handling request"

How to reproduce

Fresh install of v2023.9.2, add in my sensors and zones followed by a manual update all zones.

Relevant log output

Logger: aiohttp.server
Source: helpers/event.py:1578
First occurred: 2:35:12 PM (1 occurrences)
Last logged: 2:35:12 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smart_irrigation/websockets.py", line 185, in post
    await coordinator.async_update_zone_config(zone, data)
  File "/config/custom_components/smart_irrigation/__init__.py", line 907, in async_update_zone_config
    self.register_start_event()
  File "/config/custom_components/smart_irrigation/__init__.py", line 920, in register_start_event
    self._track_sunrise_event_unsub()
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1578, in async_detach
    assert self._unsub_sun is not None
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Which version are you running?

v2023.9.2

Diagnostics file

Additional information

home-assistant_smart_irrigation_2023-10-01T18-35-46.782Z.log

dziadzi123 commented 8 months ago

I confirm the issue, same happens for all actions (update all zones, reset bucket, reset all buckets, calculate all zones), valid for GUI calls and for script commands as well Fresh install of v2023.9.2

jeroenterheerdt commented 7 months ago

duplicate of #297