Getting "aiohttp.http_exceptions.BadStatusLine: 400" log entry every second

I’m getting the following entry repeatedly every seconds in “Home Assistant Core”. I don’t know what is causing it. There are no other logs in “Home Assistant Core”. Log entries for Supervisor and other categories seem to be normal.

I have 11 Xiaomi zigbee sensors, using ZHA and Nortek HUSBZB-1 usb-stick. They are all working fine. I have one automation that is also working correctly.

Could you please help me figure out what is causing these logs!

The log entries:

Log Details (ERROR)
Logger: aiohttp.server
Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:405
First occurred: 13:42:39 (2 occurrences)
Last logged: 13:42:39

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"

Here is the system info:

|Version|core-2022.7.6|
| --- | --- |
|Installation Type|Home Assistant OS|
|Development|false|
|Supervisor|true|
|Docker|true|
|User|root|
|Virtual Environment|false|
|Python Version|3.10.5|
|Operating System Family|Linux|
|Operating System Version|5.15.32-v8|
|CPU Architecture|aarch64|
|Timezone|Atlantic/Reykjavik|
|Configuration Directory|/config|

### Home Assistant Cloud

[MANAGE](http://192.168.1.35:8123/config/cloud)

|Logged In|false|
| --- | --- |
|Reach Certificate Server|ok|
|Reach Authentication Server|ok|
|Reach Home Assistant Cloud|ok|

### Home Assistant Supervisor

|Host Operating System|Home Assistant OS 8.4|
| --- | --- |
|Update Channel|stable|
|Supervisor Version|supervisor-2022.07.0|
|Agent Version|1.2.1|
|Docker Version|20.10.14|
|Disk Total|232.2 GB|
|Disk Used|10.0 GB|
|Healthy|true|
|Supported|true|
|Board|rpi4-64|
|Supervisor API|ok|
|Version API|ok|
|Installed Add-ons|Duck DNS (1.15.0), File editor (5.3.3), NGINX Home Assistant SSL proxy (3.1.5), Terminal & SSH (9.6.0), Z-Wave JS (0.1.65)|

### Dashboards

[MANAGE](http://192.168.1.35:8123/config/lovelace)

|Dashboards|1|
| --- | --- |
|Resources|0|
|Views|2|
|Mode|storage|

### Recorder

|Oldest Run Start Time|25 July 2022 at 20:55|
| --- | --- |
|Current Run Start Time|1 August 2022 at 13:55|
|Estimated Database Size (MiB)|13.91 MiB|
|Database Engine|sqlite|
|Database Version|3.38.5|

SOLVED
I figured out that these log-entries were for incoming http-requests (I would like to suggest this logging distinguish between incoming and outgoing traffic). By eliminating other possibilites (port-forwarding on the router, all phones, etc), I found out that this was coming from my Ubuntu dev-machine. Turns out that I had https-page open for the internal ip-address (that only accepts http) and somehow it was continously trying to connect.

Hello everyone!!!

I have been running my installation for a while now but am getting strange errors in my logs.
I am using DUCK dns for an SSL connection. NGINX Home Assistant SSL proxy I use to get an https connection from outside.

I do port forwarding via port 443 external to port 443 internal to my ip address running home assistant.

These are my http parameters.
http:
ip_ban_enabled: true
login_attempts_threshold: 3
use_x_forwarded_for: true
trusted_proxies:

  • 172.30.33.0/24

My internal and external url are set under settings – system – network
internal http://192.168.1.X:8123
external https:///xxx.duckdns.org

Everything works perfectly both internal and external. The only thing I see are many of the following errors when I connect back through my internal url.

Logger: aiohttp.server
Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:403
First occurred: 09:22:52 (44 occurrences)
Last logged: 09:22:57

Error handling request

Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py”, line 332, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File “aiohttp/_http_parser.pyx”, line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message=“Bad status line ‘Invalid method encountered’”

What could this be? Please help me out.

Thank you!!!

I have the same problem like you.
Can any kindly soul help us, please?
This is my error:
"Logger: aiohttp.server
Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:403
First occurred: 14:37:07 (31 occurrences)
Last logged: 14:42:04

Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py”, line 332, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File “aiohttp/_http_parser.pyx”, line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message=“Bad status line ‘Invalid method encountered’”"

System info:

System Information

version core-2023.3.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.10
os_name Linux
os_version 5.15.84-v8
arch aarch64
timezone Atlantic/Canary
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4839
Installed Version 1.31.0
Stage running
Available Repositories 1317
Downloaded Repositories 25
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 9.5
update_channel stable
supervisor_version supervisor-2023.03.1
agent_version 1.4.1
docker_version 20.10.22
disk_total 109.3 GB
disk_used 21.1 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons File editor (5.5.0), MariaDB (2.5.2), phpMyAdmin (0.8.4), Duck DNS (1.15.0), Frigate Beta (0.12.0) (0.12.0-beta10), Mosquitto broker (6.1.3), AdGuard Home (4.8.3), NGINX Home Assistant SSL proxy (3.2.0), Terminal & SSH (9.6.1), Samba share (10.0.0), WireGuard (0.7.1), Transmission (4.0.2-r2-ls161), VLC (0.1.3)
Dashboards
dashboards 3
resources 18
views 5
mode storage
Recorder
oldest_recorder_run 9 de marzo de 2023, 14:36
current_recorder_run 19 de marzo de 2023, 14:36
estimated_db_size 366.23 MiB
database_engine mysql
database_version 10.6.10
1 Like