olibos / HomeAssistant-RecycleApp

Integrate RecycleApp into your Home Assistant.
32 stars 3 forks source link

Errors when updating data #80

Open Tommatheussen opened 1 month ago

Tommatheussen commented 1 month ago

Got 2 errors during the last night, newer updates seems to have gotten through correctly:

Logger: custom_components.recycle_app
Bron: helpers/update_coordinator.py:354
integratie: RecycleApp (documentatie, problemen)
Eerst voorgekomen: 00:02:51 (1 gebeurtenissen)
Laatst gelogd: 00:02:51

Unexpected error fetching RecycleAppGetRecyclingParks data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/recycle_app/__init__.py", line 68, in async_update_parks
    return await hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/recycle_app/api.py", line 87, in get_recycling_parks
    for item in response.get("items", []):
                ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
Logger: custom_components.recycle_app
Bron: helpers/update_coordinator.py:354
integratie: RecycleApp (documentatie, problemen)
Eerst voorgekomen: 00:01:03 (1 gebeurtenissen)
Laatst gelogd: 00:01:03

Unexpected error fetching RecycleAppGetCollections data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/recycle_app/__init__.py", line 61, in async_update_collections
    return await hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/recycle_app/api.py", line 139, in get_collections
    collections: array[dict] = self.__get(
                               ^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
olibos commented 1 month ago

Hello @Tommatheussen,

Thank you for your feedback!

I believe the issue might have been caused by Forstplus maintenance, as I experienced the same problem last night. One solution could be to handle this type of error by catching it and rescheduling the sync to run again after a set number of minutes. I’ll look into implementing this.

Thanks again for bringing it to my attention!

github-actions[bot] commented 1 week ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.