[aiohttp.server]: Error handling request Traceback

I am getting constant errors in my log file. Running v0.117.6.
The only thing I have changed recently is removed my ssl certs as it was causing an issue with my Plex integration.

2020-11-12 22:45:52 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 275, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

Anyone know how I can fix this?

1 Like

I am having several errors like yours, maybe some day could give us a light about how to solve it…

2021-01-02 19:18:10 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 57, in _handle
    return await self._handle_request(request, token, path)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 121, in _handle_request
    source_header = _init_header(request, token)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 189, in _init_header
    connected_ip = ip_address(request.transport.get_extra_info("peername")[0])
TypeError: 'NoneType' object is not subscriptable

I am on a Raspberry Pi 4B with 2020.12.2 HA version, the only thing that I have change recently I have remove deConz integration and deConz add-on, because I am using my conbee II with zigbee2mqtt not with deConz.

1 Like

I’ve got massive amounts of this error message. Anybody knows whats the reason? Could this be related to a lovelace.yaml error?

Logger: aiohttp.server
Source: /usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py:393
First occurred: 22:44:45 (31 occurrences)
Last logged: 23:15:13

Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.9/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 also have a similar problem. No idea how to fix it.

Logger: aiohttp.server
Source: /usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py:393
First occurred: November 5, 2021, 8:15:26 PM (66369 occurrences)
Last logged: 3:36:11 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/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 had similar problem with HA. The same error log like RolandFran. Since yesterday was not possible connect with Android on Chrome or Samsung explorer. But on PC without problems. Today I connected to HA on Android with Firefox without problems. The problem is probably with HTTP protocol on Android -some changes in new distribution?

I have the same problem on my HA on Rasp 4 with Version core-2021.11.5

2021-12-08 20:33:00 ERROR (MainThread) [aiohttp.server] Error handling request

Traceback (most recent call last):

File "/usr/local/lib/python3.9/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 '"

How can i fix this problem?