wxt9861 / esxi_stats

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

core-2021.12.1 breaks integration #62

Closed pvprodk closed 2 years ago

pvprodk commented 2 years ago

Describe the bug Integration not working after upgrading to core-2021.12.1

ESXi environment (please complete the following information): Supervised setup running on Debian/ESXi

ERROR LOG

This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/esxi_stats/init.py:169 Integration: ESXi Stats (documentation, issues) First occurred: 12:43:46 (1 occurrences) Last logged: 12:43:46

Error setting up entry 192.168.XXX.XXX for esxi_stats Traceback (most recent call last): File "/config/custom_components/esxi_stats/init.py", line 159, in connect conn = 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.9/site-packages/pyVim/connect.py", line 887, in SmartConnectNoSSL return SmartConnect(protocol=protocol, File "/usr/local/lib/python3.9/site-packages/pyVim/connect.py", line 856, in SmartConnect return Connect(host=host, File "/usr/local/lib/python3.9/site-packages/pyVim/connect.py", line 265, in Connect si, stub = Login(host, port, user, pwd, service, adapter, version, path, File "/usr/local/lib/python3.9/site-packages/pyVim/connect.py", line 388, in Login x = content.sessionManager.Login(user, pwd, None) File "/usr/local/lib/python3.9/site-packages/pyVmomi/VmomiSupport.py", line 706, in self.f((self.args + (obj,) + args), **kwargs) File "/usr/local/lib/python3.9/site-packages/pyVmomi/VmomiSupport.py", line 512, in _InvokeMethod return self._stub.InvokeMethod(self, info, args) File "/usr/local/lib/python3.9/site-packages/pyVmomi/SoapAdapter.py", line 1397, in InvokeMethod raise obj # pylint: disable-msg=E0702 pyVmomi.VmomiSupport.vim.fault.InvalidLogin: (vim.fault.InvalidLogin) { dynamicType = , dynamicProperty = (vmodl.DynamicProperty) [], msg = 'Cannot complete login due to an incorrect user name or password.', faultCause = , faultMessage = (vmodl.LocalizableMessage) [] }

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/esxi_stats/init.py", line 167, in connect raise ConfigEntryNotReady homeassistant.exceptions.ConfigEntryNotReady: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/config/custom_components/esxi_stats/init.py", line 129, in async_setup_entry lic = await hass.async_add_executor_job(connect, hass, config, entry) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/esxi_stats/init.py", line 169, in connect esx_disconnect(conn) UnboundLocalError: local variable 'conn' referenced before assignment

wxt9861 commented 2 years ago

Can't reproduce.

You use it is not as the error says, incorrect credentials?

pvprodk commented 2 years ago

Can't reproduce.

You use it is not as the error says, incorrect credentials?

I feel so stupid right now. I think you're right. My bad.

wxt9861 commented 2 years ago

If it is still not working, turn on debug and provide a log.

pvprodk commented 2 years ago

If it is still not working, turn on debug and provide a log.

I just removed the integration and added it again with an updated password, and now it works. Sorry to have wasted your time. You can close this ticket :)

wxt9861 commented 2 years ago

No worries. Glad it is working.