Unable to Access HA Instance

I’m running HA 0.80.1 on a Raspberry Pi 3 B+ in a virtual environment. I keep receiving Connection Error message with the following content: There was an error connecting to Home Assistant. Please confirm the settings are correct and save to attempt to reconnect. The error was: The operation couldn’t be completed. (Shared.TokenManager.Token Error error 1.) while trying to connect through iOS Companion App version 1.5.0 (17). I have a static IP and I use noip. I am using mydomain.ddns.net:8123 as external URL.

Have you accessed externally before? Do you have port 8123 open?

Can you access through a normal browser and not the app?

Since you are on a phone are you connected to your home WiFi or using the cellular connection?

Well, I’m having such problems since auth came onboard. I can sometimes access through home LAN or WAN, however after an upgrade I lose my access. Since this is not something common, I’d like to figure out what the exact problem is. Last night I could access through app, browsers, external and internal. This morning I lost all the access.

Have you confirmed HomeAssistant is still running? Have you confirmed your external IP has been updated with your dynamic DNS service?

Be sure to clear your cache or use incognito/private mode when troubleshooting. You can not actually connect but due to the cache it will appear the login/loading screen is connected.

If you want help you are going to have to give some more info about your setup and narrow down some of the variables.

If those two tests pass:

If those two tests pass:

  • Try connecting from home with WiFi on using the app.
  • Try connecting from home with WiFi off using the app.

If those two tests pass you don’t have a problem. :slight_smile:

Thanks for your feedback. I’ve tried all of those, however no success. One weird thing is that; after stopping HA and deleting the auth, auth_provider.homeassistant and onboarding files in the .storage folder and restarting the instance first nothing happens. After creating my user through command line script, I can access to onboarding interface. Once filled in, again nothing happens and I’ve repeated this fill in process through several devices. This resulted in having several users with same user name but different tokens in auth file. I’ve deleted the previous ones manually but this didn’t help.

This morning I’m trying stopping HA and deleting the three files and keep my patience to create the user through onboarding interface.

@awarecan. Can you help here?

Today’s attempts did not solve the problems. I can connect to the Raspberry Pi via VNC. Actually, I can’t access to frontend even at http://localhost:8123 or http://localhost:8123/states?frontend_es5

@awarecan help please! How can I disable auth so that I can check if my problem is with auth or not?

This will never work, you can only access via external domain name, not external IP.

This is not necessary or commend step. You should create user via onboarding

I’m aware of the limitations with regards to IP, I use no-ip and my hosts file is updated with my domain name.

My problem was, after upgrading HA onboarding screen was launching very late (after a couple of hours perhaps) so I started creating the user through command line.

The original post is clearly about iOS app, but the rest troubleshooting really confused me. When you said you cannot connect, what is exactly symptom?

There are several threads in github about the system crash/hangup. Please check if you have Chromecast component or ping sensor.

I was experiencing difficulties but somehow connecting (at least within my LAN). The day before I didn’t have any problem at night and in the morning I lost my access to the front end. check_config script does not give any error, when I check with systemctl status HA is running and only errors regarding some components can be seen. I tried javascript versions, which didn’t help either.

I use Chromium on the Raspberry Pi that I’m running HA instance and when I tried to go to address localhost:8123 I’m getting “This page isn’t working, localhost didn’t send any data ERR_EMPTY_RESPONSE” error.

I don’t have Chromecast component or ping sensor.

I will try to reinstall everything.

Reinstall didn’t work.

Recommendations in https://www.home-assistant.io/docs/installation/troubleshooting/ didn’t work.

I’ve deleted the three files in .storage folder and commented out everything in configuration.yaml including frontend: component and succeeded to start HA with the following:

Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 INFO (MainThread) [homeassistant.loader] Loaded auth from homeassistant.components.auth
Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 INFO (MainThread) [homeassistant.loader] Loaded onboarding from homeassistant.components.onboarding
Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 INFO (MainThread) [homeassistant.loader] Loaded lovelace from homeassistant.components.lovelace
Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 ERROR (MainThread) [homeassistant.config] Invalid config for [frontend]: [key] is an invalid option for [frontend]. Ch
Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Invalid config.
Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 INFO (MainThread) [homeassistant.setup] Setting up http
Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 0.53s
Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 INFO (MainThread) [homeassistant.core] Starting Home Assistant
Oct 18 08:52:32 raspberrypi hass[8697]: 2018-10-18 08:52:32 INFO (MainThread) [homeassistant.core] Timer:starting
~

Then I deleted the line with the commented frontend: and introduced a new line with frontend: only. What I got are as follows:

Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 ERROR (MainThread) [homeassistant.setup] Setup failed for auth: Could not set up all dependencies.
Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: h
Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of api. Setup failed for dependencies: http
Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 ERROR (MainThread) [homeassistant.setup] Setup failed for api: Could not set up all dependencies.
Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: api
Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 0.60s
Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 INFO (MainThread) [homeassistant.core] Starting Home Assistant
Oct 18 08:55:51 raspberrypi hass[8816]: 2018-10-18 08:55:51 INFO (MainThread) [homeassistant.core] Timer:starting

I did a fresh install on a Python 3.7 virtual environment, deleted all files created by HA in config folder and commented out everything in configuration.yaml which let me log in. Then I started bringing back components one by one.

My configuration.yaml is splitted as many others. Once these split components are uncommented, I can not log in and the browser gives “Unable to connect to Home Assistant” error.

The content of home-assistant.log at this point is as follows:

2018-10-19 13:25:49 ERROR (MainThread) [homeassistant.components.device_tracker] Unable to load /home/homeassistant/.homeassistant/known_devices.yaml: Config file not found: /ho$
2018-10-19 13:25:50 ERROR (SyncWorker_7) [homeassistant.components.notify.ios] The notify.ios platform was loaded but no devices exist! Please check the documentation at https:/$
2018-10-19 13:25:55 ERROR (SyncWorker_1) [miio.device] Unable to discover a device at address 192.168.0.19
2018-10-19 13:25:55 WARNING (SyncWorker_1) [homeassistant.components.vacuum.xiaomi_miio] Got exception while fetching the state: Unable to discover the device 192.168.0.19
2018-10-19 13:26:01 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 176.54.110.48
2018-10-19 13:26:04 ERROR (MainThread) [homeassistant.core] Error doing job: SSL handshake failed
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 625, in _on_handshake_complete
raise handshake_exc
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 189, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1045)
2018-10-19 13:26:04 ERROR (MainThread) [homeassistant.core] Error doing job: SSL error in data received
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 189, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1045)
2018-10-19 13:26:09 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/apple_tv.py”, line 170, in atv_discovered
CONF_START_OFF: False
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/apple_tv.py”, line 192, in _setup_atv
import pyatv
File “/srv/homeassistant/lib/python3.7/site-packages/pyatv/init.py”, line 12, in
from pyatv.pairing import PairingHandler
File “/srv/homeassistant/lib/python3.7/site-packages/pyatv/pairing.py”, line 11, in
import netifaces
ModuleNotFoundError: No module named ‘netifaces’
2018-10-19 13:26:09 WARNING (MainThread) [homeassistant.components.hue] Connected to Hue at 192.168.0.9 but not registered.
2018-10-19 13:26:09 WARNING (MainThread) [homeassistant.components.hue] Connected to Hue at 192.168.0.9 but not registered.
2018-10-19 13:26:12 ERROR (MainThread) [homeassistant.core] Error doing job: SSL handshake failed
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 625, in _on_handshake_complete
raise handshake_exc
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 189, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1045)
2018-10-19 13:26:12 ERROR (MainThread) [homeassistant.core] Error doing job: SSL error in data received
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 189, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1045)
2018-10-19 13:26:20 ERROR (MainThread) [homeassistant.core] Error doing job: SSL handshake failed
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 625, in _on_handshake_complete
raise handshake_exc
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 189, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1045)
2018-10-19 13:26:20 ERROR (MainThread) [homeassistant.core] Error doing job: SSL error in data received
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 189, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1045)
2018-10-19 13:26:21 ERROR (SyncWorker_1) [miio.device] Unable to discover a device at address 192.168.0.19
2018-10-19 13:26:21 WARNING (SyncWorker_1) [homeassistant.components.vacuum.xiaomi_miio] Got exception while fetching the state: Unable to discover the device 192.168.0.19
2018-10-19 13:26:29 ERROR (MainThread) [homeassistant.core] Error doing job: SSL handshake failed
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 625, in _on_handshake_complete
raise handshake_exc
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 189, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1045)
2018-10-19 13:26:29 ERROR (MainThread) [homeassistant.core] Error doing job: SSL error in data received
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 189, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1045)
2018-10-19 13:26:35 ERROR (MainThread) [homeassistant.core] Error doing job: SSL handshake failed
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 625, in _on_handshake_complete
raise handshake_exc
File “/usr/local/lib/python3.7/asyncio/sslproto.py”, line 189, in feed_ssldata
self._sslobj.do_handshake()
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1045)

The culprits are sensors.yaml and automations.yaml which contained some strange characters. These were accented Turkish entity names that were converted to some set of special characters by nano, but everything was working well. Such characters were cleaned, however the problem is still ongoing. Any ideas?

The latest log is as follows:

2018-10-19 17:20:17 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Huawei Home Gateway for upnp
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config_entries.py", line 236, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/upnp/__init__.py", line 128, in async_setup_entry
    await device.async_add_port_mappings(ports, local_ip=local_ip)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/upnp/device.py", line 69, in async_add_port_mappings
    internal_port)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/upnp/device.py", line 90, in _async_add_port_mapping
    lease_duration=None)
  File "/srv/homeassistant/lib/python3.7/site-packages/async_upnp_client/igd.py", line 83, in async_add_port_mapping
    await action.async_call(
AttributeError: 'NoneType' object has no attribute 'async_call'
2018-10-19 17:20:26 WARNING (MainThread) [homeassistant.components.switch] Setup of platform broadlink is taking over 10 seconds.
2018-10-19 17:20:32 ERROR (SyncWorker_15) [homeassistant.components.switch.broadlink] Failed to connect to device
2018-10-19 17:20:37 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-10-19 17:20:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/apple_tv.py", line 170, in atv_discovered
    CONF_START_OFF: False
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/apple_tv.py", line 192, in _setup_atv
    import pyatv
  File "/srv/homeassistant/lib/python3.7/site-packages/pyatv/__init__.py", line 12, in <module>
    from pyatv.pairing import PairingHandler
  File "/srv/homeassistant/lib/python3.7/site-packages/pyatv/pairing.py", line 11, in <module>
    import netifaces
ModuleNotFoundError: No module named 'netifaces'
2018-10-19 17:20:46 WARNING (MainThread) [homeassistant.components.hue] Connected to Hue at 192.168.0.9 but not registered.
2018-10-19 17:20:46 WARNING (MainThread) [homeassistant.components.hue] Connected to Hue at 192.168.0.9 but not registered.
2018-10-19 17:20:57 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/device_tracker/__init__.py", line 348, in async_update_config
    dev_id, device)
  File "/usr/local/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/device_tracker/__init__.py", line 741, in update_config
    out.write(dump(device))
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2019' in position 69: ordinal not in range(256)
2018-10-19 17:21:27 ERROR (MainThread) [homeassistant.components.websocket_api.decorators] Unexpected exception
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 171, 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 79, in create_connection
    raise err
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/connection.py", line 69, in create_connection
    sock.connect(sa)
OSError: [Errno 113] No route to host

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 600, in urlopen
    chunked=chunked)
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 196, in connect
    conn = self._new_conn()
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x643b3070>: Failed to establish a new connection: [Errno 113] No route to host

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 445, in send
    timeout=timeout
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.0.100', port=8080): Max retries exceeded with url: /stream/video/mjpeg (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x643b3070>: Failed to establish a new connection: [Errno 113] No route to host'))

The last error repeats…

I’ve retyped the contents of both sensors.yaml and automations.yaml and got rid of all unusual characters. Everything is back in good order now. Thanks for your contribution.

1 Like