probnot / wpg-weatherchan

This creates the old-school looking weather channel that was common on Winnipeg cable TV into the 1990s.
MIT License
128 stars 19 forks source link

Temporary failure in name resolution causing script shutdown #5

Closed Tekhnocyte closed 8 months ago

Tekhnocyte commented 8 months ago

13:47.wpg-weather.2.0.4.BOTTOM_MARQUEE-refreshing weather info Traceback (most recent call last): File "/home/tekhnocyte/.local/lib/python3.9/site-packages/aiohttp/connector.py", line 1173, in _create_direct_connection hosts = await asyncio.shield(host_resolved) File "/home/tekhnocyte/.local/lib/python3.9/site-packages/aiohttp/connector.py", line 884, in _resolve_host addrs = await self._resolver.resolve(host, port, family=self._family) File "/home/tekhnocyte/.local/lib/python3.9/site-packages/aiohttp/resolver.py", line 33, in resolve infos = await self._loop.getaddrinfo( File "/usr/lib/python3.9/asyncio/base_events.py", line 856, in getaddrinfo return await self.run_in_executor( File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

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

Traceback (most recent call last): File "/home/tekhnocyte/wpg-weatherchan/wpg-weatherchan.py", line 803, in bottom_marquee(grouptotal) File "/home/tekhnocyte/wpg-weatherchan/wpg-weatherchan.py", line 621, in bottom_marquee weather_update(group) # update weather information between RSS scrolls File "/home/tekhnocyte/wpg-weatherchan/wpg-weatherchan.py", line 538, in weather_update asyncio.run(ec_en_van.update()) File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/usr/local/lib/python3.9/dist-packages/env_canada-0.6.1-py3.9.egg/env_canada/ec_weather.py", line 358, in update response = await session.get( File "/home/tekhnocyte/.local/lib/python3.9/site-packages/aiohttp/client.py", line 574, in _request conn = await self._connector.connect( File "/home/tekhnocyte/.local/lib/python3.9/site-packages/aiohttp/connector.py", line 544, in connect proto = await self._create_connection(req, traces, timeout) File "/home/tekhnocyte/.local/lib/python3.9/site-packages/aiohttp/connector.py", line 911, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/home/tekhnocyte/.local/lib/python3.9/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 dd.weather.gc.ca:443 ssl:default [Temporary failure in name resolution]

Pretty sure this is all just a failiure of the Environment Canada website. Might warrant some error handling in the script? It's a little beyond me in my current greenhorn state, but is anyone out there willing to take it on?

probnot commented 8 months ago

This is beyond me too. I've been having a lot of problems like this lately. I tried updating to the latest version of env_canada, but no luck.

I'm looking to see if there's anything else on here that can pull environment canada data in a more forgiving manner.

probnot commented 8 months ago

Add a few lines in the v2.0.8, which seems to have solved the issue.