Ecobee and Plex errors after setting up Duck DNS and Let's Encrypt

After setting up Duck DNS and Let’s Encrypt my Ecobee and Plex components started throwing errors related to SSL.

Is there something I need to configure to have these work after setting up SSL via Let’s Encrypt?

Here are the errors I’m seeing in the log:

2017-06-26 17:17:39 ERROR (MainThread) [homeassistant.setup] Error during setup of component ecobee
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.4/socket.py", line 530, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x6eb64f50>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/adapters.py", line 438, in send
    timeout=timeout
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.ecobee.com', port=443): Max retries exceeded with url: /1/thermostat?json=%7B%22selection%22%3A%7B%22selectionType%22%3A%22registered%22%2C%22includeRuntime%22%3A%22true%22%2C%22includeSensors%22%3A%22true%22%2C%22includeProgram%22%3A%22true%22%2C%22includeEquipmentStatus%22%3A%22true%22%2C%22includeEvents%22%3A%22true%22%2C%22includeSettings%22%3A%22true%22%7D%7D (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x6eb64f50>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py", line 190, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/ecobee.py", line 121, in setup
    NETWORK = EcobeeData(hass.config.path(ECOBEE_CONFIG_FILE))
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/ecobee.py", line 93, in __init__
    self.ecobee = Ecobee(config_file)
  File "/home/homeassistant/.homeassistant/deps/pyecobee/__init__.py", line 73, in __init__
    self.update()
  File "/home/homeassistant/.homeassistant/deps/pyecobee/__init__.py", line 296, in update
    self.get_thermostats()
  File "/home/homeassistant/.homeassistant/deps/pyecobee/__init__.py", line 132, in get_thermostats
    request = requests.get(url, headers=header, params=params)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/sessions.py", line 518, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/sessions.py", line 639, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/adapters.py", line 502, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.ecobee.com', port=443): Max retries exceeded with url: /1/thermostat?json=%7B%22selection%22%3A%7B%22selectionType%22%3A%22registered%22%2C%22includeRuntime%22%3A%22true%22%2C%22includeSensors%22%3A%22true%22%2C%22includeProgram%22%3A%22true%22%2C%22includeEquipmentStatus%22%3A%22true%22%2C%22includeEvents%22%3A%22true%22%2C%22includeSettings%22%3A%22true%22%7D%7D (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x6eb64f50>: Failed to establish a new connection: [Errno -2] Name or service not known',))
2017-06-26 17:17:39 ERROR (Thread-10) [plexapi] http://localhost:32400: HTTPConnectionPool(host='localhost', port=32400): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x6e6d8f90>: Failed to establish a new connection: [Errno 111] Connection refused',))
2017-06-26 17:17:39 WARNING (MainThread) [homeassistant.components.sensor.yr] Retrying in 15 minutes: [Errno -2] Cannot connect to host aa015h6buqvih86i1.api.met.no:443 ssl:True [Name or service not known]
2017-06-26 17:17:39 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform plex
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 356, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.4/http/client.py", line 1090, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.4/http/client.py", line 1128, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.4/http/client.py", line 1086, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.4/http/client.py", line 924, in _send_output
    self.send(msg)
  File "/usr/lib/python3.4/http/client.py", line 859, in send
    self.connect()
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 166, in connect
    conn = self._new_conn()
  File "/srv/homeassistant/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x6e6d8f90>: Failed to establish a new connection: [Errno 111] Connection refused
2 Likes

Got a similar issue, having problems with duckdns letsencrypt with my plex server.

My home-assistant.log file is showing this error when starting up. https://hastebin.com/bacihozehi.rb I’ve censored the DNS as well as serial number since I’m not sure if that is private. I’ve been following this guide to set up my reverse proxy me plex server and I think that might be the reason why it’s causing an issue.
https://cyanlabs.net/tutorials/the-complete-unraid-reverse-proxy-duck-dns-dynamic-dns-and-letsencrypt-guide/
However I’m not even sure if this is an issue at all since I do see plex showing fine on the home assistant dashboard when playing a movie.
My plex.conf looks something like this (Note I’ve censored the internal IP address and token as well)
{“INTERNALIP:32400”: {“token”: “xxxxxxxxxxxxxxx”, “ssl”: false, “verify”: true}}

2 Likes