Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to get current conditions #19

Closed
dhover opened this issue Mar 18, 2022 · 2 comments
Closed

Failed to get current conditions #19

dhover opened this issue Mar 18, 2022 · 2 comments

Comments

@dhover
Copy link

dhover commented Mar 18, 2022

Now and then I get an error "failed to get current conditions ..." including a stack trace.
Maybe it is a suggestion to remove the stack trace from the logfile or move the stack trace to the debug log level.

2022-03-18 11:34:44 WARNING (MainThread) [custom_components.weatherlink] failed to get current conditions, error 1 / 3
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
return await fut
File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.xxx.xxx', 80)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/weatherlink/__init__.py", line 97, in __fetch_data
conditions = await self.session.current_conditions()
File "/config/custom_components/weatherlink/api/rest.py", line 73, in current_conditions
return await self._request(CurrentConditions, EP_CURRENT_CONDITIONS)
File "/config/custom_components/weatherlink/api/rest.py", line 68, in _request
async with self.session.get(self.base_url + path, params=params) as resp:
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.xxx.xxx:80 ssl:default [Connect call failed ('192.168.xxx.xxx', 80)]
@siku2
Copy link
Owner

siku2 commented Mar 19, 2022

This really isn't meant to happen which is why the stack trace is included in the first place, but I think the weatherlink device is just too weak to handle all requests.
I'm fine with dropping the log level for these intermediary errors down a notch.

@siku2
Copy link
Owner

siku2 commented Jul 8, 2022

Reduced the clutter in v0.5.3.

@siku2 siku2 closed this as completed Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants