HTTP binding stops working after ~24hrs in OH 4.3.4

hi, I am using the HTTP binding to read energy stats from my home battery API. This has always worked perfectly up to OH 4.3.3, but after an upgrade to 4.3.4 the things using this binding all stop refreshing after 1-2 days. After a restart of OH it works again for another 1-2 days.

I have added a rule that checks that an item linked to the API is being refreshed which will show me exactly when the binding stops working. When looking in the log file around this time there are no error/warning messages whatsoever.

The things continue to show as ā€˜Online’, but when I disable and reenable them their status continues to be ā€˜Unknown’ without any refreshes happening.

I have set the log level of the HTTP binding to DEBUG to see what happens when reenabling a thing and compared the log after they stopped working and after a restart when they work normally. Based on this it seems that the ā€˜RefreshingUrlCache’ scheduling of the refreshes stops working, without any further error messages:

13:53:11.285 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'http:url:adee23e049' changed from UNINITIALIZED (DISABLED) to INITIALIZING
13:53:11.287 [INFO ] [inding.http.internal.HttpThingHandler] - Using the secure client for thing 'http:url:adee23e049'.
13:53:11.287 [DEBUG] [inding.http.internal.HttpThingHandler] - No authentication configured for thing 'http:url:adee23e049'
13:53:11.288 [TRACE] [l.HttpDynamicStateDescriptionProvider] - adding state description for channel http:url:adee23e049:state_of_charge
13:53:11.289 [TRACE] [l.HttpDynamicStateDescriptionProvider] - adding state description for channel http:url:adee23e049:power
13:53:11.290 [TRACE] [l.HttpDynamicStateDescriptionProvider] - adding state description for channel http:url:adee23e049:power_setpoint
13:53:11.290 [TRACE] [l.HttpDynamicStateDescriptionProvider] - adding state description for channel http:url:adee23e049:solar_power
13:53:11.291 [TRACE] [l.HttpDynamicStateDescriptionProvider] - adding state description for channel http:url:adee23e049:system_state
13:53:11.291 [TRACE] [l.HttpDynamicStateDescriptionProvider] - adding state description for channel http:url:adee23e049:system_state_details
13:53:11.292 [TRACE] [http.internal.http.RefreshingUrlCache] - Started refresh task for URL 'http://192.168.4.59/api/v1/power/status' with interval 5s
13:53:11.293 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'http:url:adee23e049' changed from INITIALIZING to UNKNOWN

> the next rows are not showing up when the binding has stopped working:
13:53:12.292 [TRACE] [http.internal.http.RefreshingUrlCache] - Requesting refresh (retry=false) from 'http://192.168.4.59/api/v1/power/status' with timeout 3000ms
13:53:12.294 [TRACE] [http.internal.http.RefreshingUrlCache] - Sending to 'http://192.168.4.59/api/v1/power/status': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.54.v20240208}, Content = {null}
13:53:12.364 [TRACE] [tp.internal.http.HttpResponseListener] - Received from 'http://192.168.4.59/api/v1/power/status': Code = {200}, Headers = {Content-Type: application/json, Content-Length: 524}, Content = {{
…
13:53:12.373 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'http:url:adee23e049' changed from UNKNOWN to ONLINE

Does anyone have any suggestions on what I can do to solve the issue, because I now end up having to restart OH almost daily which is very impractical.

Thanks!

Hi, i have a pretty similar problem and just wanted to open a thread. ā€œgladā€ to hear that somebody else has similar problem so it seems not to be a config problem of mine.

I can add some symptoms:

  • for me the binding stops working randomly sometimes after about 12 hours, sometimes after 3 days. first i thought i have some leaking rules or something build badly (which still maybe the problem!?) but after lot of debugging and looking into logs and open documents of the openhab service etc. I think its not the problem as i thought.
  • on my side not only the http binding stops working but also one other called paradox alarm which is the binding of my alarm system. both stop working the same time. so i guess the problem lies deeper, not only in the http binding (maybe we should move the thread?)
  • like Johan my logs don’t give information, at least the log for the http binding (alarm i still have to observ). on my side, the thing stops working and goes offline. if i restart the bundle only the thing stays in ā€œunknownā€ state. if this happens i see nothing in the log! the binding seems to start normally and says its starting the refreshing jobs. but no refreshes happen. nothing visible in the log.
  • i also tried to restart bundles which maybe support the http binding. i just randomly restarted bundles that seemed to have to do with http stuff…

also for me, a restart of the openhab service ā€œsolvesā€ the problem.

i didnt yet think about that this happend after my upgrade to 4.3.4 but it may fall together as i also just recently updated the system and it seemed to be fine and after 2 days i would connect this any more but it may make sense.

I wanted to ask how I can supply more information. which logs, as the binding logs show nothing? i can enable openhab.core debug logging, but if i do the log is huge and what should i look for?

thanks for helping finding the cause here…

I see there is a stable 4.3.5 available which i will try now and hope this is resolved, if not i try to revert to 4.3.3. but dont know if this is possible… i will post updates here. 4.3.5 changelog seem not to have a solution but will try.

See also HUE items do not update anymore after updating from OH 4.3.1 to 4.3.4

I think it could be the same issue, at least if you have any bindings using OAuth2.

yesterday i thought i will not have to do with oauth because i dont have any auth for my http devices, but of course i could have so i guess the binding is using it… so I really hope that oauth2.0 thing was the problem - the symptoms described there are same that i have so i keep my fingers crossed.

If any of your bindings are using OAuth2, it could affect any other binding, including the HTTP binding.

Thanks, similar to what was mentioned in the Hue thread I updated to 4.3.4 because of the Tado binding requiring OAuth, so this seems to be the rootcause for my issues. Will upgrade to 4.3.5 to see if that solves the issue. Thanks a lot for helping!

good to hear that makes sense, i know i have solaredge binding which retrieves data from the solaredge cloud and uses oauth2. i just checked and this binding also stopped working. also system ist now running smoothly over 48 hours so i guess this was it. thank you

1 Like

Hello I can confirm the update solved the Problem.

1 Like

Same here, upgrade to 4.3.5 solved the issue!

1 Like