-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera Errors with aiohttp 2.0.5 #6859
Comments
Also get these after I let it keep running. 17-03-30 22:01:10 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
File "/usr/src/app/homeassistant/helpers/aiohttp_client.py", line 79, in async_aiohttp_proxy_web
req = yield from web_coro
File "/usr/local/lib/python3.5/site-packages/aiohttp/client.py", line 616, in __iter__
resp = yield from self._coro
File "/usr/local/lib/python3.5/site-packages/aiohttp/client.py", line 225, in _request
conn = yield from self._connector.connect(req)
File "/usr/local/lib/python3.5/site-packages/aiohttp/connector.py", line 364, in connect
yield from fut
File "uvloop/future.pyx", line 230, in __iter__ (uvloop/loop.c:110600)
File "uvloop/future.pyx", line 432, in uvloop.loop.BaseTask._fast_wakeup (uvloop/loop.c:113980)
File "uvloop/future.pyx", line 96, in uvloop.loop.BaseFuture._result_impl (uvloop/loop.c:108829)
concurrent.futures._base.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 430, in start
yield from resp.write_eof()
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_response.py", line 574, in write_eof
yield from super().write_eof(body)
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_response.py", line 413, in write_eof
yield from self._payload_writer.write_eof(data)
File "/usr/local/lib/python3.5/site-packages/aiohttp/http_writer.py", line 281, in write_eof
yield from self.drain(True)
File "/usr/local/lib/python3.5/site-packages/aiohttp/http_writer.py", line 291, in drain
self._transport.write(b''.join(self._buffer))
File "uvloop/handles/stream.pyx", line 632, in uvloop.loop.UVStream.write (uvloop/loop.c:74612)
File "uvloop/handles/handle.pyx", line 150, in uvloop.loop.UVHandle._ensure_alive (uvloop/loop.c:54917)
RuntimeError: unable to perform operation on <TCPTransport closed=True reading=False 0x2172f58>; the handler is closed
|
Can it be that it takes over 10 seconds to get a reply from your camera? |
Nevermind, it looks like CancelledError are raised when the browser closes mid-request. |
@balloob This isn't constant after #6862 if I don't utilize the hass mjpeg proxy functions. If I have an active proxy client or opening up the camera stream dialog and then close it I can still make a cancellation error happen. 17-03-31 23:09:52 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
File "/usr/src/app/homeassistant/helpers/aiohttp_client.py", line 108, in async_aiohttp_proxy_stream
data = yield from stream.read(buffer_size)
File "/usr/local/lib/python3.5/site-packages/aiohttp/streams.py", line 542, in read
return (yield from super().read(n))
File "/usr/local/lib/python3.5/site-packages/aiohttp/streams.py", line 298, in read
yield from self._wait('read')
File "/usr/local/lib/python3.5/site-packages/aiohttp/streams.py", line 226, in _wait
yield from waiter
File "uvloop/future.pyx", line 230, in __iter__ (uvloop/loop.c:110600)
File "uvloop/future.pyx", line 432, in uvloop.loop.BaseTask._fast_wakeup (uvloop/loop.c:113980)
File "uvloop/future.pyx", line 96, in uvloop.loop.BaseFuture._result_impl (uvloop/loop.c:108829)
concurrent.futures._base.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 430, in start
yield from resp.write_eof()
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_response.py", line 574, in write_eof
yield from super().write_eof(body)
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_response.py", line 413, in write_eof
yield from self._payload_writer.write_eof(data)
File "/usr/local/lib/python3.5/site-packages/aiohttp/http_writer.py", line 281, in write_eof
yield from self.drain(True)
File "/usr/local/lib/python3.5/site-packages/aiohttp/http_writer.py", line 291, in drain
self._transport.write(b''.join(self._buffer))
File "uvloop/handles/stream.pyx", line 632, in uvloop.loop.UVStream.write (uvloop/loop.c:74612)
File "uvloop/handles/handle.pyx", line 150, in uvloop.loop.UVHandle._ensure_alive (uvloop/loop.c:54917)
RuntimeError: unable to perform operation on <TCPTransport closed=True reading=False 0x9e4058>; the handler is closed |
Are you 100% sure that you are running the latest version? Because line 108 (start of traceback) is within a try…catch block and we catch the exception CancelledError on line 120 |
Yes, 100% sure. Just pulled the latest docker dev build again to double check. Note that the initial errors were coming from aiohttp/connector.py and these are ending at aiohttp/streams.py |
@balloob Can I give you any more info to help figure this out? Just switched back to the latest dev docker image to double check and still getting the error posted above. It's easily replicated by having a mjpeg camera defined and then have an external application access that cameras proxied mjpeg stream through hass. |
I am able to reproduce this issue but only if I use uvloop. Using the normal loop gives no issues. |
@mezz64 this doesn't seem to be related to Home Assistant. I have raised an issue with aiohttp aio-libs/aiohttp#1790 |
Make sure you are running the latest version of Home Assistant before reporting an issue.
You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:
Home Assistant release (
hass --version
):Latest dev
Python release (
python3 --version
):3.5
Component/platform:
Camera - Generic & Mjpeg
Description of problem:
Aiohttp error is thrown repeatedly and cameras no longer appear in hass.
Expected:
Cameras work as before.
Problem-relevant
configuration.yaml
entries and steps to reproduce:Configure a generic of mjpeg camera, wait about 10mins. Things work fine at first.
Traceback (if applicable):
Additional info:
The text was updated successfully, but these errors were encountered: