core icon indicating copy to clipboard operation
core copied to clipboard

generic error: Error handling request

Open liquidand opened this issue 1 year ago • 28 comments

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

liquidand avatar Jun 16 '23 08:06 liquidand

Hello,

Same error on my HA (2023.6.2).

mcpfr avatar Jun 22 '23 05:06 mcpfr

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.

austinmroczek avatar Jul 01 '23 17:07 austinmroczek

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'

jd3073 avatar Jul 03 '23 13:07 jd3073

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 ^"

sklosinski avatar Aug 01 '23 18:08 sklosinski

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'' ^

jocamane avatar Aug 01 '23 19:08 jocamane

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 ^"

Desef avatar Aug 04 '23 12:08 Desef

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 ^"

l3zha avatar Aug 31 '23 04:08 l3zha

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?

larss avatar Sep 15 '23 16:09 larss

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

austinmroczek avatar Sep 15 '23 23:09 austinmroczek

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?

larss avatar Sep 16 '23 19:09 larss

2023.9 possibly fixed it but I wasn't watching close enough to be sure

austinmroczek avatar Sep 16 '23 21:09 austinmroczek

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)

home-assistant[bot] avatar Oct 23 '23 17:10 home-assistant[bot]

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)

clinds34 avatar Oct 30 '23 12:10 clinds34

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.

vumaddibly avatar Oct 30 '23 14:10 vumaddibly

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 ^"

adidash avatar Nov 11 '23 19:11 adidash

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

lesgrebe avatar Nov 13 '23 10:11 lesgrebe

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 avatar Nov 13 '23 10:11 larss

@larss , no. It's just a tipical installation. I tried to install for an old backup and update and noW all is ok....

adidash avatar Nov 13 '23 10:11 adidash

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''
  ^

Idealistik avatar Nov 28 '23 11:11 Idealistik

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''
  ^

maxhome75 avatar Dec 28 '23 09:12 maxhome75

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

Misiek1105 avatar Jan 03 '24 18:01 Misiek1105

Yes error every 30/40 secondes

maxhome75 avatar Jan 03 '24 19:01 maxhome75

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.

Misiek1105 avatar Jan 03 '24 21:01 Misiek1105

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.

rvalitov avatar Jan 04 '24 12:01 rvalitov

I use VPN to conection with HA outside. I use only http. Only hikvision integration use http also.

Misiek1105 avatar Jan 04 '24 13:01 Misiek1105

I change IP HA and switch off all integratrion and add-on. Still the same

Misiek1105 avatar Jan 06 '24 21:01 Misiek1105

Invalid method encountered is almost always a misconfigured reverse-proxy that is trying to talk HTTPS to an HTTP server.

codyc1515 avatar Feb 09 '24 10:02 codyc1515

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.

Misiek1105 avatar May 19 '24 07:05 Misiek1105

?

jocamane avatar May 20 '24 16:05 jocamane