Okay, never ending story: The reason for the unreachable web interface is unrelated to ha-av
, but a different error, which indeed appears with Python 3.11(.4) only, not with Python 3.10.12:
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: 2023-06-18 18:52:10.341 ERROR (MainThread) [aiohttp.server] Error handling request
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: Traceback (most recent call last):
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/home/homeassistant/.pyenv/versions/3.11.4/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: resp = await request_handler(request)
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/home/homeassistant/.pyenv/versions/3.11.4/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: resp = await handler(request)
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: ^^^^^^^^^^^^^^^^^^^^^^
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/home/homeassistant/.pyenv/versions/3.11.4/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: return await handler(request)
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: ^^^^^^^^^^^^^^^^^^^^^^
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/home/homeassistant/.pyenv/versions/3.11.4/lib/python3.11/site-packages/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: return await handler(request)
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: ^^^^^^^^^^^^^^^^^^^^^^
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/home/homeassistant/.pyenv/versions/3.11.4/lib/python3.11/site-packages/homeassistant/components/http/forwarded.py", line 82, in forwarded_middleware
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from hass_nabucasa import ( # pylint: disable=import-outside-toplevel
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/hass_nabucasa/__init__.py", line 15, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from .auth import CloudError, CognitoAuth
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/hass_nabucasa/auth.py", line 11, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: import boto3
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/boto3/__init__.py", line 17, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from boto3.session import Session
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/boto3/session.py", line 17, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: import botocore.session
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/session.py", line 26, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: import botocore.client
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/client.py", line 15, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from botocore import waiter, xform_name
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/waiter.py", line 18, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from botocore.docs.docstring import WaiterDocstring
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/docs/__init__.py", line 15, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from botocore.docs.service import ServiceDocumenter
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/docs/service.py", line 14, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from botocore.docs.client import ClientDocumenter, ClientExceptionsDocumenter
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/docs/client.py", line 17, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from botocore.docs.example import ResponseExampleDocumenter
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/docs/example.py", line 13, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from botocore.docs.shape import ShapeDocumenter
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/docs/shape.py", line 19, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from botocore.utils import is_json_value_header
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/utils.py", line 37, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: import botocore.httpsession
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/botocore/httpsession.py", line 45, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: from urllib3.contrib.pyopenssl import (
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/urllib3/contrib/pyopenssl.py", line 97, in <module>
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: util.PROTOCOL_TLS: OpenSSL.SSL.SSLv23_METHOD,
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: ^^^^^^^^^^^^^^^^^
Jun 18 18:52:10 NanoPiM1 Home Assistant[19381]: AttributeError: module 'urllib3.util' has no attribute 'PROTOCOL_TLS'
Pretty strange is that this constant should exist until urllib3 v2.0.0, while HA/botocore pulls v1.26.x: Fix ssl deprecation warnings in Python 3.10 · urllib3/urllib3@2ec06d1 · GitHub
I couldn’t figure out whether the deprecation warning in Python 3.10, which lead to the urllib3 change, means an actual API removal in Python 3.11, so that urllib3 v1.26.x is simply not compatible with Python 3.11. But in this case, HA would be not compatible with Python 3.11 and the same error should appear on all architectures and distro versions. Confusing …
EDIT: Indeed same problem on x86. Testing on Debian Bookworm …
EDIT2: Same error on Bookworm. Manually upgrading urllib3
to latest version solves the issue and makes the web UI accessible as well on NanoPi M1. But on the paper it introduces a dependency conflict with botocore
.
EDIT3: Same issue with Python 3.11.3. I wonder how this ever worked for anyone? Is it probably due to a very recent dependency chance of one of HA’s dependency, so that a somehow indirectly related module has now an incompatible version without any change on HA?
Not sure how to deal with it: With Python 3.10 the big warning appears, with Python 3.11 the web UI fails completely, all on every architecture and all Debian versions. Giving up for today and see whether bug reports pop up at HA until tomorrow, else will do one myself.