olibos/HomeAssistant-RecycleApp

App entities in error.

Closed this issue · 11 comments

The entities of the app are constantly in error with message:
This entity is no longer being provided by the recycle_app integration. If the entity is no longer in use, delete it in settings.
I reload the integration and sometimes it fixes the issue but then after a while I get the same error.

olibos commented

Hello @eappels, is it possible that you lose your internet access during the night?
Normally the integration updates at midnight.

Hmmm that's very well possible, I know I had an auto reload of something scheduled.
I will reschedule it to another time instead of midnight and see if that resolves the issue.
I will report back with the outcome in a few days.

It was working fine yesterday, removed the HA reload which was scheduled at midnight.
This morning same issue, all entities show up in error.
I'm sure my internet connection is working fine but I noticed this in the debugging logs:

2023-10-31 06:06:45.875 ERROR (MainThread) [custom_components.recycle_app.sensor] Error requesting RecycleAppGetCollections data: HTTPSConnectionPool(host='www.recycleapp.be', port=443): Max retries exceeded with url: /config/app.settings.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7034805390>: Failed to establish a new connection: [Errno -3] Try again')) 2023-10-31 06:06:45.876 DEBUG (MainThread) [custom_components.recycle_app.sensor] Finished fetching RecycleAppGetCollections data in 5.242 seconds (success: False) 2023-10-31 06:06:45.878 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform recycle_app Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1057, in add_to_platform_finish self.async_write_ha_state() File "/config/custom_components/recycle_app/sensor.py", line 147, in async_write_ha_state value = self.native_value ^^^^^^^^^^^^^^^^^ File "/config/custom_components/recycle_app/sensor.py", line 135, in native_value return self.coordinator.data[self._fraction] if self._fraction in self.coordinator.data else None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable 2023-10-31 06:06:45.895 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up recycle_app platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform await asyncio.gather(*pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1057, in add_to_platform_finish self.async_write_ha_state() File "/config/custom_components/recycle_app/sensor.py", line 147, in async_write_ha_state value = self.native_value ^^^^^^^^^^^^^^^^^ File "/config/custom_components/recycle_app/sensor.py", line 135, in native_value return self.coordinator.data[self._fraction] if self._fraction in self.coordinator.data else None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable

I also just reloaded the integration and I get the same error and my internet is fine.

2023-10-31 06:22:09.516 DEBUG (MainThread) [custom_components.recycle_app.sensor] zip_code_id: REMOVED 2023-10-31 06:22:09.516 DEBUG (MainThread) [custom_components.recycle_app.sensor] street_id: REMOVED 2023-10-31 06:22:09.516 DEBUG (MainThread) [custom_components.recycle_app.sensor] house_number: REMOVED 2023-10-31 06:22:09.516 DEBUG (MainThread) [custom_components.recycle_app.sensor] fractions: {'5d610b86162c063cc0400108': ['#C7D33B', 'Groente, fruit- en tuinafval'], '5d610b86162c063cc0400125': ['#60b1df', 'PMD'], '5d610b86162c063cc0400133': ['#767676', 'Restafval'], '5d610b86162c063cc0400102': ['#252D2C', 'Kerstboomophaling'], '5d610b86162c063cc0400123': ['#F2B03B', 'Papier-karton'], '5d610b86162c063cc0400127': ['#7C4422', 'Snoeihout']} 2023-10-31 06:22:09.516 DEBUG (MainThread) [custom_components.recycle_app.sensor] language: nl 2023-10-31 06:22:09.516 DEBUG (MainThread) [custom_components.recycle_app.sensor] format: %Y-%m-%d 2023-10-31 06:22:09.516 DEBUG (MainThread) [custom_components.recycle_app.sensor] Update collections 2023-10-31 06:22:14.665 ERROR (MainThread) [custom_components.recycle_app.sensor] Error requesting RecycleAppGetCollections data: HTTPSConnectionPool(host='www.recycleapp.be', port=443): Max retries exceeded with url: /config/app.settings.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f702cbce210>: Failed to establish a new connection: [Errno -3] Try again')) 2023-10-31 06:22:14.665 DEBUG (MainThread) [custom_components.recycle_app.sensor] Finished fetching RecycleAppGetCollections data in 5.149 seconds (success: False) 2023-10-31 06:22:14.667 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform recycle_app Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1057, in add_to_platform_finish self.async_write_ha_state() File "/config/custom_components/recycle_app/sensor.py", line 147, in async_write_ha_state value = self.native_value ^^^^^^^^^^^^^^^^^ File "/config/custom_components/recycle_app/sensor.py", line 135, in native_value return self.coordinator.data[self._fraction] if self._fraction in self.coordinator.data else None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable 2023-10-31 06:22:14.670 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up recycle_app platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform await asyncio.gather(*pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1057, in add_to_platform_finish self.async_write_ha_state() File "/config/custom_components/recycle_app/sensor.py", line 147, in async_write_ha_state value = self.native_value ^^^^^^^^^^^^^^^^^ File "/config/custom_components/recycle_app/sensor.py", line 135, in native_value return self.coordinator.data[self._fraction] if self._fraction in self.coordinator.data else None ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable

olibos commented

Thanks for the feedback, I'll check next week

Hi @eappels,

I know, it was a long week 😉

Just checking in to see if you're still encountering the issue after updating to the latest version?

Thanks a lot!

I reinstalled the integration and will keep an eye on it.
Will report back in a few days.

As far as I can tell, the issue is still the same and I get an error:

`2024-04-05 05:33:36.132 DEBUG (MainThread) [custom_components.recycle_app] zip_code_id: 9185-44073
2024-04-05 05:33:36.132 DEBUG (MainThread) [custom_components.recycle_app] street_id: https://data.vlaanderen.be/id/straatnaam-73789
2024-04-05 05:33:36.132 DEBUG (MainThread) [custom_components.recycle_app] house_number: 13
2024-04-05 05:33:36.132 DEBUG (MainThread) [custom_components.recycle_app] fractions: {'5d610b86162c063cc0400108': ['#C7D33B', 'Groente, fruit- en tuinafval'], '5d610b86162c063cc0400102': ['#252D2C', 'Kerstboomophaling'], '5d610b86162c063cc0400133': ['#767676', 'Restafval'], '5d610b86162c063cc0400125': ['#60b1df', 'PMD'], '5d610b86162c063cc0400123': ['#F2B03B', 'Papier-karton'], '5d610b86162c063cc0400127': ['#7C4422', 'Snoeihout']}
2024-04-05 05:33:36.132 DEBUG (MainThread) [custom_components.recycle_app] language: nl
2024-04-05 05:33:36.132 DEBUG (MainThread) [custom_components.recycle_app] format: %Y-%m-%d
2024-04-05 05:33:36.133 DEBUG (MainThread) [custom_components.recycle_app] parks: ['5e8eda1110cfeaa15ca76ba3'] [9060-43018]
2024-04-05 05:33:41.284 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 13 Leeuwerikstraat, 9185 - Wachtebeke for recycle_app
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/util/connection.py", line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/socket.py", line 963, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 715, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 404, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1058, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 363, in connect
self.sock = conn = self._new_conn()
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fb22a1d8fb0>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 799, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.recycleapp.be', port=443): Max retries exceeded with url: /config/app.settings.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fb22a1d8fb0>: Failed to establish a new connection: [Errno -3] Try again'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/recycle_app/init.py", line 103, in async_setup_entry
await hass.async_add_executor_job(api.initialize)
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 19, in initialize
self.__ensure_initialization()
File "/config/custom_components/recycle_app/api.py", line 35, in __ensure_initialization
base_url = self.__session.get(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 725, in send
history = [resp for resp in gen]
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 266, in resolve_redirects
resp = self.send(
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.recycleapp.be', port=443): Max retries exceeded with url: /config/app.settings.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fb22a1d8fb0>: Failed to establish a new connection: [Errno -3] Try again'))`

I suppose that was a reload of the integration? Because normally the sync is at midnight.
Does the website was accessible from your browser at that time?

I suppose that was a reload of the integration? Because normally the sync is at midnight. Does the website was accessible from your browser at that time?

Yes correct, it was after a reload.
I reinstalled the integration and since then it's working fine.

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.