plugwise / plugwise-beta

Custom-component / development version of the Plugwise Home Assistant platform
MIT License
24 stars 8 forks source link

[BUG]: plugwise-beta: 0.45.1 not starting on HA 2023.11.3 and 2023.12.0 (Docker) #537

Closed basvdl closed 10 months ago

basvdl commented 11 months ago

Describe the bug.

I was running HA 2023.11.2 and 0.45.1 without any problems.

Any of the combination below result in the error: No module named 'plugwise.exceptions'

2023.11.3 + 0.45.1 2023.12.0 + 0.45.1

2023-12-08 23:28:33.413 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration plugwise which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-08 23:29:01.463 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration plugwise: Unable to import component: No module named 'plugwise.exceptions'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 816, 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/plugwise/__init__.py", line 6, in <module>
    from plugwise.exceptions import PlugwiseError
  File "/config/plugwise/__init__.py", line 6, in <module>
    from plugwise.exceptions import PlugwiseError
ModuleNotFoundError: No module named 'plugwise.exceptions'

What version of Plugwise Beta are you using?

0.45.1

What was the last working version of Plugwise Beta (or Core if not using beta before)?

0.45.1

What version of Home Assistant Core are you using?

2023.11.2

What type of installation are you running?

Home Assistant Container

How did you install plugwise-beta?

Manually installed custom_component

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

Adam 3.7.8

Logging

No response

Diagnostics information

No response

Additional information

No response

bouwew commented 11 months ago

@basvdl that's very strange, we did not change anything related to this.

I'm running v0.45.1 in HA 2023.12.1 (VM in PROXMOX), all working normally.

It looks like the plugwise-backend is not loading correctly. What type of HA installation do you use?

basvdl commented 11 months ago

Running inside Docker on a Unix server.

Would it help to stop HA, remove plugwise_beta from custom_components, upgrade HA, start HA, and reinstall pkugwise_beta?

bouwew commented 11 months ago

When looking here https://www.home-assistant.io/installation/#advanced-installation-methods which installation-type do you have?

To be honest, I don't know what's exactly going on in your system. Might be a disk-space problem? The problem is with the plugwise-backend library that is corrupted, overwritten, not present, etc.

basvdl commented 10 months ago

When looking here https://www.home-assistant.io/installation/#advanced-installation-methods which installation-type do you have?

To be honest, I don't know what's exactly going on in your system. Might be a disk-space problem? The problem is with the plugwise-backend library that is corrupted, overwritten, not present, etc.

I use Home Assistant Container: Standalone container-based installation of Home Assistant Core (e.g. Docker).

The home-assisttant folder is located under /var/cold, their should not be a problem in terms of space...

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/md127       14G  4.4G  9.6G  32% /sysroot
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           7.7G     0  7.7G   0% /dev/shm
efivarfs        128K   59K   65K  48% /sys/firmware/efi/efivars
tmpfs           3.1G   10M  3.1G   1% /run
tmpfs           7.7G     0  7.7G   0% /tmp
/dev/md125      350M  204M  123M  63% /boot
/dev/md124      219G   45G  175G  21% /var
/dev/md126      2.7T   13G  2.6T   1% /var/cold
tmpfs           1.6G  4.0K  1.6G   1% /run/user/1000
basvdl commented 10 months ago

After removing the __pycache__ directory under custom_components\plugwise it worked.

Successfully running HA docker image 2012.12.1 and plugwise-beta: 0.45.1.

Don't fully understand it, but I'll take it for now ;)

bouwew commented 10 months ago

Ah yes, that's it, cached content in the __pycache__ dirs. I remember running into the same problem in the past. But then it was in the directory where the plugwise backend-library is installed.

Anyway, good news :)