Hi, my Onvif integration has stopped working since the latest (Hassio Core-2024.12.0) update.
I’m getting the following error in the logs…
Logger: homeassistant.setup
Source: setup.py:334
First occurred: 5 December 2024 at 23:18:47 (2 occurrences)
Last logged: 5 December 2024 at 23:18:55
Setup failed for 'onvif': Unable to import component: No module named 'cgi'
Setup failed for custom integration 'nationalrailuk': Unable to import component: No module named 'cgi'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
component = await integration.async_get_component()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1034, in async_get_component
self._component_future.result()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1014, in async_get_component
comp = await self.hass.async_add_import_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._get_component, True
^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/loader.py", line 1074, in _get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/usr/src/homeassistant/homeassistant/components/onvif/__init__.py", line 9, in <module>
from onvif.exceptions import ONVIFError
File "/usr/local/lib/python3.13/site-packages/onvif/__init__.py", line 2, in <module>
import zeep
File "/usr/local/lib/python3.13/site-packages/zeep/__init__.py", line 1, in <module>
from zeep.client import AsyncClient, CachingClient, Client
File "/usr/local/lib/python3.13/site-packages/zeep/client.py", line 6, in <module>
from zeep.transports import AsyncTransport, Transport
File "/usr/local/lib/python3.13/site-packages/zeep/transports.py", line 11, in <module>
from zeep.utils import get_media_type, get_version
File "/usr/local/lib/python3.13/site-packages/zeep/utils.py", line 1, in <module>
import cgi
ModuleNotFoundError: No module named 'cgi'
The crux of the issue appears to be ModuleNotFoundError: No module named 'cgi'
.