wxt9861 / esxi_stats

ESXi component for Home Assistant
MIT License
147 stars 40 forks source link

Component does not start with HA 2024.2.1 #99

Closed Kedryn closed 8 months ago

Kedryn commented 9 months ago

Describe the bug with HA 2024.2.0 the component does not start

To Reproduce update HA to 2024.2.0

Expected behavior To start as before

`Logger: homeassistant.setup Source: setup.py:251 First occurred: 09:32:39 (1 occurrences) Last logged: 09:32:39

Setup failed for custom integration 'esxi_stats': Unable to import component: Exception importing custom_components.esxi_stats Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 827, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 994, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/esxi_stats/init.py", line 7, in from .esxi import ( File "/config/custom_components/esxi_stats/esxi.py", line 4, in from pyVim.connect import SmartConnect, SmartConnectNoSSL File "/usr/local/lib/python3.12/site-packages/pyVim/connect.py", line 37, in from pyVmomi import vim, vmodl, SoapStubAdapter, SessionOrientedStub File "/usr/local/lib/python3.12/site-packages/pyVmomi/init.py", line 39, in from pyVmomi.SoapAdapter import SoapStubAdapter, StubAdapterBase, SoapCmdStubAdapter, \ File "/usr/local/lib/python3.12/site-packages/pyVmomi/SoapAdapter.py", line 1003, in _SocketWrapper = ssl.wrap_socket ^^^^^^^^^^^^^^^ AttributeError: module 'ssl' has no attribute 'wrap_socket'

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 835, in get_component raise ImportError(f"Exception importing {self.pkg_path}") from err ImportError: Exception importing custom_components.esxi_stats`

`Logger: homeassistant.loader Source: loader.py:827 First occurred: 09:32:39 (1 occurrences) Last logged: 09:32:39

Unexpected exception importing component custom_components.esxi_stats Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 827, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 994, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/esxi_stats/init.py", line 7, in from .esxi import ( File "/config/custom_components/esxi_stats/esxi.py", line 4, in from pyVim.connect import SmartConnect, SmartConnectNoSSL File "/usr/local/lib/python3.12/site-packages/pyVim/connect.py", line 37, in from pyVmomi import vim, vmodl, SoapStubAdapter, SessionOrientedStub File "/usr/local/lib/python3.12/site-packages/pyVmomi/init.py", line 39, in from pyVmomi.SoapAdapter import SoapStubAdapter, StubAdapterBase, SoapCmdStubAdapter, \ File "/usr/local/lib/python3.12/site-packages/pyVmomi/SoapAdapter.py", line 1003, in _SocketWrapper = ssl.wrap_socket ^^^^^^^^^^^^^^^ AttributeError: module 'ssl' has no attribute 'wrap_socket'`

redtripleAAA commented 9 months ago

FYI @wxt9861 Correct it’s broken with HA 2024.2.1

Couple screenshots here

IMG_4211 IMG_4212

Already rebooted the entire server, same issue

Logs:

2024-02-12 13:54:11.390 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs 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
2024-02-12 13:54:11.398 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration esxi_stats 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
2024-02-12 13:54:11.418 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration uptime_kuma 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
2024-02-12 13:54:11.421 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration frigate 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
2024-02-12 13:54:11.423 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration wyzeapi 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
2024-02-12 13:54:34.903 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component custom_components.esxi_stats
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 827, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/esxi_stats/__init__.py", line 7, in <module>
    from .esxi import (
  File "/config/custom_components/esxi_stats/esxi.py", line 4, in <module>
    from pyVim.connect import SmartConnect, SmartConnectNoSSL
  File "/usr/local/lib/python3.12/site-packages/pyVim/connect.py", line 37, in <module>
    from pyVmomi import vim, vmodl, SoapStubAdapter, SessionOrientedStub
  File "/usr/local/lib/python3.12/site-packages/pyVmomi/__init__.py", line 39, in <module>
    from pyVmomi.SoapAdapter import SoapStubAdapter, StubAdapterBase, SoapCmdStubAdapter, \
  File "/usr/local/lib/python3.12/site-packages/pyVmomi/SoapAdapter.py", line 1003, in <module>
    _SocketWrapper = ssl.wrap_socket
                     ^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'
2024-02-12 13:54:35.172 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'esxi_stats': Unable to import component: Exception importing custom_components.esxi_stats
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 827, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/esxi_stats/__init__.py", line 7, in <module>
    from .esxi import (
  File "/config/custom_components/esxi_stats/esxi.py", line 4, in <module>
    from pyVim.connect import SmartConnect, SmartConnectNoSSL
  File "/usr/local/lib/python3.12/site-packages/pyVim/connect.py", line 37, in <module>
    from pyVmomi import vim, vmodl, SoapStubAdapter, SessionOrientedStub
  File "/usr/local/lib/python3.12/site-packages/pyVmomi/__init__.py", line 39, in <module>
    from pyVmomi.SoapAdapter import SoapStubAdapter, StubAdapterBase, SoapCmdStubAdapter, \
  File "/usr/local/lib/python3.12/site-packages/pyVmomi/SoapAdapter.py", line 1003, in <module>
    _SocketWrapper = ssl.wrap_socket
                     ^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'

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 835, in get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.esxi_stats
2024-02-12 13:54:39.339 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Islamic Prayer Times for islamic_prayer_times
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/islamic_prayer_times/__init__.py", line 34, in async_setup_entry
    await er.async_migrate_entries(hass, config_entry.entry_id, update_unique_id)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1392, in async_migrate_entries
    ent_reg.async_update_entity(entry.entity_id, **updates)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 997, in async_update_entity
    return self._async_update_entity(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 942, in _async_update_entity
    raise ValueError(
ValueError: Unique id '53f6858601d3f558213ac1eb5495c91a-Fajr' is already in use by 'sensor.islamic_prayer_times_fajr_prayer'
2024-02-12 13:54:40.974 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/site-packages/telegram/utils/request.py:49: UserWarning: python-telegram-bot is using upstream urllib3. This is allowed but not supported by python-telegram-bot maintainers.
  warnings.warn(

2024-02-12 13:54:45.202 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.
2024-02-12 13:54:45.202 WARNING (MainThread) [homeassistant.setup] Setup of input_datetime is taking over 10 seconds.
2024-02-12 13:54:51.576 WARNING (MainThread) [homeassistant.components.environment_canada] Unable to retrieve Environment Canada radar
2024-02-12 13:55:07.082 ERROR (MainThread) [homeassistant.components.homekit.util] media_player.xbox does not support any media_player features
2024-02-12 14:05:48.257 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 10.0.12.79 (10.0.12.79). Requested URL: '/auth/token'. (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36)
2024-02-12 14:05:48.358 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 10.0.12.79 (10.0.12.79). Requested URL: '/api/websocket'. (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36)
wxt9861 commented 9 months ago

What version of the component are you using? Your logs suggest you might be using version 0.6x which depends on an older version of pyvmomi which might(?) have compatibility issues with python 3.12.

Also, does the error persist through HASS restarts?

redtripleAAA commented 9 months ago

Update: @wxt9861 I was running outdated version of the HACS, once updated and restarted, Screenshot 2024-02-12 at 2 20 51 PM that fixed the issue

Kedryn commented 9 months ago

Update: @wxt9861 I was running outdated version of the HACS, once updated and restarted, Screenshot 2024-02-12 at 2 20 51 PM that fixed the issue

that fixed for me too, thanks!

Gatlarf commented 8 months ago

The update fixed it for me too. I did a manual install when I set this up initally. I now added the repo and installed from there, without removing the manual installation first. Very happy to have my stats back and thank you for your excellent work.

Off-topic: Now, let’s hope Broadcom will revert their decision on ESXI…

wxt9861 commented 8 months ago

@Gatlarf will stay hopeful. I have no plans to migrate to another hypervisor at this time so this component should stay active, as time permits.