core
core copied to clipboard
generic error: Error handling request
The problem
Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403 First occurred: 15 giugno 2023 alle ore 10:44:35 (2 occurrences) Last logged: 15 giugno 2023 alle ore 12:10:04
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 version of Home Assistant Core has the issue?
core-2023.6.1
What was the last working version of Home Assistant Core?
core-2023.6.1
What type of installation are you running?
Home Assistant Container
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Hello,
Same error on my HA (2023.6.2).
Seeing the same with a brand new setup:
Home Assistant 2023.6.3 Supervisor 2023.06.4 Operating System 10.3
Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403
First occurred: 9:47:07 AM (30901 occurrences)
Last logged: 10:24:25 AM
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/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'"
Already 30,000+ log entries and the system has only been up and running for an hour or so.
Seeing same on my 2023.6.3 as well: Traceback (most recent call last): File "/usr/local/lib/python3.11/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.BadHttpMessage: 400, message='Pause on PRI/Upgrade'
I'm having the same issue with mine as well: Home Assistant 2023.7.3 Supervisor 2023.07.1 Operating System 10.3 Frontend 20230705.1 - latest
2023-08-01 14:30:54.932 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\x16\x03\x01\x02'\n ^"
Same here!!!
Home Assistant 2023.7.3 Supervisor 2023.07.1 Operating System 10.3 Frontend 20230705.1 - latest
2023-08-01 19:05:58.478 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b' A@BAE@FAI '\n ^"
AND
2023-08-01 17:02:52.624 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadHttpMessage: 400, message: Pause on PRI/Upgrade: b'' ^
Has there been any progress on this issue? the log file on my system is also showing a similar message since last night:
Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403 First occurred: 3 August 2023 at 21:04:50 (12524 occurrences) Last logged: 14:25:09
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\x16\x03\x01\x01\x08\x01'\n ^"
Same error on my HA (2023.08.1).
ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\\x03'\n ^"
Just my two cents: I struggled with this issue until I dropped my goal of having HA externally listening with https to a different port than 443 (of course, explicitly expressing the port in the URI). I tried many configurations to no avail, with the exact same error of the OP. Then I routed back the traffic to the classic "443 to the internal port" scheme (changing the related configuration.yaml portion) and everything went back to place. Are you trying with a non-standard port?
I wasn't watching close enough, but somewhere between June and now this has gone away for me.
Now using: Home Assistant 2023.9.1 Supervisor 2023.09.2 Operating System 10.5
My setup sounds similar to larss but I haven't changed anything:
Browser / companion app --> https : // ha.mydomain.com:443 [Apache proxy] --> https : // myrouter.duckdns.org:443 [OpenWRT port forward] --> https : // homeassistant.local:8123
Right, I forgot to jot down my details: Home Assistant Core: 2023.8.4 Do you reckon you resolved with the september update or could have it gone away before?
2023.9 possibly fixed it but I wasn't watching close enough to be sure
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (http
) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of http
can trigger bot actions by commenting:
-
@home-assistant close
Closes the issue. -
@home-assistant rename Awesome new title
Renames the issue. -
@home-assistant reopen
Reopen the issue. -
@home-assistant unassign http
Removes the current integration label and assignees on the issue, add the integration domain after the command.
(message by CodeOwnersMention)
http documentation http source (message by IssueLinks)
Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403 First occurred: October 29, 2023 at 3:25:06 PM (33659 occurrences) Last logged: 8:21:04 AM
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\x16\x03\x01\x03d\x01'\n ^"
Core 2023.11.0b2 Supervisor 2023.10.1 Operating System 11.1 Frontend 20231027.0
I recently added NGINX Home Assistant SSL proxy (had already been using Duck DNS)
I'm running HAOS on bare metal: Supervisor 2023.10.1 Operating System 11.1 Frontend 20231005.0
I see the following message in the logs every 15 seconds or so
2023-10-30 11:19:02.107 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\\x16\\x03\\x01\\x02'\n ^"
I don't look at the logs too often, so I've no idea when it first started.
Hi, I've got the same problem on HA OS intalled in a proxmox VM:
- Home Assistant Core: Version : 2023.11.2
- Home Assistant OS: Version : 11.
- Home Assistant Supervisor Version : 2023.11.01
Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403 First occurred: 19:52:03 (126 occurrences) Last logged: 20:47:30
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\x16\x03\x01\x02'\n ^"
Hi, same on my environment -> HA OS installed on RASPI 4 8GB:
- Core: 2023.11.2
- Supervisor: 2023.11.0
- Operating System: 11.1
- Frontend: 20231030.2
Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403 First occurred: 11:02:07 (2 occurrences) Last logged: 11:14:04
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Bad status line "Invalid method encountered:\n\n b'\x03'\n ^"
Regards Michi
Are you - meaning, @adidash and/or @lesgrebe - trying to forward an external port that's not standard or are you going with the classic 443<-->443 setup?
@larss , no. It's just a tipical installation. I tried to install for an old backup and update and noW all is ok....
Hi, almost the same:
HA OS installed on RASPI 4 8GB:
Core 2023.11.3 Supervisor 2023.11.3 Operating System 11.1 Frontend 20231030.2
Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403 First occurred: 9:35:12 AM (1 occurrences) Last logged: 9:35:12 AM
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/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 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadHttpMessage: 400, message: Pause on PRI/Upgrade:
b''
^
Idem Raspi 4 and 8gb Version 2023.12.3
Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421 First occurred: 27 décembre 2023 à 10:11:12 (1 occurrences) Last logged: 27 décembre 2023 à 10:11:12
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 350, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadHttpMessage: 400, message: Pause on PRI/Upgrade:
b''
^
Hello,
I also have the same problem in the log. I dont't open and change port. I use zerotier to conection with HA from outside
Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421 First occurred: 18:34:43 (134 occurrences) Last logged: 19:40:20
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 350, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message: Invalid method encountered:
b'\x10k'
^
I have this error every 30s
Yes error every 30/40 secondes
I tried wrote basic URL in configuration.yaml, but nothing result. I tried Find where device make this error. But I don,t have more idea for this.
I had this kind of error when I tried to configure external access to HA via Cloudflare tunnel. The problem happened when I misconfigured protocol - the HA was working in HTTP mode, and Cloudflare tried to access it in HTTPS mode. The solution was to have both HA and Cloudflare tunnel work together either in HTTP or in HTTPS mode only. Perhaps, you have a different environment, but may be the same HTTP/HTTPS misconfiguration issue causing this error.
I use VPN to conection with HA outside. I use only http. Only hikvision integration use http also.
I change IP HA and switch off all integratrion and add-on. Still the same
Invalid method encountered
is almost always a misconfigured reverse-proxy that is trying to talk HTTPS to an HTTP server.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Sory for the long time waiting. It is a problem with shelly devices. After update firmware shelly change port to update. When I changed maually port in shelly devices problem was resolved.
?