Remote openHAB - stopped working

Since a few days (don’t know, what happened?), remote openhab stopped working.
It worked since setting it up in January, but now:

  1. Thing was green(!)
  2. No item values where updated
  3. Disabling the binding and starting it again => Thing stays in “unknown” state

I set the binding to trace in the console

log:set TRACE org.openhab.binding.remoteopenhab

Log says:

2021-08-09 14:47:55.550 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'remoteopenhab:server:192_168_xx_yy' changed from UNINITIALIZED (DISABLED) to INITIALIZING
==> /var/log/openhab/openhab.log <==
2021-08-09 14:47:55.560 [DEBUG] [l.handler.RemoteopenhabBridgeHandler] - Initializing remote openHAB handler for bridge remoteopenhab:server:192_168_xx_yy
2021-08-09 14:47:55.561 [DEBUG] [l.handler.RemoteopenhabBridgeHandler] - REST URL = http://192.168.xx.yy:8080/rest
==> /var/log/openhab/events.log <==
2021-08-09 14:47:55.563 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'remoteopenhab:server:192_168_xx_yy' changed from INITIALIZING to UNKNOWN

REST-API is available and responding:

[14:55:23] openhabian@openhabMain:~$ curl http://192.168.xx.yy:8080/rest -I -vs
* Expire in 0 ms for 6 (transfer 0x1c08b0)
*   Trying 192.168.xx.yy...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x1c08b0)
* Connected to 192.168.xx.yy (192.168.xx.yy) port 8080 (#0)
> HEAD /rest HTTP/1.1
> Host: 192.168.xx.yy:8080
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 302 Found
HTTP/1.1 302 Found
< Location: http://192.168.xx.yy:8080/rest/
Location: http://192.168.xx.yy:8080/rest/
< Content-Length: 0
Content-Length: 0
< Server: Jetty(9.4.40.v20210413)
Server: Jetty(9.4.40.v20210413)

<
* Connection #0 to host 192.168.xx.yy left intact

What can I do?

What happens if you restart the remote OH instance? Maybe you need to restart that and then restart the Remote Binding bundle.

I used the binding for awhile without problem but moved back to the MQTT Event Bus implementation when I wrote the JavaScript version recently (see openhab-rules-tools/mqtt_eb at main · rkoshak/openhab-rules-tools · GitHub) and was too lazy to move back. But it worked great while I used it. Maybe there is a new bug that was introduced or something like that.

Yeah, sorry, I forgot: I restarted the second instance, but not main yet.
also moved to MQTT based

It might be worth filing an issue on it. I know I’ve been recommending people use it all over the place and I hate to be doing that if there is a problem with it.

I don’t really have any further ideas for additional information to gather. Maybe putting the binding into debug log and gather logs at boot and when restarting the Thing.

If it works well during 7 months and suddenly it does no more work, you have to identify what changes. Did you update something? Is your remote server running? On the same address?
I doubt seriously there is suddenly a bug in the binding, especially while there were almost no changes…

No changes in network topology, no configuration changes. Only thing updated are the Pi’s apt sources and there was some changes in the rasberry-kernel. But I don’t think, this is the cause?

Rest-API works on the secondary OH3 as intended. I’ll find the time to reboot the Main OH3 and try to get a full TRACE of it then.

Just changed the remote IP address to one, which doesn’t exist, same thing happens[1]. What dependencies does the remote openhab Binding have? (http binding works though!)

Is there a way to access/activate the jetty-logfile?

[1]

  • debug states connection is about to be made
  • state of thing changes to unknown and stays there

You should at least see this DEBUG log: “Try the root REST API…”. Do you see it?

no. just the one lines I posted earlier - and that’s either with the IP from the second openHAB instance or with one, that doesn’t exist in my network. No “try the root REST API” or no error like “couldn’t find the remote openhab server”?

2021-08-10 13:02:31.831 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'remoteopenhab:server:192_168_xx_yy' changed from UNINITIALIZED (DISABLED) to INITIALIZING
==> /var/log/openhab/openhab.log <==
2021-08-10 13:02:31.838 [DEBUG] [l.handler.RemoteopenhabBridgeHandler] - Initializing remote openHAB handler for bridge remoteopenhab:server:192_168_xx_yy
2021-08-10 13:02:31.841 [DEBUG] [l.handler.RemoteopenhabBridgeHandler] - REST URL = http://192.168.xx.yy:8080/rest
==> /var/log/openhab/events.log <==
2021-08-10 13:02:31.843 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'remoteopenhab:server:192_168_xx_yy' changed from INITIALIZING to UNKNOWN

with an IP, that doesn’t fit:

2021-08-10 13:04:15.437 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'remoteopenhab:server:192_168_xx_yy' changed from UNINITIALIZED (DISABLED) to INITIALIZING
==> /var/log/openhab/openhab.log <==
2021-08-10 13:04:15.445 [DEBUG] [l.handler.RemoteopenhabBridgeHandler] - Initializing remote openHAB handler for bridge remoteopenhab:server:192_168_xx_yy
2021-08-10 13:04:15.447 [DEBUG] [l.handler.RemoteopenhabBridgeHandler] - REST URL = http://192.168.xx.zzz:8080/rest
==> /var/log/openhab/events.log <==
2021-08-10 13:04:15.449 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'remoteopenhab:server:192_168_xx_yy' changed from INITIALIZING to UNKNOWN

That’s all I get…?

The log entry I mentioned is the next action just after setting the thing state to UNKNOWN. But this is done in a separate thread. The only reason I am currently imagining is a problem you have to create threads !

Of course, you are not running a fully outdated version of the binding ?

Hmm. How can I check this? I had an issue with memory leaks of amazonechocontrol Binding (openHAB 3.1: problems with ThreadPoolExecutor and subsequenlty OutOfMemory errors), but I solved this for now. Memory should not be an issue.

And yeah, I’m running 3.1.0 on both instances.

The problem appears when you updated all your OH servers to OH3.1 ?
Others changes just before the problem appears?

I updated to OH 3.1 longer than the errors. The errors appeared only a few days ago - the only thing I changed (and I am aware of…!) is the new Rasbpian kernel, coming out? I had the error on about the 5th of August, as I updated this:

-rw-r--r-- 1 root root    847240 Aug  5 20:17 libraspberrypi0_1%3a1.20210805-1_armhf.deb
-rw-r--r-- 1 root root    341112 Aug  5 20:17 libraspberrypi-bin_1%3a1.20210805-1_armhf.deb
-rw-r--r-- 1 root root    400288 Aug  5 20:17 libraspberrypi-dev_1%3a1.20210805-1_armhf.deb
-rw-r--r-- 1 root root  31408268 Aug  5 20:17 libraspberrypi-doc_1%3a1.20210805-1_armhf.deb
-rw-r--r-- 1 root root   1011520 Aug  5 20:17 linux-libc-dev_1%3a1.20210805-1_armhf.deb
-rw-r--r-- 1 root root   4517888 Aug  5 20:17 raspberrypi-bootloader_1%3a1.20210805-1_armhf.deb
-rw-r--r-- 1 root root  79611860 Aug  5 20:17 raspberrypi-kernel_1%3a1.20210805-1_armhf.deb

I’m doing a reboot just now and now my log is flooded with DEBUG-entries for the remoteopenhab binding! seems to work just fine again! :wink: having an eye on it, though!

on further investigation I’d say that Update messed up pretty bad. So I just found out, that also my persistences dropped out since then, without me noticing it (don’t check my stats every day) - and I guess I have to set up some monitoring for my OH3! :wink:
My rules and stuff worked though… strange.

I had the same issue after updating to 3.1.0 on all my servers. I could no longer connect to my 3 remotes. I changed the API Token and still no luck. I had to turn Connect Anyways on to make this work. Since doing that I have never had a disconnect and the things always connect even after a reboot. Seems like some issue with remote authentication in 3.1.0 .