Giter Club home page Giter Club logo

Comments (15)

amaximus avatar amaximus commented on August 19, 2024

@zbeez I just pushed a new release fixing the reported issue.

Please update the component, restart HASS and get back to me with results.

from bkk_stop.

zbeez avatar zbeez commented on August 19, 2024

Thank you for the fast action. I did an update and restarted. Checked my logs and this came up:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:682
integration: Sensor (documentation, issues)
First occurred: 18:40:09 (3 occurrences)
Last logged: 18:40:10

bkk_stop: Error on device update!
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1173, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 884, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/resolver.py", line 33, in resolve
infos = await self._loop.getaddrinfo(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 899, in getaddrinfo
return await self.run_in_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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

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

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 682, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1262, in async_device_update
await self.async_update()
File "/config/custom_components/bkk_stop/sensor.py", line 180, in async_update
async with _session.get(BKKURL, timeout=HTTP_TIMEOUT) as response:
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 578, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 911, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1187, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host go.bkk.hu:443 ssl:default [Try again]

I will give it a time to check on behaviour. Maybe it needs a few mins more.

from bkk_stop.

amaximus avatar amaximus commented on August 19, 2024

I just pushed a release for adding retries on the data fetching from BKK.

Please upgrade the component, enable debugging, restart HASS and check the logs.

Please get back to me with results.

from bkk_stop.

zbeez avatar zbeez commented on August 19, 2024

I finally got back home and restarted just in case to clear everything and make a fresh start.
Then I saw this error:
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:682
integration: Sensor (documentation, issues)
First occurred: 21:46:32 (3 occurrences)
Last logged: 21:46:32

bkk_stop: Error on device update!
Traceback (most recent call last):
File "/config/custom_components/bkk_stop/sensor.py", line 184, in async_update
async with _session.get(BKKURL, timeout=HTTP_TIMEOUT) as response:
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 504, in _request
with timer:
File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in exit
raise asyncio.TimeoutError from None
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 682, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1262, in async_device_update
await self.async_update()
File "/config/custom_components/bkk_stop/sensor.py", line 190, in async_update
except (aiohttp.ContentTypeError, aiohttp.ServerDisconnectedError, asyncio.TimeoutError, ClientConnectorError):
^^^^^^^
NameError: name 'asyncio' is not defined. Did you forget to import 'asyncio'

Have also an error on the water_quality_fvm but I'll post in the proper repository.

from bkk_stop.

amaximus avatar amaximus commented on August 19, 2024

I just pushed a new release fixing this later issue.

Please upgrade the component, enable debugging, restart HASS and check the logs.

Please get back to me with results.

from bkk_stop.

zbeez avatar zbeez commented on August 19, 2024

Hi amaximus,

I let it run for a while just to check and have these two entries in the log:

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1232
First occurred: 03:00:27 (6 occurrences)
Last logged: 16:10:36

Update of sensor.bkksensorname1 is taking over 10 seconds
Update of sensor.bkksensorname2 is taking over 10 seconds
Update of sensor.bkksensorname3 is taking over 10 seconds

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:945
First occurred: March 26, 2024 at 23:04:22 (321 occurrences)
Last logged: 22:30:31

Update for sensor.bkksensorname1 fails
Update for sensor.bkksensorname2 fails
Update for sensor.bkksensorname3 fails
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1173, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 884, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/resolver.py", line 33, in resolve
infos = await self._loop.getaddrinfo(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 899, in getaddrinfo
return await self.run_in_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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

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

Traceback (most recent call last):
File "/config/custom_components/bkk_stop/sensor.py", line 187, in async_update
async with _session.get(BKKURL, timeout=HTTP_TIMEOUT) as response:
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 578, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 911, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1187, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host go.bkk.hu:443 ssl:default [Try again]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 945, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1262, in async_device_update
await self.async_update()
File "/config/custom_components/bkk_stop/sensor.py", line 193, in async_update
except (aiohttp.ContentTypeError, aiohttp.ServerDisconnectedError, asyncio.TimeoutError, ClientConnectorError):
^^^^^^^^^^^^^^^^^^^^
NameError: name 'ClientConnectorError' is not defined

Let me know what you think.

from bkk_stop.

amaximus avatar amaximus commented on August 19, 2024

Fixed it and added more debugging info to the latest release. Hopefully that will reveal what connection issue you have.

from bkk_stop.

zbeez avatar zbeez commented on August 19, 2024

It's a pretty odd situation. I still get the below error but my yaml config is using 3 different configs (1 for each stop location). Here only the first one is working properly and the other 2 sensor show "unavailable".

This is the error:
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:682
integration: Sensor (documentation, issues)
First occurred: 16:12:42 (2 occurrences)
Last logged: 16:12:42

bkk_stop: Error on device update!
Traceback (most recent call last):
File "/config/custom_components/bkk_stop/sensor.py", line 187, in async_update
async with _session.get(BKKURL, timeout=HTTP_TIMEOUT) as response:
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 605, in _request
await resp.start(conn)
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 961, in start
with self._timer:
File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in exit
raise asyncio.TimeoutError from None
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 682, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1262, in async_device_update
await self.async_update()
File "/config/custom_components/bkk_stop/sensor.py", line 195, in async_update
except (aiohttp.ContentTypeError, aiohttp.ServerDisconnectedError, asyncio.TimeoutError, ClientConnectorError) as err:
^^^^^^^^^^^^^^^^^^^^
NameError: name 'ClientConnectorError' is not defined

from bkk_stop.

amaximus avatar amaximus commented on August 19, 2024

Just pushed a release fixing the connection error handling.

from bkk_stop.

zbeez avatar zbeez commented on August 19, 2024

Thank you amaximus! The sensors all work now again.
This is the only log entry I found so far:

This error originated from a custom integration.

Logger: custom_components.bkk_stop.sensor
Source: custom_components/bkk_stop/sensor.py:198
integration: bkk_stop (documentation, issues)
First occurred: March 29, 2024 at 17:06:27 (346 occurrences)
Last logged: 14:54:34

error: Cannot connect to host go.bkk.hu:443 ssl:default [Try again] of type: <class 'aiohttp.client_exceptions.ClientConnectorError'>
error: of type: <class 'TimeoutError'>
error: unexpected character: line 1 column 1 (char 0) of type: <class 'orjson.JSONDecodeError'>

from bkk_stop.

zbeez avatar zbeez commented on August 19, 2024

Hello amaximus, I meanwhile switched to Nabu Casa (HA Cloud) and checked all the connections and possible failing points. Seems that the WAQI sensor, the weather sensor (Open Meteo) and the BKK sensor have nearly the same error message:

This error originated from a custom integration.

Logger: custom_components.bkk_stop.sensor
Source: custom_components/bkk_stop/sensor.py:198
integration: bkk_stop (documentation, issues)
First occurred: 11:31:59 (99 occurrences)
Last logged: 18:30:04

error: Cannot connect to host go.bkk.hu:443 ssl:default [Try again] of type: <class 'aiohttp.client_exceptions.ClientConnectorError'>

Might be now an error generated by my ISP (Digi) but I'm unsure at the moment. No other sensor drops such an error anymore.

from bkk_stop.

amaximus avatar amaximus commented on August 19, 2024

The new release increases the connection timeout to 1 minute.

from bkk_stop.

zbeez avatar zbeez commented on August 19, 2024

I left it now to run quite a while just to check if something else fails, but this is the only error showing up:
This error originated from a custom integration.

Logger: custom_components.bkk_stop.sensor
Source: custom_components/bkk_stop/sensor.py:198
integration: bkk_stop (documentation, issues)
First occurred: 15:56:29 (13 occurrences)
Last logged: 17:55:00

error: unexpected character: line 1 column 1 (char 0) of type: <class 'orjson.JSONDecodeError'>

from bkk_stop.

amaximus avatar amaximus commented on August 19, 2024

Do you use the latest version of the integration? (2.9.10)
Line 198 is:
https://github.com/amaximus/bkk_stop/blob/master/custom_components/bkk_stop/sensor.py#L198

It doesn't have anything json related.

from bkk_stop.

zbeez avatar zbeez commented on August 19, 2024

Hi Maximus,
Yes, I do:
image

As long as the sensor works, I'll let the error be...
In my oppinion, this issue can be closed. Ok for you?

from bkk_stop.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.