hass-opnsense
hass-opnsense copied to clipboard
When ZeroTier disabled, Interface shows as missing and HASS Integration fails to load
I have ZeroTier half set up - so I have it installed, but disabled, and an interface assigned to the disabled ZT instance - which means the interface assignment is showing as missing in OPN
This caused an error with the HASS integration.
HASS Log
xmlrpc.client.ProtocolError: <ProtocolError for <SNIPAPI>:<SNIPKEY>@router.local/xmlrpc.php: 500 Internal Server Error>
2024-02-13 06:17:08.342 ERROR (SyncWorker_13) [custom_components.opnsense.pyopnsense] Unexpected get_telemetry error err=<ProtocolError for <SNIPAPI>:<SNIPKEY>@router.local/xmlrpc.php: 500 Internal Server Error>, type(err)=<class 'xmlrpc.client.ProtocolError'>
2024-02-13 06:17:08.346 ERROR (MainThread) [custom_components.opnsense] Unexpected error fetching router.local OPNsense state data: <ProtocolError for <SNIPAPI>:<SNIPKEY>@router.local/xmlrpc.php: 500 Internal Server Error>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 269, in _async_update_data
return await self.update_method()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opnsense/init.py", line 97, in async_update_data
await hass.async_add_executor_job(lambda: data.update())
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opnsense/init.py", line 97, in
OPN Report [13-Feb-2024 06:13:30 Europe/London] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/etc/inc/xmlrpc/hass.inc(12) : eval()'d code:26 Stack trace: #0 /usr/local/etc/inc/xmlrpc/hass.inc(12) : eval()'d code(60): interfaces_api() #1 /usr/local/etc/inc/xmlrpc/hass.inc(12): eval() #2 /usr/local/opnsense/contrib/IXR/IXR_Library.php(446): exec_php_xmlrpc('\nini_set('displ...') #3 /usr/local/opnsense/contrib/IXR/IXR_Library.php(384): IXR_Server->call('opnsense.exec_p...', '\nini_set('displ...') #4 /usr/local/opnsense/contrib/IXR/IXR_Library.php(357): IXR_Server->serve('<?xml version='...') #5 /usr/local/etc/inc/xmlrpc.inc(67): IXR_Server->__construct(Array) #6 /usr/local/www/xmlrpc.php(104): XMLRPCServer->start() #7 {main} thrown in /usr/local/etc/inc/xmlrpc/hass.inc(12) : eval()'d code on line 26
Debug Log Message Error | opnsense | /usr/local/sbin/pluginctl: The command `/usr/local/sbin/ifinfo 'zt<snipZTIFName>'' failed to execute
I "fixed" it by enabling ZT to run - which made the interface have an assignment - and no more error.
Not sure if this is something to be fixed - but might help people in future at least.
are you on 24.1 or 24.1.1?
I just pushed v0.1.18
, give it a try and see if that's fixed.
Issue was still present for me on v0.1.18, I had a wireguard interface which was disabled in Wireguard config (something I tested long ago and didn't work the way I wanted), leading to a missing wg1 device under assignments. I deleted the interface assigned to device wg1 and the issue went away.
Try v0.1.20
.
Sorry didn't have time to test until now. The new version fixed my problem with the disabled wireguard instance. @travisghansen thanks
0.1.20 works for me too - thanks very much!