wxt9861 / esxi_stats

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

Error in log upgrading to 2021.4 #51

Closed sylviepipi closed 3 years ago

sylviepipi commented 3 years ago

Got the following error since i upgraded to 2021.4

2021-04-08 18:25:45 ERROR (SyncWorker_11) [custom_components.esxi_stats] (vim.fault.NoPermission) { dynamicType = , dynamicProperty = (vmodl.DynamicProperty) [], msg = '', faultCause = , faultMessage = (vmodl.LocalizableMessage) [], object = 'vim.Folder:ha-folder-root', privilegeId = 'System.Read' }

wxt9861 commented 3 years ago

Can you send a full debug log from the component. This is pointing at permissions on your host.

ivanlos commented 3 years ago

Hello,

I have the same issue after upgrading from 2021.03.4 to 2021.04.1 :cry:

Here's my home-assistant if it can helps you.

2021-04-09 21:48:11 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry IPADDRESS for esxi_stats
Traceback (most recent call last):
  File "/config/custom_components/esxi_stats/__init__.py", line 139, in async_setup_entry
    conn = await esx_connect(**conn_details)
  File "/config/custom_components/esxi_stats/esxi.py", line 18, in esx_connect
    si = SmartConnectNoSSL(host=host, user=user, pwd=pwd, port=port)
  File "/usr/local/lib/python3.8/site-packages/pyVim/connect.py", line 885, in SmartConnectNoSSL
    return SmartConnect(protocol=protocol,
  File "/usr/local/lib/python3.8/site-packages/pyVim/connect.py", line 842, in SmartConnect
    supportedVersion = __FindSupportedVersion(protocol,
  File "/usr/local/lib/python3.8/site-packages/pyVim/connect.py", line 720, in __FindSupportedVersion
    serviceVersionDescription = __GetServiceVersionDescription(protocol,
  File "/usr/local/lib/python3.8/site-packages/pyVim/connect.py", line 641, in __GetServiceVersionDescription
    tree = __GetElementTree(protocol, server, port,
  File "/usr/local/lib/python3.8/site-packages/pyVim/connect.py", line 608, in __GetElementTree
    conn.request("GET", path)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1266, in _send_request
    self.putrequest(method, url, **skips)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 150, in protected_loop_func
    check_loop()
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 139, in check_loop
    raise RuntimeError(
RuntimeError: I/O must be done in the executor; Use `await hass.async_add_executor_job()` at custom_components/esxi_stats/esxi.py, line 18: si = SmartConnectNoSSL(host=host, user=user, pwd=pwd, port=port)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/esxi_stats/__init__.py", line 147, in async_setup_entry
    raise ConfigEntryNotReady
homeassistant.exceptions.ConfigEntryNotReady

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 249, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/esxi_stats/__init__.py", line 149, in async_setup_entry
    esx_disconnect(conn)
UnboundLocalError: local variable 'conn' referenced before assignment
wxt9861 commented 3 years ago

@ivanlos did you update the component to the latest version? (0.6.2)

ivanlos commented 3 years ago

@wxt9861 No 😢 I've updated the component to 0.6.2 and it's working again. Thank you for your comment !