Cannot connect to Home Assistant

**** HELP *****

I am not longer able to connect to my home assistant instance. I Had a problem with my certificate not being renewed in the NGINX add-on. I ended up disabling NGINX and setup via duck dns exclusively.

I tested the new setup on my iPad, my iPhone (both local and remote), via browser (chrome) and via the MacOS app. All connected flawlessly.

Thought I have finally resolved the connection issue and now for some reason I cannot connect at all on any device local or remote. Tried via the DuckDNS address, local address and ip address. iPhone, iPad, Mac App and browser. Nothing works. Nothing at all was changed since I tested.

  • Connect via http://[ip address:8123] returns: This page isn’t working [ip address] didn’t send any data. ERR_EMPTY_RESPONSE
  • Connect via http://[ip address]:8123 returns: 403: Forbidden
  • Connect via https://[duckdns-domain]:8123 returns: Unable to connect to Home Assistant.
  • Connect via http://[duckdns-domain]:8123 returns: This page isn’t working [duckdnsdomain] didn’t send any data. ERR_EMPTY_RESPONSE

I can still ping the server and connect to the config share via samba, so that is up apparently.

Why has it suddenly decided refuse connections? Any ideas how I can get this working again? So incredibly frustrating, anyone have a hint as to what gives?

Given that you are able to connect the server, try to read the logs to see what’s going on. (I would easily and bluntly blame nginx :slight_smile: )

2 Likes

Thanks, the only thing I can see is this:

2022-02-06 10:52:39 WARNING (MainThread) [homeassistant.components.dnsip.sensor] Exception while resolving host: (1, 'DNS server returned answer with no data')

This is my http section from configuration.yaml

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: true
  login_attempts_threshold: 6

Bizarre that it should suddenly stop working. Could it be the login attempts part? Haven’t had any login failures until it just stopped accepting connections.

I would turn off ip_ban and see what will happen

1 Like

Comment it out and restart? I’ll give that a try. Just can’t do the check config though.

1 Like

it is an optional setting, it should not break anything, commenting it out.

1 Like

OK, rebooting on proxmox with this config:

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
#  ip_ban_enabled: true
#  login_attempts_threshold: 6

Yeap, looks good

No good. I just get loading data then “Unable to connect to Home Assistant” via the browser.

I can see the home assistant server in the MacOs app. Trying to connect gives me:

Looking through the log file the app points to I can see…

2022-02-06 11:21:16.982 [Info] [webhookmanager-data] [WebhookManager.swift:549] urlSession(_:task:didCompleteWithError:) > ignoring cancelled task taskKey(session: webhook-io.robbie.HomeAssistant, task: 76)
2022-02-06 11:21:29.260 [Info] [main] [Environment.swift:71] init() > WebSocket: connecting using HAConnectionInfo(url: https://[domain].duckdns.org:8123, userAgent: Optional("Home Assistant/2021.12 (io.robbie.HomeAssistant; build:2021.322; macOS 12.1.0)"), engine: nil)

Not sure what I should be looking for TBO.

If I removed the http: section from configuration.yaml entirely, would I be able to at least connect locally?

you should be able to connect by using the IP if you are on the same LAN.

Yes I should. Only I can’t. I can ping it, just can’t establish a connection.

Or do you mean after I have removed the http: section from configuration.yaml?

Awesome. Just connected via IP the ip address. Didn’t work before, but does now. Not sure why the duckdns isn’t working, but at least I can now connect. Thanks a lot.

I am now getting messages about my certificate being invalid when I try to connect via the ip address or via https://homeassistant.local:8123/ in the MacOS app.

-and-

This is what I am seeing in the DuckDNS add-on log after I’ve restarted the add-on. Seems to be fine…

# INFO: Using main config file /data/workdir/config
Processing [domain].duckdns.org
 + Checking domain name(s) of existing cert... unchanged.
 + Checking expire date of existing cert...
 + Valid till Apr  5 01:06:35 2022 GMT (Longer than 30 days). Skipping renew!

I am seeing this in the home assistant general log…

Logger: aiohttp.server
Source: /usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py:405
First occurred: 12:55:35 (8 occurrences)
Last logged: 13:58:16

Unhandled exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1183, in _sendfile_fallback
    read = await self.run_in_executor(None, file.readinto, view)
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 514, in start
    resp, reset = await task
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 460, in _handle_request
    reset = await self.finish_response(request, resp, start_time)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 613, in finish_response
    await prepare_meth(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_fileresponse.py", line 286, in prepare
    return await self._sendfile(request, fobj, offset, count)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_fileresponse.py", line 99, in _sendfile
    await loop.sendfile(transport, fobj, offset, count)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1162, in sendfile
    return await self._sendfile_fallback(transport, file,
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1192, in _sendfile_fallback
    await proto.restore()
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 263, in restore
    self._transport.resume_reading()
  File "/usr/local/lib/python3.9/asyncio/sslproto.py", line 343, in resume_reading
    self._ssl_protocol._transport.resume_reading()
AttributeError: 'NoneType' object has no attribute 'resume_reading'

I’m at a loss trying to understand what is wrong.

The certificate is mismatched. But you only get that error trying to connect via https. Are you sure your reverse proxy is disabled?

Yeah, just checked the add-on page, NGINX proxy manager is disabled.

My mistake. Use http://yourIP:8123, do you have a http server running, or did you map your https port to 8123?

http://192.168.1.24:8123 gives me

This page isn’t working 192.168.1.24 didn’t send any data.
ERR_EMPTY_RESPONSE

I can only connect via browser via https: (either by ip address or homeassistant.local). When I do I I get a “Not Secure” warning in the address bar of the browser. Clicking on that message tells “your connection is not secure” and the “Certificate is not valid”. When I click on certificate message it brings up another box telling me “This certificate is valid” - the duckdns certificate that is.

I don’t have a http server running. And I haven’t mapped https to 8123 (only the standard port forwards on the router 443 & 8123).

I have de-activated all things DuckDNS commented out the http: section in configuration.yaml. Setting everything back to basic. Connected via http://homeassistant.local:8123/lovelace/home.
Can connect via browser and now the MacOS app.

Still unable to connect via the iOS apps. I deleted and re-installed the iPhone app. The app sees the server on the network and I get…

Failed to Connect
Response status code was unacceptable 403. 
Error Code:
Alarmoffire.AFError 9

403: Forbidden

What am I missing?

I am going to leave this here in case it might help someone. I got my iOS devices to connect to Home Assistant (just local http for now).

I disabled the Apple HomeKit connection within the Eero app. With that disabled, I was able to connect.

I think I will leave remote access for another day.

I’m having connection issues that look suspiciously similar since the update to 2022.2.3.

I’ll find out whether anything in this thread fixes things for me.

1 Like