Log Error 400, message="Bad status line 'invalid HTTP method'"

Hello,

I am running the latest Home Assistant installation in a VM using Unraid. I have a SWAG/letsencrypt docker that controls my SSL certificates and an ESPHome Docker that Home Assisstant is connected to.

I have been getting the following error spamming in my log:

Logger: aiohttp.server
Source: /usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py:393

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 314, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 546, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'invalid HTTP method'"

I was told on discord that this is because I am accessing the Homeassistant website through http. I don’t understand how this is a problem - if the internet goes out and I am at home, I can access the website locally through http://homeassistant.local:8123 or 192.168.1.###:8123. I looked through these forums and I can’t find anything that would help my case.

So in the UI settings I have an External URL set up and an internal one. My IP is static. In my configuration.yaml I have:

homeassistant:
  customize: !include customize.yaml
  allowlist_external_dirs:
    - /config/www
  allowlist_external_urls:
    - "http://192.168.1.UNRAIDIP"

What do I need to do to fix this issue? First off my SSL certificates seem to be working, as I am able to access my hass through an https:// address. Nothing seems to be broken in my installation and yet I am getting these errors?

Any insight would be tremendously appreciated.

2 Likes

This is still an issue with 2021.11.

I understand that this must be my own configuration problem, but I don’t see a way to fix this.

Alright - solved my issue reading through the github issues page!

This was the answer for me - changing the IP address. Must have had an old program somewhere pinging away at home assistant and I couldn’t find it. Changing the IP address fixed this issue for me. For those who don’t want to do that, check programs associated with HASS outside of HASS itself. Good luck!

1 Like