openHAB Cloud connection refused. "onRequestFailure"

I’m trying to get the openHAB cloud connector working with my fresh install of OH3, but I get the error “openHAB connection error: Connection refused” when accessing https://home.myopenhab.org. The attempted connection shows up in my frontail log, so I don’t think it’s a port/firewall issue. Here’s the trace log I’m seeing:

2022-12-11 20:17:19.036 [DEBUG] [io.openhabcloud.internal.CloudClient] - on(): request
2022-12-11 20:17:19.038 [DEBUG] [io.openhabcloud.internal.CloudClient] - Got request 46196454
2022-12-11 20:17:19.039 [DEBUG] [io.openhabcloud.internal.CloudClient] - Path /
2022-12-11 20:17:19.040 [DEBUG] [io.openhabcloud.internal.CloudClient] - Method GET
2022-12-11 20:17:19.041 [DEBUG] [io.openhabcloud.internal.CloudClient] - Headers: {"sec-fetch-mode":"navigate","referer":"https://myopenhab.org/","sec-fetch-site":"same-site","accept-language":"en-US,en;q=0.5","upgrade-insecure-requests":"1","host":"home.myopenhab.org:443","sec-fetch-user":"?1","accept-encoding":"gzip, deflate, br","user-agent":"openhab-cloud/0.0.1","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8","sec-fetch-dest":"document"}
2022-12-11 20:17:19.042 [TRACE] [io.openhabcloud.internal.CloudClient] - Body 
2022-12-11 20:17:19.042 [DEBUG] [io.openhabcloud.internal.CloudClient] - Query null
2022-12-11 20:17:19.043 [DEBUG] [io.openhabcloud.internal.CloudClient] - Request method is GET
2022-12-11 20:17:19.043 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-mode = navigate
2022-12-11 20:17:19.043 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header referer = https://myopenhab.org/
2022-12-11 20:17:19.043 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-site = same-site
2022-12-11 20:17:19.043 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept-language = en-US,en;q=0.5
2022-12-11 20:17:19.043 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header upgrade-insecure-requests = 1
2022-12-11 20:17:19.044 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header host = home.myopenhab.org:443
2022-12-11 20:17:19.044 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-user = ?1
2022-12-11 20:17:19.044 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept-encoding = gzip, deflate, br
2022-12-11 20:17:19.044 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header user-agent = openhab-cloud/0.0.1
2022-12-11 20:17:19.044 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept = text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
2022-12-11 20:17:19.044 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-dest = document
2022-12-11 20:17:19.045 [DEBUG] [io.openhabcloud.internal.CloudClient] - onRequestFailure: 46196454,  Connection refused
2022-12-11 20:17:19.046 [DEBUG] [io.openhabcloud.internal.CloudClient] - onComplete: 46196454
2022-12-11 20:17:19.047 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty request 46196454 failed: Connection refused
2022-12-11 20:17:19.047 [DEBUG] [io.openhabcloud.internal.CloudClient] - Request Failure: Connection refused
2022-12-11 20:17:19.047 [DEBUG] [io.openhabcloud.internal.CloudClient] - Response Failure: Connection refused
2022-12-11 20:17:19.047 [DEBUG] [io.openhabcloud.internal.CloudClient] - Finished responding to request 46196454
2022-12-11 20:17:19.199 [DEBUG] [io.openhabcloud.internal.CloudClient] - on(): request
2022-12-11 20:17:19.200 [DEBUG] [io.openhabcloud.internal.CloudClient] - Got request 46196457
2022-12-11 20:17:19.201 [DEBUG] [io.openhabcloud.internal.CloudClient] - Path /
2022-12-11 20:17:19.202 [DEBUG] [io.openhabcloud.internal.CloudClient] - Method GET
2022-12-11 20:17:19.203 [DEBUG] [io.openhabcloud.internal.CloudClient] - Headers: {"sec-fetch-mode":"navigate","referer":"https://myopenhab.org/","sec-fetch-site":"same-site","accept-language":"en-US,en;q=0.5","upgrade-insecure-requests":"1","host":"home.myopenhab.org:443","sec-fetch-user":"?1","accept-encoding":"gzip, deflate, br","user-agent":"openhab-cloud/0.0.1","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8","sec-fetch-dest":"document"}
2022-12-11 20:17:19.204 [TRACE] [io.openhabcloud.internal.CloudClient] - Body 
2022-12-11 20:17:19.205 [DEBUG] [io.openhabcloud.internal.CloudClient] - Query null
2022-12-11 20:17:19.206 [DEBUG] [io.openhabcloud.internal.CloudClient] - Request method is GET
2022-12-11 20:17:19.207 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-mode = navigate
2022-12-11 20:17:19.208 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header referer = https://myopenhab.org/
2022-12-11 20:17:19.209 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-site = same-site
2022-12-11 20:17:19.210 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept-language = en-US,en;q=0.5
2022-12-11 20:17:19.210 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header upgrade-insecure-requests = 1
2022-12-11 20:17:19.211 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header host = home.myopenhab.org:443
2022-12-11 20:17:19.212 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-user = ?1
2022-12-11 20:17:19.213 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept-encoding = gzip, deflate, br
2022-12-11 20:17:19.214 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header user-agent = openhab-cloud/0.0.1
2022-12-11 20:17:19.215 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept = text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
2022-12-11 20:17:19.215 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-dest = document
2022-12-11 20:17:19.220 [DEBUG] [io.openhabcloud.internal.CloudClient] - onRequestFailure: 46196457,  Connection refused
2022-12-11 20:17:19.221 [DEBUG] [io.openhabcloud.internal.CloudClient] - onComplete: 46196457
2022-12-11 20:17:19.224 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty request 46196457 failed: Connection refused
2022-12-11 20:17:19.225 [DEBUG] [io.openhabcloud.internal.CloudClient] - Request Failure: Connection refused
2022-12-11 20:17:19.226 [DEBUG] [io.openhabcloud.internal.CloudClient] - Response Failure: Connection refused
2022-12-11 20:17:19.227 [DEBUG] [io.openhabcloud.internal.CloudClient] - Finished responding to request 46196457

did you change your secret on the cloud connector?

Yes, I updated the UUID from /var/lib/openhab/uuid and the secret from /var/lib/openhab/openhabcloud/secret. It seems like it’s partially connected because it says the system is online and at least one log message seems to indicate it connected (see below).

I think the problem is that openhab isn’t listening on http://localhost:8080 and instead only listens on http://192.168.xxx.xxx:8080. Running sudo lsof -i -P -n | grep LISTEN | grep 8080 shows that localhost is not being monitored.

java 70476 openhab 103u IPv4 668443 0t0 TCP 192.168.xxx.xxx:8080 (LISTEN)

Additionally, the sudo systemctl status openhab.service shows that the system is arping on the wrong interface? 755950 arping -w 5 -C 1 -i virbr0 192.168.xxx.xxx

Any thoughts on how to fix this?

I finally found the issue… /var/lib/openhab/etc/org.ops4j.pax.web.cfg was setup to only listen on my 192.168.xxx.xxx IP. I changed address to be org.ops4j.pax.web.listening.addresses = 127.0.0.1,192.168.xxx.xxx, where x’s are my IP.