Docker container: "Unable to connect to Home Assistant"

Same issue reported for fresh installs…

docker run -d --name=“home-assistant” -v /opt/home-assistant:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant

I can connect to 172.31.253.119:8123 and create the account but then on login I get the error:

Unable to connect to Home Assistant.

When I check the error log:

2018-10-14 07:23:51 WARNING (Recorder) [homeassistant.components.recorder.migrat
ion] Database requires upgrade. Schema version: None

Here is the console output if I run the container interactively:

[root@media1 opt]# rm -rf home-assistant/
[root@media1 opt]# docker rm home-assistant
home-assistant
[root@media1 opt]# mkdir home-assistant
[root@media1 opt]# docker run -t -i --name=“home-assistant” -v /opt/home-assistant:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant
Unable to find configuration. Creating default one in /config
Config directory: /config
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded websocket_api from homeassistant.components.websocket_api
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded frontend from homeassistant.components.frontend
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded api from homeassistant.components.api
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded http from homeassistant.components.http
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded system_log from homeassistant.components.system_log
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded auth from homeassistant.components.auth
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded onboarding from homeassistant.components.onboarding
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded lovelace from homeassistant.components.lovelace
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded introduction from homeassistant.components.introduction
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up introduction
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.components.introduction]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Hello, and welcome to Home Assistant!

    We'll hope that we can make all your dreams come true.

    Here are some resources to get started:

     - Configuring Home Assistant:
       https://home-assistant.io/getting-started/configuration/

     - Available components:
       https://home-assistant.io/components/

     - Troubleshooting your configuration:
       https://home-assistant.io/getting-started/troubleshooting-configuration/

     - Getting help:
       https://home-assistant.io/help/

    This message is generated by the introduction component. You can
    disable it in configuration.yaml.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded persistent_notification from homeassistant.components.persistent_notification
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setup of domain introduction took 0.0 seconds.
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded history from homeassistant.components.history
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.loader] Loaded recorder from homeassistant.components.recorder
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up http
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up lovelace
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setup of domain lovelace took 0.0 seconds.
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up recorder
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds.
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up system_log
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds.
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up auth
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setup of domain auth took 0.0 seconds.
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up onboarding
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up api
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds.
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setup of domain onboarding took 0.0 seconds.
2018-10-14 08:03:26 INFO (MainThread) [homeassistant.setup] Setting up frontend
2018-10-14 08:03:27 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.5 seconds.
2018-10-14 08:03:27 WARNING (Recorder) [homeassistant.components.recorder.migration] Database requires upgrade. Schema version: None
2018-10-14 08:03:27 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 1.4 seconds.
2018-10-14 08:03:27 INFO (MainThread) [homeassistant.setup] Setting up history
2018-10-14 08:03:27 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds.
2018-10-14 08:03:27 INFO (MainThread) [homeassistant.loader] Loaded config from homeassistant.components.config
2018-10-14 08:03:27 INFO (MainThread) [homeassistant.loader] Loaded sun from homeassistant.components.sun
2018-10-14 08:03:27 INFO (MainThread) [homeassistant.setup] Setting up sun
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.1 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded group from homeassistant.components.group
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up group
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain group took 0.0 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded discovery from homeassistant.components.discovery
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up discovery
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain discovery took 0.0 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded conversation from homeassistant.components.conversation
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded updater from homeassistant.components.updater
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up updater
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded logbook from homeassistant.components.logbook
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded cloud from homeassistant.components.cloud
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded automation from homeassistant.components.automation
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded script from homeassistant.components.script
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded map from homeassistant.components.map
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up map
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain map took 0.0 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded sensor from homeassistant.components.sensor
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded sensor.yr from homeassistant.components.sensor.yr
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up sensor
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded tts from homeassistant.components.tts
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded tts.google from homeassistant.components.tts.google
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.yr
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 0.2 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up config
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up conversation
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up logbook
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.0 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up cloud
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain cloud took 0.0 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up automation
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.0 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up script
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.0 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setting up tts
2018-10-14 08:03:28 INFO (SyncWorker_14) [homeassistant.components.tts] Create cache dir /config/tts.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.customize from homeassistant.components.config.customize
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.auth from homeassistant.components.config.auth
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.device_registry from homeassistant.components.config.device_registry
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.auth_provider_homeassistant from homeassistant.components.config.auth_provider_homeassistant
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.entity_registry from homeassistant.components.config.entity_registry
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.group from homeassistant.components.config.group
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.config_entries from homeassistant.components.config.config_entries
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.automation from homeassistant.components.config.automation
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.hassbian from homeassistant.components.config.hassbian
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.core from homeassistant.components.config.core
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.loader] Loaded config.script from homeassistant.components.config.script
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.2 seconds.
2018-10-14 08:03:28 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.1 seconds.
2018-10-14 08:03:29 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.8 seconds.
2018-10-14 08:03:29 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 3.05s
2018-10-14 08:03:29 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2018-10-14 08:03:29 INFO (MainThread) [homeassistant.core] Timer:starting
2018-10-14 08:03:39 WARNING (SyncWorker_12) [netdisco.ssdp] Found malformed XML at http : // 172.31.253.118:9080: status=ok
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.components.discovery] Found new service: harmony {‘host’: ‘172.31.252.198’, ‘port’: 8088, ‘ssdp_description’: ‘http : // 172.31.252.198:8088/description’, ‘name’: ‘Harmony Hub’, ‘model_name’: ‘Harmony Hub’, ‘model_number’: None, ‘serial’: None, ‘manufacturer’: ‘Logitech’, ‘udn’: ‘’, ‘upnp_device_type’: ‘urn:myharmony-com:device:harmony:1’}
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.components.discovery] Unknown service discovered: homekit {‘host’: ‘172.31.255.12’, ‘port’: 80, ‘hostname’: ‘porch light.local.’, ‘properties’: {‘c#’: ‘20’, ‘ff’: ‘1’, ‘id’: ‘’, ‘md’: ‘NS-CH1XIS8’, ‘pv’: ‘1.0’, ‘s#’: ‘1’, ‘sf’: ‘0’, ‘ci’: ‘8’}, ‘name’: ‘InwallSwitch-A436E8’}
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.components.discovery] Unknown service discovered: homekit {‘host’: ‘172.31.255.11’, ‘port’: 80, ‘hostname’: ‘NS-CH1XIS8.local.’, ‘properties’: {‘c#’: ‘20’, ‘ff’: ‘1’, ‘id’: ‘’, ‘md’: ‘NS-CH1XIS8’, ‘pv’: ‘1.0’, ‘s#’: ‘1’, ‘sf’: ‘0’, ‘ci’: ‘8’}, ‘name’: ‘InwallSwitch-A43F2A’}
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.loader] Loaded upnp from homeassistant.components.upnp
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.components.discovery] Found new service: plex_mediaserver {‘name’: ‘home’, ‘host’: ‘172.31.253.119’, ‘port’: ‘32400’, ‘urlbase’: ‘https : // 172.31.253.119:32400’}
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.loader] Loaded remote from homeassistant.components.remote
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.loader] Loaded media_player from homeassistant.components.media_player
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.setup] Setting up remote
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.setup] Setup of domain remote took 0.0 seconds.
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.setup] Setting up media_player
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.setup] Setup of domain media_player took 0.0 seconds.
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.loader] Loaded remote.harmony from homeassistant.components.remote.harmony
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.components.remote] Setting up remote.harmony
2018-10-14 08:03:45 INFO (SyncWorker_6) [homeassistant.components.remote.harmony] Loading Harmony Platform: Harmony Hub at 172.31.252.198:5222, startup activity: None
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.loader] Loaded media_player.plex from homeassistant.components.media_player.plex
2018-10-14 08:03:45 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.plex
2018-10-14 08:03:45 INFO (SyncWorker_13) [homeassistant.components.media_player.plex] Discovered PLEX server: 172.31.253.119:32400
2018-10-14 08:03:46 INFO (SyncWorker_13) [homeassistant.components.media_player.plex] Discovery configuration done (no token needed)
2018-10-14 08:03:46 INFO (SyncWorker_13) [homeassistant.components.media_player.plex] Connected to: http : // 172.31.253.119:32400
2018-10-14 08:04:04 INFO (MainThread) [homeassistant.components.http.view] Serving / to 172.17.0.2 (auth: False)
2018-10-14 08:04:04 INFO (MainThread) [homeassistant.components.http.view] Serving /api/onboarding to 172.17.0.2 (auth: False)
2018-10-14 08:04:22 INFO (MainThread) [homeassistant.components.http.view] Serving /api/onboarding/users to 172.17.0.2 (auth: False)
2018-10-14 08:04:22 INFO (MainThread) [homeassistant.components.http.view] Serving / to 172.17.0.2 (auth: False)
2018-10-14 08:04:22 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/authorize to 172.17.0.2 (auth: False)
2018-10-14 08:04:22 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/providers to 172.17.0.2 (auth: False)
2018-10-14 08:04:22 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow to 172.17.0.2 (auth: False)
2018-10-14 08:04:31 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow/e853f42757664800b5b7864520ce63b1 to 172.17.0.2 (auth: False)
2018-10-14 08:04:31 INFO (MainThread) [homeassistant.components.http.view] Serving / to 172.17.0.2 (auth: False)
2018-10-14 08:04:31 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/token to 172.17.0.2 (auth: False)

Just in case there is any doubt:

Looks like the problem strictly happens in my windows computer. I tried logging in my phone, and it instead did loading. After a long wait it came to the same error, but the retry worked for my phone.

After playing around a bit on my Windows box, I found the problem is the home assistant login fails when using a proxy. I use a proxy on my windows machine, because normally I have VPN running, but I don’t want my web browser traffic going through the VPN. I added 172.31.. to my exclude list, and now it works. Interesting enough I already had 172.31. in my exclude list, because windows claims you just need to list what it starts with, but it looks like windows requires wildcards to complete the hostname.

Somewhere obvious it should be indicated the failure is because a proxy is being used. I’m not sure why proxies are being blocked, but perhaps there is a valid security concern for doing so.