home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.71k stars 30.45k forks source link

Unhandled exception aiohttp.server #83631

Closed vlad36N closed 1 year ago

vlad36N commented 1 year ago

The problem

Logger: aiohttp.server Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:403 First occurred: 05:05:45 (5 occurrences) Last logged: 05:05:49 Unhandled exception

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 512, in start resp, reset = await task File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 458, in _handle_request reset = await self.finish_response(request, resp, start_time) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 611, in finish_response await prepare_meth(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_fileresponse.py", line 286, in prepare return await self._sendfile(request, fobj, offset, count) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_fileresponse.py", line 96, in _sendfile assert transport is not None AssertionError

What version of Home Assistant Core has the issue?

Home Assistant 2022.12.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

none

Link to integration documentation on our website

No response

Diagnostics information

Logger: aiohttp.server Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:403 First occurred: 05:05:45 (5 occurrences) Last logged: 05:05:49 Unhandled exception

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 512, in start resp, reset = await task File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 458, in _handle_request reset = await self.finish_response(request, resp, start_time) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 611, in finish_response await prepare_meth(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_fileresponse.py", line 286, in prepare return await self._sendfile(request, fobj, offset, count) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_fileresponse.py", line 96, in _sendfile assert transport is not None AssertionError

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

vlad36N commented 1 year ago

Additional information related to onvif cameras and aiohttp.server errors:

Logger: aiohttp.server Source: helpers/aiohttp_client.py:193 First occurred: 07:01:46 (1 occurrences) Last logged: 07:01:46

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 724, in get return await self.handle(request, camera) File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 764, in handle stream = await camera.handle_async_mjpeg_stream(request) File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 184, in handle_async_mjpeg_stream return await async_aiohttp_proxy_stream( File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 193, in async_aiohttp_proxy_stream await response.write(data) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_response.py", line 514, in write await self._payload_writer.write(data) File "/usr/local/lib/python3.10/site-packages/aiohttp/http_writer.py", line 120, in write await self.drain() File "/usr/local/lib/python3.10/site-packages/aiohttp/http_writer.py", line 173, in drain await self._protocol._drain_helper() File "/usr/local/lib/python3.10/site-packages/aiohttp/base_protocol.py", line 87, in _drain_helper await asyncio.shield(waiter) File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 941, in _write_ready n = self._sock.send(self._buffer) BrokenPipeError: [Errno 32] Broken pipe

issue-triage-workflows[bot] commented 1 year ago

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.

amzaldua commented 1 year ago

Same problem here:

Logger: aiohttp.server Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:403 First occurred: 23:09:07 (437 occurrences) Last logged: 23:24:20

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