anybody else have this problem after upgrading to HA 2024.6 ?
Logger: homeassistant.config
Source: config.py:1440
First occurred: 11 June 2024 at 22:40:04 (1 occurrences)
Last logged: 11 June 2024 at 22:40:04
Platform error: media_player - cannot import name 'SerialException' from 'serial' (/usr/local/lib/python3.12/site-packages/serial/__init__.py)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 1440, in _async_load_and_validate_platform_integration
platform = await p_integration.integration.async_get_platform(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1085, in async_get_platform
platforms = await self.async_get_platforms((platform_name,))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1162, in async_get_platforms
import_future.result()
File "/usr/src/homeassistant/homeassistant/loader.py", line 1150, in async_get_platforms
platforms.update(self._load_platforms(platform_names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, in _load_platforms
platform_name: self._load_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in _load_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in protected_loop_func
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, 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 995, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/config/custom_components/xantech/media_player.py", line 8, in <module>
from serial import SerialException
ImportError: cannot import name 'SerialException' from 'serial' (/usr/local/lib/python3.12/site-packages/serial/__init__.py)
what I see that the serial package is really missing:
PyYAML-6.0.1.dist-info packaging pyparsing
PyYAML.libs packaging-24.0.dist-info pyparsing-3.1.2.dist-info
README.txt pathspec setuptools
_distutils_hack pathspec-0.12.1.dist-info setuptools-69.5.1-py3.12.egg-info
_yaml pip yaml
awake pip-24.0-py3.12.egg-info yamllint
awake-1.0-py3.12.egg-info pkg_resources yamllint-1.35.1.dist-info
distutils-precedence.pth pulsemixer-1.5.1.dist-info
➜ site-packages pip uninstall serial
WARNING: Skipping serial as it is not installed.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
➜ site-packages pip uninstall pyserial
WARNING: Skipping pyserial as it is not installed.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
➜ site-packages pip install pySerial
Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting pySerial
Downloading https://wheels.home-assistant.io/musllinux-index/pyserial-3.5-py2.py3-none-any.whl.metadata (1.6 kB)
Downloading https://wheels.home-assistant.io/musllinux-index/pyserial-3.5-py2.py3-none-any.whl (90 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.6/90.6 kB 3.9 MB/s eta 0:00:00
Installing collected packages: pySerial
Successfully installed pySerial-3.5
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
➜ site-packages ls
PyYAML-6.0.1.dist-info packaging-24.0.dist-info pyserial-3.5.dist-info
PyYAML.libs pathspec serial
README.txt pathspec-0.12.1.dist-info setuptools
_distutils_hack pip setuptools-69.5.1-py3.12.egg-info
_yaml pip-24.0-py3.12.egg-info yaml
awake pkg_resources yamllint
awake-1.0-py3.12.egg-info pulsemixer-1.5.1.dist-info yamllint-1.35.1.dist-info
distutils-precedence.pth pyparsing
packaging pyparsing-3.1.2.dist-info
➜ site-packages cd serial
➜ serial ls
__init__.py __pycache__ rs485.py serialjava.py serialutil.py threaded urlhandler
__main__.py rfc2217.py serialcli.py serialposix.py serialwin32.py tools win32.py
I tried reinstalling serial - it shows up but disappears after reboot…
After it is reinstalled, when I go to Developer Tools it still complains about missing “serial” and init.py
Configuration warnings
Platform error 'media_player' from integration 'xantech' - cannot import name 'SerialException' from 'serial' (/usr/local/lib/python3.12/site-packages/serial/__init__.py)
Anyone has an idea what happened?
For a while yesterday I had 2 USB SERIAL connected - one for DAYTON and one for Cambridge Audio CXA61. I have also installed CXA61 integration and forwarded another USB_to_serial (CXA61) to my VM running HA (on QNAP NAS).
After starting it the CXA61 integration did work but generated lags and only switching on was forwarded to CXA and it didn;t really react much.
After a restart or two both integrations broke and I started seeing the missing serial error.
I removed second serial (CXA61), made sure first serial is discovered as ttyUSB0 configured in xantech integration, restarted HA several times.
I even disconnected both serial and removed both integrations from config and made several restarts with no serials attached - no go.
I also rebooted QNAP host and also (software removed second serial (CXA61) passthrough and rebooted again with no serials attached,
Then rebooted with only xantech aserial attached.
no go.
no more ideas where to try…
Can anyobe help me solving this issue please?
Maybe this also has something to do with my problem?
I started seeing this in logs recently:
Logger: homeassistant.util.loop
Source: util/loop.py:84
First occurred: 04:57:11 (2 occurrences)
Last logged: 05:00:46
Detected blocking call to import_module inside the event loop by integration 'config' at homeassistant/components/config/core.py, line 38: res = await check_config.async_check_ha_config_file(request.app[KEY_HASS]) (offender: /usr/src/homeassistant/homeassistant/loader.py, line 1281: return importlib.import_module(f"{self.pkg_path}.{platform_name}")), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+config%22 Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/core.py", line 38, in post res = await check_config.async_check_ha_config_file(request.app[KEY_HASS])
Of course I introduced more problems by upgrading HA to 2024.6.2 when playing with integrations - now I have no clue what might have caused this issue…
EDIT:
I can confirm that reverting back from CORE 2024.6.2 to CORE 2024.6.1 brings back the integration and it is working fine.
So I can confirm, that at least in my situation it is latest CORE update 2024.6.2 that was to blame. Heads up.
EDIT2:
So it was not the HA CORE 2024.6.2 fault.
Looks like adding second usb-serial device to my HA has broke it.
I have just tried to readd CXA61 via second serial to the same HA host, and it started again.
Actually upgrading to 2024.6.2 resolved my issue this time (after disconnecting second serial).
Is there a way to have 2 integrations for 2 audio devices connected through serial-usb adapter?