Home Assistant release (hass --version):
0.64.1 => 0.65.4
Python release (python3 --version):
3.5.x
Component/platform:
aiohttp.server
Description of problem:
[aiohttp.server] Error handling request
Expected:
NO
Traceback (if applicable):
2018-03-13 20:34:04 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 272, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-03-13 20:34:04 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 272, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
Same to me... without update 0.64.3
Same with me
Hassbian: 0.65.4
python3: 3.6.3
aiohttp: 3.0.6
aiohttp-cors: 0.6.0
I hope, someone can help us
Update lastest python to fix. This guild is python version 3.6.0
https://gist.github.com/dschep/24aa61672a2092246eaca2824400d37f
Change with this link
https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
Thanks
It did not worked. still issue on python version 3.6.4 and HA version 0.65.5
2018-03-15 11:14:03 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
I have the same problem...
Home Assistant 0.65.6
Hassio 0.99
2018-03-25 19:58:05 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
Same issues here HASS 0.66.1 to be honest I have seen it for a while now.
Python 3.5.3
Previous research had pushed me towards an Nginx/hass issue and I ended up specifying my URL in the hass configuration but that has not made a difference.
Is anyone else also using Nginx?
I aslo run NGINX, I see this issue with my docker install but not on my VM.
Same issue here with HASS0.72.1 with addons DUCKDNS, DNSMASQ, MQTT, SSH and NGINX.
I forward 80:80 and 443:443 on my router
Using NGINX got rid of this error:
Error doing job: Task was destroyed but it is pending!
But now I have a burst of this topics' error messages about once a day.
Edit on July 14
I no longer see this error. No changes made on my part. Perhaps the Hass.io supervisor has been fixed.
i was fixed this error with upgrade pip3 to newest version, then update HA to newest version. All work ok without error on log.
@keitetran What commands did you use to update pip3? I want to try that as well.
I see pip. Other component on HA need other heigher version, but pip3 version is low. That was not upgraded => some component not working fine.
You need upgrade python then upgrade pip3 => all component up to lastest.
Maybe my step can wrong, but my error was fixed. 😟
Note. Upgrade pip3 with hass user. Not user pi. Im used hassbian.
https://www.raspberrypi.org/forums/viewtopic.php?t=177711
Same issue here:
Home Assistant 0.73.1
Hostname | hassio
-- | --
System | HassOS 1.5
Deployment | production
Error handling request
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
Same issue and error log as @Imperial-Guard;
fully clean and fresh install, nothing setup yet.
System: HassOS 1.7
Hass.io supervisor: 115
Home Assistant: 0.73.2 (also noticed before the upgrade from 0.73.1
Any update here? I know I am still seeing the issue even on the latest.
Did some more digging and found this to be true.
https://community.home-assistant.io/t/error-mainthread-aiohttp-server-error-handling-request/19659/9?u=rabittn
I still had other services (blue iris) pointed directly at the HASS IP address trying to use https.
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 :+1:
Hi!
I still have this issue:
System: Docker
Version: 0.81.6
I only use http, no https.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 242, 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
Hello,
I also still see the issue :
System: Raspbian
Hass version: 0.81.6
python version : 3.5.3
Lovelace ui (if relevant)
Full traceback:
error-handling-request.log
FWIW. I was having this issue getting while I'm still getting everything set up. I was using someone else's docker-compose.yml and just noticed the health check for home assistant hits an https URL. Changing that to HTTP (for now until I get https set up) fixed the issue.
I get this error in 0.84.3
2018-12-17 15:55:52 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start
resp = await self._request_handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 366, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 106, in impl
return await handler(request)
File "/usr/src/app/homeassistant/components/http/static.py", line 66, in staticresource_middleware
return await handler(request)
File "/usr/src/app/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
return await handler(request)
File "/usr/src/app/homeassistant/components/http/ban.py", line 67, in ban_middleware
return await handler(request)
File "/usr/src/app/homeassistant/components/http/auth.py", line 99, in auth_middleware
return await handler(request)
File "/usr/src/app/homeassistant/components/http/view.py", line 118, in handle
result = await result
File "/usr/src/app/homeassistant/components/history.py", line 318, in get
entity_ids, self.filters, include_start_time_state)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/app/homeassistant/components/history.py", line 79, in get_significant_states
include_start_time_state)
File "/usr/src/app/homeassistant/components/history.py", line 225, in states_to_json
for state in get_states(hass, start_time, entity_ids, filters=filters):
File "/usr/src/app/homeassistant/components/history.py", line 136, in get_states
run = recorder.run_information(hass, utc_point_in_time)
File "/usr/src/app/homeassistant/components/recorder/__init__.py", line 97, in run_information
with session_scope(hass=hass) as session:
File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/src/app/homeassistant/components/recorder/util.py", line 18, in session_scope
session = hass.data[DATA_INSTANCE].get_session()
TypeError: 'NoneType' object is not callable
hi all - i fixed this by adding the full address of the site into the http: component under base_url
I believe the error comes is caused in most instances by using https without having this set in the configuration.yaml
http:
base_url: https://hass.example.com
Not using SSL and have full url in config but no longer seeing this issue in current ver 85.0b0
@Bodge-IT What makes you think that error has anything to do with the one this issue is about?
I've already mentioned, this error is fixed for me, so I fail to see how your question furthers anything.
Sent from BlueMail
-------- Original Message --------
From: Dustin Wyatt notifications@github.com
Sent: Tue Jan 22 19:54:53 GMT+00:00 2019
To: home-assistant/home-assistant home-assistant@noreply.github.com
Cc: Gary Barclay badimba@gmail.com, Mention mention@noreply.github.com
Subject: Re: [home-assistant/home-assistant] [aiohttp.server] Error handling request (#13172)
@Bodge-IT What makes you think that error has anything to do with the one this issue is about?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/home-assistant/home-assistant/issues/13172#issuecomment-456539771
@Bodge-IT Because this is not a technical support forum. While it's nice that you no longer have the problem, it is not really relevant here. This is an issue tracker for the developers. If you have other information that indicates that the error you posted is related to the error this issue is about, then it would be helpful to include that information so we can track down the source of this potential bug.
I wasn't asking for technical support. The reason why I thought it was related was because it had the same error message.
@Bodge-IT You have a recorder error.
Try stopping HA, deleting home-assistant_v2.db and starting HA
Otherwise, try the NGNIX add-on as this will bypass the aiohttp server.
If I turn on debug logging for everything I do not get any more information from aiohttp to help diagnose this issue. However, every time I see this in my logs the previous two lines in the log are:
2019-01-25 12:14:26 DEBUG (Thread-5) [sseclient] Dispatching keep-alive event, 4 bytes...
2019-01-25 12:14:26 DEBUG (Thread-5) [nest.nest] <<< keep-alive event
@keitetran I recommend changing the title of this issue to something like "aiohttp.http_exceptions.BadStatusLine: invalid HTTP method" as that is the relevant line from the error.
hitting this error when trying to access https://ip.address:8123
HASSIO with HA 0.86.4 RPi 3.
ssl self-signed certs installed and base_usr points to https://ip.address
I am getting this error in 9.2
19-04-27 01:58:49 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 448, in start
await resp.write_eof()
File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 444, in write_eof
await self._payload_writer.write_eof(data)
File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 138, in write_eof
self._write(chunk)
File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 67, in _write
raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport
what exactly does the aiohttp.server do? Do I need to be concerned?
Still an issue
0.93.1 hassio
Just upgraded to 0.95 and I'm now seeing this error, but did not see (or notice it) previously. Currently shows this error hitting 85 times since my upgrade.
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.7/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
This usually means that if you’re using SSL, someone is connecting to Home Assistant using http://, or the other way around. Check your scripts and Hass.io add-on configurations.
If you're experiencing this issue after enabling SSL/TLS in your configuration.yaml file, and these errors are being generated when you attempt to visit your HA via HTTPS://URL:8123.
I would look at your configuration.yaml and make sure spacing is correct.
3 ticks after http for the SSL data. [space] = Space Bar
http:
[space][space][space]ssl_certificate: file/path
[space][space][space]ssl_key: file/path
[space][space][space]base_url: https://domain.com
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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.