homeassistant-midea-air-appliances-lan: Integration errors after upgrading home assistant to 2024.1.2
Version of the custom_component
Latest
Describe the bug
I recently updated home assistant to 2024.1.2 and have had the following errors ever since:
Debug log
Logger: homeassistant.setup
Source: setup.py:403
First occurred: 20:02:44 (2 occurrences)
Last logged: 20:02:44
Unable to prepare setup for platform 'midea_dehumidifier.humidifier': Platform not found (Exception importing custom_components.midea_dehumidifier.humidifier).
Unable to prepare setup for platform 'midea_dehumidifier.sensor': Platform not found (Exception importing custom_components.midea_dehumidifier.sensor).
Logger: homeassistant.loader
Source: loader.py:842
First occurred: 20:02:44 (2 occurrences)
Last logged: 20:02:44
Unexpected exception importing platform custom_components.midea_dehumidifier.humidifier
Unexpected exception importing platform custom_components.midea_dehumidifier.sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 936, in exec_module
File "<frozen importlib._bootstrap_external>", line 1074, in get_code
File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/config/custom_components/midea_dehumidifier/humidifier.py", line 187
self._device_class = HumidifierDeviceClass.DEHUMIDIFIER
^
TabError: inconsistent use of tabs and spaces in indentation
About this issue
- Original URL
- State: open
- Created 6 months ago
- Comments: 32 (4 by maintainers)
Not a hick up, a change where dev folders within containers are now by default read only and need config to be write able. Not quite sure if this will be maintained (in case all impacted cases will need config tweaking) or if the change will be rolled back…
See also here: https://github.com/moby/moby/issues/47158#issuecomment-1903975175
@nbogojevic , could you perhaps amend the config as per the guidance in the link to avoid this issue in the future?
There is a workaround - that of using docker.io and containerd instead of docker-ce. It’s not a supported HA set-up, but it works. You’ll have to modify the homeassistant-supervised package dependencies, otherwise the package manager won’t let you do the switch. In any case, it’s not the best option - best would be rewriting how multiprocessing is implemented or wait for a fix in the multiprocessing library, if that’s on the roadmap…
Can confirm that a docker upgrade seems to be the problem. HA Version 2024.1.6 runs fine unless you don’t update docker. After updating Docker to the latest current version (Ubuntu 22.04, in my case: Version 25.0.3, build 4debf41), loading of the intergration fails with a Read-only file system:
Logger: homeassistant.setup Source: setup.py:251 First occurred: 07:30:11 (1 occurrences) Last logged: 07:30:11
Setup failed for custom integration ‘midea_dehumidifier_lan’: Unable to import component: Exception importing custom_components.midea_dehumidifier_lan Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/loader.py”, line 822, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.11/importlib/init.py”, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “<frozen importlib._bootstrap>”, line 1204, in _gcd_import File “<frozen importlib._bootstrap>”, line 1176, in _find_and_load File “<frozen importlib._bootstrap>”, line 1147, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 690, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 940, in exec_module File “<frozen importlib._bootstrap>”, line 241, in _call_with_frames_removed File “/config/custom_components/midea_dehumidifier_lan/init.py”, line 29, in <module> from midea_beautiful.cloud import MideaCloud File “/usr/local/lib/python3.11/site-packages/midea_beautiful/init.py”, line 7, in <module> from midea_beautiful.lan import LanDevice, appliance_state File “/usr/local/lib/python3.11/site-packages/midea_beautiful/lan.py”, line 13, in <module> from midea_beautiful.appliance import Appliance File “/usr/local/lib/python3.11/site-packages/midea_beautiful/appliance.py”, line 8, in <module> from midea_beautiful.command import ( File “/usr/local/lib/python3.11/site-packages/midea_beautiful/command.py”, line 17, in <module> _order_lock = RLock() ^^^^^^^ File “/usr/local/lib/python3.11/multiprocessing/context.py”, line 73, in RLock return RLock(ctx=self.get_context()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.11/multiprocessing/synchronize.py”, line 194, in init SemLock.init(self, RECURSIVE_MUTEX, 1, 1, ctx=ctx) File “/usr/local/lib/python3.11/multiprocessing/synchronize.py”, line 57, in init sl = self._semlock = _multiprocessing.SemLock( ^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 30] Read-only file system
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/setup.py”, line 251, in _async_setup_component component = integration.get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/src/homeassistant/homeassistant/loader.py”, line 830, in get_component raise ImportError(f"Exception importing {self.pkg_path}") from err ImportError: Exception importing custom_components.midea_dehumidifier_lan
There is a way to roll back, I’ll give it a go and report back
I run my HA on an Intel Atom D525 supervised Debian Bookworm as well
@churchofnoise your problem is different from the original one in this issue. I don’t think your problem is an issue with integration, the error occurs when integration gets re-entrant lock (RLock) from python, on which integration has no control. The error says that underlying file system used to implement RLock (SemLock in traces above) has been reported as read-only by OS.
That can happen if process user doesn’t have permissions or if you use hosting systems such as Docker. Check which OS,VM or docker environment you use and if there are correct permissions and configuration of the mounted file system (on linux it may be /dev/shm which is used to provide lock functionality).
You are right is should be 0.9.0 - updated note. Do you have any errors in log?
Ora maybe @albertoxamin can support us here 😃