Closed ohhai-kthxbai closed 3 years ago
opnsense documentation opnsense source (message by IssueLinks)
Hey there @mtreinish, mind taking a look at this issue as its been labeled with an integration (opnsense
) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)
I can confirm this issue on my end. It seems to have started when upgrading OPNsense to 21.1.x.
I get the same "read timed out" errors as above.
I posted about the issue here as well: https://forum.opnsense.org/index.php?topic=21439.0
Yes, so for the time being, the HA -> OPNsense integration is no longer working.
I have the same issue core-2021.2.3 + OPNsense 21.1. (after upgrade from 20.7.)
I can also confirm the same issue when trying to set up on 21.1.1
It seems this bug needs to be fixed in Opnsense (Issue). Alternatively, there is this temporary fix from "fedot". Not tested though.
I switched to Nmap for tracking presence, which works just as well. https://www.home-assistant.io/integrations/nmap_tracker/
Entry in my configuration.yaml is as follows:
device_tracker:
- platform: nmap_tracker
home_interval: 10
scan_options: " --privileged -sn "
hosts:
- 192.168.5.195 #Phone 1
- 192.168.5.114 #Phone 2
It seems this bug needs to be fixed in Opnsense (Issue). Alternatively, there is this temporary fix from "fedot". Not tested though.
Yeah, that'll be me, I just hacked that together and increased the timeouts. Home Assistant takes a very long time to start up now, probably because it's pulling the git repo everytime. I think this issue is a little deeper than just the API, the WebUI also takes a long time responding with the ARP table data :confused: Make sure to drop a thumbs up on the upstream issue if you're affected as well.
The great guys over at opnsense took care of it for now, to fix it temporarily, SSH into your opnsense, open the shell and enter
opnsense-patch dd2231e
This patch should be live in the next release or two.
Thank you @xorbital ! Looks like this is resolved, with no further changes required to HA.
OPNsense dev here: The Python netaddr 0.8.0 library is slow to respond on certain requests and we merely worked around for 21.1.2 out since Tuesday. It would be helpful to have the request URL in the stack trace / error log. The stack trace itself isn't very helpful for projects integrated into home-assistant when users report the API broken when it is not.
Cheers, Franco
You're right, there's only part of it there
File "/usr/local/lib/python3.8/site-packages/pyopnsense/diagnostics.py", line 52, in get_arp return self._get('diagnostics/interface/getArp')
The full URL of the GET request is https://opnsense/api/diagnostics/interface/getArp
As I've said in the issue in the opnsense repo, the opnsense UI responded slow as well :thinking:
The issue is in your timeouts primarily. It's ok to use them but to infer problems because the software can't wait is problematic. It's not like a 404 or 500 you are seeing...
Hm, you think we should increase the timeout? IIRC opnsense takes up to 15min until dropping a peer from the ARP table after a disconnect, right? So polling it every 12 seconds might not provide too much value anyway.
sure, 2-10 minutes is probably fine. it depends on the use of this information, if you need to react probably nearer to the two minutes, otherwise more to the 10.
If we hit a hard timeout with a HTTP response error let me know. Here it looked like we didn't but I could be wrong.
Cheers, Franco
The problem
Opnsense integration was working but after upgdade of opnsense appears to be broken (see logs below)
I suspect it's because..
From the opnsense 21.1 changelog https://forum.opnsense.org/index.php?topic=21147.0
What is version of Home Assistant Core has the issue?
2021.2.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
opnsense
Link to integration documentation on our website
https://www.home-assistant.io/integrations/opnsense/
Example YAML snippet
Anything in the logs that might be useful for us?