core: Environment Canada integration error on startup and won't start.
Home Assistant release with the issue: 0.103.3
Last working Home Assistant release (if known): 0.103.0
Operating environment (Hass.io/Docker/Windows/etc.):
python venv on raspbian Integration:
https://www.home-assistant.io/integrations/environment_canada/
Description of problem: Environment Canada integration won’t load, log file appears to indicate a timeout connecting to the environment canada server, and shows the URLs it is trying to fetch. using wget on the command line has no trouble retrieving those same items from the same host.
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
weather:
- platform: environment_canada
camera:
- platform: environment_canada
sensor:
- platform: environment_canada
Traceback (if applicable):
2019-12-20 18:59:48 WARNING (MainThread) [homeassistant.components.weather] Setup of platform environment_canada is taking over 10 seconds.
2019-12-20 18:59:50 ERROR (MainThread) [homeassistant.components.weather] Error while setting up platform environment_canada
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
conn.connect()
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 334, in connect
conn = self._new_conn()
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 164, in _new_conn
% (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.VerifiedHTTPSConnection object at 0x66162fd0>, 'Connection to dd.weather.gc.ca timed out. (connect timeout=10)')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='dd.weather.gc.ca', port=443): Max retries exceeded with url: /air_quality/doc/AQHI_XML_File_List.xml (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x66162fd0>, 'Connection to dd.weather.gc.ca timed out. (connect timeout=10)'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/environment_canada/weather.py", line 77, in setup_platform
ec_data = ECData(coordinates=(lat, lon))
File "/srv/homeassistant/lib/python3.7/site-packages/env_canada/ec_data.py", line 240, in __init__
self.update()
File "/srv/homeassistant/lib/python3.7/site-packages/env_canada/ec_data.py", line 205, in res
return fun(*args, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/ratelimit/decorators.py", line 80, in wrapper
return func(*args, **kargs)
File "/srv/homeassistant/lib/python3.7/site-packages/env_canada/ec_data.py", line 356, in update
self.aqhi_id = self.closest_aqhi(aqhi_coordinates[0], aqhi_coordinates[1])
File "/srv/homeassistant/lib/python3.7/site-packages/env_canada/ec_data.py", line 480, in closest_aqhi
region_list = self.get_aqhi_regions()
File "/srv/homeassistant/lib/python3.7/site-packages/env_canada/ec_data.py", line 453, in get_aqhi_regions
result = requests.get(AQHI_SITE_LIST_URL, timeout=10)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 504, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='dd.weather.gc.ca', port=443): Max retries exceeded with url: /air_quality/doc/AQHI_XML_File_List.xml (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x66162fd0>, 'Connection to dd.weather.gc.ca timed out. (connect timeout=10)'))
2019-12-20 18:59:50 WARNING (MainThread) [homeassistant.components.camera] Setup of platform environment_canada is taking over 10 seconds.
2019-12-20 19:01:52 ERROR (MainThread) [homeassistant.components.camera] environment_canada: Error on device update!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
conn.connect()
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 334, in connect
conn = self._new_conn()
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x64eee6f0>: Failed to establish a new connection: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='dd.weather.gc.ca', port=443): Max retries exceeded with url: /radar/PRECIPET/GIF/XSM/?C=M;O=D (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x64eee6f0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 461, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 240, in wrapper
result = method(*args, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/environment_canada/camera.py", line 104, in update
self.image = self.radar_object.get_loop()
File "/srv/homeassistant/lib/python3.7/site-packages/env_canada/ec_radar.py", line 120, in get_loop
frames = self.get_frames(count)
File "/srv/homeassistant/lib/python3.7/site-packages/env_canada/ec_radar.py", line 68, in get_frames
soup = BeautifulSoup(requests.get(IMAGES_URL.format(self.station_code)).text, 'html.parser')
File "/srv/homeassistant/lib/python3.7/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='dd.weather.gc.ca', port=443): Max retries exceeded with url: /radar/PRECIPET/GIF/XSM/?C=M;O=D (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x64eee6f0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
Additional information:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
I can’t speak for why other things aren’t loading but the root cause seems to be related to dd.weather.gc.ca. I’m having issues retrieving the file from my machine.
wget -v http://dd.weather.gc.ca/citypage_weather/docs/site_list_en.csv –2019-12-21 22:29:47-- http://dd.weather.gc.ca/citypage_weather/docs/site_list_en.csv Resolving dd.weather.gc.ca (dd.weather.gc.ca)… 205.189.10.47 Connecting to dd.weather.gc.ca (dd.weather.gc.ca)|205.189.10.47|:80…
Timeout after the first redirect to https😕/dd.weather.gc.ca/citypage_weather/docs/site_list_en.csv