hass-opnsense: Error enabling device tracker
Many thanks for this plugin. I have installed it (along with the corresponding opnsense plugin) and am getting the non device_tracker entities coming through, as expected.
However, wen trying to save after clicking “Enable Device Trackers” in the configuration options, I get a socket timeout error:
2022-01-01 06:25:59 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 215, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/opnsense/config_flow.py", line 195, in async_step_init
return await self.async_step_device_tracker()
File "/config/custom_components/opnsense/config_flow.py", line 237, in async_step_device_tracker
arp_table := await self.hass.async_add_executor_job(
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/opnsense/pyopnsense/__init__.py", line 489, in get_arp_table
response = self._exec_php(script)
File "/config/custom_components/opnsense/pyopnsense/__init__.py", line 64, in inner
response = func(*args, **kwargs)
File "/config/custom_components/opnsense/pyopnsense/__init__.py", line 97, in _exec_php
response = self._get_proxy().opnsense.exec_php(script)
File "/usr/local/lib/python3.9/xmlrpc/client.py", line 1116, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python3.9/xmlrpc/client.py", line 1458, in __request
response = self.__transport.request(
File "/usr/local/lib/python3.9/xmlrpc/client.py", line 1160, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/local/lib/python3.9/xmlrpc/client.py", line 1173, in single_request
resp = http_conn.getresponse()
File "/usr/local/lib/python3.9/http/client.py", line 1371, in getresponse
response.begin()
File "/usr/local/lib/python3.9/http/client.py", line 319, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.9/http/client.py", line 280, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.9/socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "/usr/local/lib/python3.9/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/lib/python3.9/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
Saving other configuration options (e.g. Scan Interval) works fine. The issue only appears with enabling device trackers.
I have tried repeatedly (including restarting opnsense/home assistant etc), but the error persists. I am using OPNSense version 21.7.7 and Home Assistant 2021.12.7.
Can you help by pointing me in the right direction to enable device trackers.
Many thanks!
EDIT: I am using root user to login to OPNsense.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 54 (22 by maintainers)
updated README
This debugging experience is the main reason why I love the open-source philosophy/approach. Great teamwork of people giving their time/experience for free with the sole scope of solving issues and learning new things while doing it…
I was not an advocate of open-source a few years ago…I was totally wrong…obviously…
Note has been added to README.md about AdGuard.
Everyone helps! The device tracker integration in this integration is quite unique in that I have direct control over the arp table and remove the entries. As long as you set the scan interval and consider home interval to sane values you should get very consistent and good results.
Yes, absolutely!
And a snapshot of the final result in the HA integration: