Multiple python errors in docker install

First post, of course it’s a problem…

I installed hass.io on a Raspberry Pi 4 and it worked fine, including rtsp, and Google integrations. I’m about to add a bunch more cameras to the config so I decided to move the platform to a dedicated Ubuntu machine running docker for full Home Assistant support. I tried a clean install with the configuration from my Pi and I got loads of python errors with my rtsp camera, it’s a Wyze Cam.

When that didn’t work I decided to go to a minimal install, no Google stuff, just vanilla Home Assistant with File Editor and Samba. This is a bare metal install, I wiped the drive installed fresh Ubuntu, docker, and Home Assistant with supervisor. I get the same python issues. I don’t know if there’s a simple solution but I’m all ears.

Here’s a section of my error log:

2021-02-21 10:48:19 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/security_filter.py”, line 56, in security_filter_middleware

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/camera/init.py”, line 502, in get

return await self.handle(request, camera)

File “/usr/src/homeassistant/homeassistant/components/camera/init.py”, line 519, in handle

image = await camera.async_camera_image()

File “/usr/src/homeassistant/homeassistant/components/generic/camera.py”, line 156, in async_camera_image

response = await websession.get(url, auth=self._auth)

File “/usr/local/lib/python3.8/site-packages/aiohttp/client.py”, line 520, in _request

conn = await self._connector.connect(

File “/usr/local/lib/python3.8/site-packages/aiohttp/connector.py”, line 535, in connect

proto = await self._create_connection(req, traces, timeout)

File “/usr/local/lib/python3.8/site-packages/aiohttp/connector.py”, line 892, in _create_connection

_, proto = await self._create_direct_connection(req, traces, timeout)

File “/usr/local/lib/python3.8/site-packages/aiohttp/connector.py”, line 991, in _create_direct_connection

assert port is not None

AssertionError

Before you get too far, do you realise Ubuntu isn’t supported anymore.
Start again with Debian buster. Then follow the guide by kanga-who

You know, it had to be something stupid. I’ll wipe the install now and report back.

I installed it following the guide, line by line… same errors.

I assume it’s something wrong with the python install in the docker, but I’m at a loss as to how to fix it.

Very strange. @kanga_who keeps the guide up to date. Maybe others have had a similar issue. At what point are these errors thrown? Are you on ethernet?

I clear the log, restart Home Assistant, go to the overview and there they come. My configuration has one rtsp camera in it, that’s it. Using the KISS method to troubleshoot the problem. I’m still running the rest on my Pi.

Here’s more information about my install, it’s a 6-core Ryzen 1600AF, 16GB RAM, 500GB SSD:

Host Details
Hostname first
OS Information linux x86_64 Debian GNU/Linux 10 (buster)
Kernel Version 4.19.0-14-amd64
Total CPU 12
Total memory 16.8 GB
Engine Details
Version 20.10.3 (API: 1.41)
Root directory /var/lib/docker
Storage Driver overlay2
Logging Driver journald
Volume Plugins local
Network Plugins bridge, host, ipvlan, macvlan, null, overlay

Okay, more testing.

The errors start when I go to the “Overview” window.
They stop when I go to a different view, i.e. Map
If I remove the Picture Entity Card the errors stop
They start again when I recreate the Picture Entity Card
It obviously has something to do with my rtsp stream

I got it working!

I could NOT get it working using the standard install guide. I tried it on multiple PCs. Here’s what I did:

I wiped everything clean again, SSD fast PC, no big deal. I manually installed the homeassistant/qemux86-64-homeassistant docker repo, with nothing else… It worked fine, no errors, no supervisor either.

I then used the official installation script. It wiped my homeassistant docker container… The errors came back! Grrr.

I went into portainer and manually installed the homeassistant/qemux86-64-homeassistant repo over the one that supervisor installed, it should have been the same, but no errors! Then the supervisor wiped the container and reinstalled it… no errors!

I restored my config from my pi on it, no errors.

Why did this work? It’s a Festivus miracle! Who knows, it works. I have my Nest doorbell cameras on the same screen as my rtsp camera. Now I can move forward.

Put this one in Agent Mulder’s files.