Closed CrappyTan closed 2 years ago
Refactoring to async http handling would be a solution, the buffer size is not limited then.
Just for information, this is something I implemented in the remote openHAB binding. Not very difficult. See PR #9320
Would that be possible with this one? Wish I new how to build this then I could contribute as my house is "blind"
Is there anyone who might be able to help me with this? It's rendered my presence detection unworkable. I'm willing to contribute some beer tokens towards a fix for it.
I took a quick look at this. The change should be pretty well isolated in UnifiControllerRequest.java. However, I'm not sure how to handle what he's doing with this exception condition. @lolodomo do you know how to handle this special case?
@lolodomo Ping
You certainly have to keep this special case unchsnged and have it in the two modes.
@lolodomo Thanks.
I see what you mean, but I really don't understand what he's doing with the ContentResponse he gets from the exception here. He claims it's an HTTP 401 response, but in the getContent method he doesn't do anything with the ContentResponse from that exception because he just throws a UniFiExpiredSessionException
here for the HTTP 401 status code.
No., this is weird but apparently he finds the response in the exception cause. So this is a case where the exception is bypaased.
Right. He gets the ContentResponse object from the HttpResponseException
cause, then he returns that ContentResponse object to his getContent
method at which point he checks the HTTP status code. But if the status code is a 401, he just throws another exception in his getContent
method.
I suppose the responsr he retrieves in the exception has a 200 status code. Why not asking him directly?
I thought about it possibly being a 200. That would be the only thing that would make it work.
@mgbowman hasn't been on here in quite a while, but I'll ping him anyway.
This issue has been mentioned on openHAB Community. There might be relevant details there:
https://community.openhab.org/t/ubiquiti-unifi-binding-feature-discussion/14520/1137
This issue has been mentioned on openHAB Community. There might be relevant details there:
OH Unifi binding has stopped working. Initially stopped on 2.5 and remains broken in OH3.
Constant polling gives this error:
18:41:23.594 [WARN ] [l.handler.UniFiControllerThingHandler] - Unhandled exception while refreshing the UniFi Controller unifi:controller:home - java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded
CloudKey is up to date as are all Unifi devices on my network.
Error in OH Log
Multiple posts on the forum for this issue too.
Happy to provide other information or tests if needed
edit: putting log to trace.. api it fails on: https://ubnt.home:8443/api/s/default/stat/sta when called, the response header says it's 338kB. it takes my unifi key 2.6 seconds to return it. it is incredibly verbose; shows the port status, traffic etc of every port on every device (6 devices, around 130 clients across wired and wireless)
Is there a more targeted API to call to get the status?