No remote access to OH3 UI from Android or Browser

Hi people,

I have an issue getting access to the OpenHab3 instance from remote. By remote I mean home.myopenhab. It will be a huge post, sorry for that but I want to add all my findings so far.
I am having this issue since moving to OH3 last year. I was not using remote access that much but now I would like to have it.

I think I read all topics that we have in the community and tried all of them but still have no access.

Here are a few things that are working:

  1. I am getting notifications by using remote access (browser and android app).
  2. Local access is working (browser and android app).
  3. Sitemap access remotely and locally in Android (but sometimes it does not want to refresh, have to kill my Openhab app and try again)

Regarding the installation:

  1. Have tried OH3 using a Debian image as a VM in VirtualBox.
  2. Tried with latest Ubuntu Server image as well on VM
  3. Moved to Docker containers with versions
    • “openhab/openhab:3.3.0”
    • “openhab/openhab:3.3.0-snapshot-debian”
    • “openhab/openhab:3.4.0.M5-debian”

For the docker containers, it was just Openhab without local volumes, a pure Openhab instance with a manual install of cloud connector.

I tried to create a new myopenhab account and link it there, tried with my existing but still no access.

In my network, there are no firewalls. VM is connected(bridge mode) to a router that has internet connectivity.

I was trying to use postman with basic auth to read and set items over home.myopenhab and that is working.

During this troubleshooting, I was checking logs in karaf and when hitting a refresh in the browser(home.myopenhab) I was getting something like this:

22:45:44.965 [WARN ] [okhxxp3.OkhxxpClient                 ] - A connection to hxxps://myopenhab/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkhxxpClient logger level to FINE: Logger.getLogger(OkhxxpClient.class.getName()).setLevel(Level.FINE);
22:45:45.498 [INFO ] [openhab.event.ChannelTriggeredEvent  ] - logreader:reader:openhablog:newWarningEvent triggered 2022-12-06 22:45:44.965 [WARN ] [okhxxp3.OkhxxpClient                ] - A connection to hxxps://myopenhab/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkhxxpClient logger level to FINE: Logger.getLogger(OkhxxpClient.class.getName()).setLevel(Level.FINE);

In most cases it was just something like:

openhab> log:set TRACE org.openhab.io.openhabcloud
openhab> log:tail
13:25:39.729 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Socket.IO ping
13:25:39.791 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Socket.IO pong: 62 ms
13:25:55.119 [TRACE] [.io.openhabcloud.internal.CloudClient] - Socket.IO Packet: EVENT (2)
13:25:55.129 [DEBUG] [.io.openhabcloud.internal.CloudClient] - on(): request
13:25:55.136 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Got request 3831876
13:25:55.145 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Path /rest/
13:25:55.150 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Method GET
13:25:55.156 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Headers: {"host":"myopenhab","cache-control":"no-cache","accept-encoding":"gzip","user-agent":"openhab-cloud/0.0.1"}
13:25:55.165 [TRACE] [.io.openhabcloud.internal.CloudClient] - Body 
13:25:55.172 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Query null
13:25:55.180 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Request method is GET
13:25:55.186 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Jetty set header host = myopenhab
13:25:55.193 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Jetty set header cache-control = no-cache
13:25:55.200 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Jetty set header accept-encoding = gzip
13:25:55.208 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Jetty set header user-agent = openhab-cloud/0.0.1
13:25:55.258 [DEBUG] [.io.openhabcloud.internal.CloudClient] - onHeaders 3831876
13:25:55.269 [TRACE] [.io.openhabcloud.internal.CloudClient] - Sent headers to request 3831876
13:25:55.269 [TRACE] [.io.openhabcloud.internal.CloudClient] - {"headers":{"Transfer-Encoding":"chunked","Server":"Jetty(9.4.46.v20220331)","Date":"Tue, 06 Dec 2022 12:25:55 GMT","Content-Type":"application/json"},"responseStatusCode":200,"responseStatusText":"OK","id":3831876}
13:25:55.270 [DEBUG] [.io.openhabcloud.internal.CloudClient] - onResponseContent: 3831876, content size 1919
13:25:55.270 [TRACE] [.io.openhabcloud.internal.CloudClient] - {"version":"5","locale":"en_HR","measurementSystem":"SI","runtimeInfo":{"version":"3.3.0","buildString":"Build #2972"},"links":[{"type":"transformations","url":"hxxps://myopenhab/rest/transformations"},{"type":"thing-types","url":"hxxps://myopenhab/rest/thing-types"},{"type":"items","url":"hxxps://myopenhab/rest/items"},{"type":"uuid","url":"hxxps://myopenhab/rest/uuid"},{"type":"spec","url":"hxxps://myopenhab/rest/spec"},{"type":"bindings","url":"hxxps://myopenhab/rest/bindings"},{"type":"config-descriptions","url":"hxxps://myopenhab/rest/config-descriptions"},{"type":"rules","url":"hxxps://myopenhab/rest/rules"},{"type":"auth","url":"hxxps://myopenhab/rest/auth"},{"type":"systeminfo","url":"hxxps://myopenhab/rest/systeminfo"},{"type":"addons","url":"hxxps://myopenhab/rest/addons"},{"type":"profile-types","url":"hxxps://myopenhab/rest/profile-types"},{"type":"templates","url":"hxxps://myopenhab/rest/templates"},{"type":"links","url":"hxxps://myopenhab/rest/links"},{"type":"voice","url":"hxxps://myopenhab/rest/voice"},{"type":"things","url":"hxxps://myopenhab/rest/things"},{"type":"audio","url":"hxxps://myopenhab/rest/audio"},{"type":"channel-types","url":"hxxps://myopenhab/rest/channel-types"},{"type":"events","url":"hxxps://myopenhab/rest/events"},{"type":"ui","url":"hxxps://myopenhab/rest/ui"},{"type":"discovery","url":"hxxps://myopenhab/rest/discovery"},{"type":"services","url":"hxxps://myopenhab/rest/services"},{"type":"iconsets","url":"hxxps://myopenhab/rest/iconsets"},{"type":"logging","url":"hxxps://myopenhab/rest/logging"},{"type":"sitemaps","url":"hxxps://myopenhab/rest/sitemaps"},{"type":"inbox","url":"hxxps://myopenhab/rest/inbox"},{"type":"persistence","url":"hxxps://myopenhab/rest/persistence"},{"type":"module-types","url":"hxxps://myopenhab/rest/module-types"}]}
13:25:55.271 [TRACE] [.io.openhabcloud.internal.CloudClient] - Sent content to request 3831876
13:25:55.271 [DEBUG] [.io.openhabcloud.internal.CloudClient] - onComplete: 3831876
13:25:55.271 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Finished responding to request 3831876
13:25:55.615 [TRACE] [.io.openhabcloud.internal.CloudClient] - Socket.IO Packet: EVENT (2)
13:25:55.620 [DEBUG] [.io.openhabcloud.internal.CloudClient] - on(): request
13:25:55.624 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Got request 3831880
13:25:55.631 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Path /rest/sitemaps
13:25:55.637 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Method GET
13:25:55.641 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Headers: {"host":"myopenhab","cache-control":"no-cache","accept-encoding":"gzip","user-agent":"openhab-cloud/0.0.1"}
13:25:55.650 [TRACE] [.io.openhabcloud.internal.CloudClient] - Body 
13:25:55.655 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Query null
13:25:55.660 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Request method is GET
13:25:55.664 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Jetty set header host = myopenhab
13:25:55.669 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Jetty set header cache-control = no-cache
13:25:55.676 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Jetty set header accept-encoding = gzip
13:25:55.681 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Jetty set header user-agent = openhab-cloud/0.0.1
13:25:55.694 [DEBUG] [.io.openhabcloud.internal.CloudClient] - onHeaders 3831880
13:25:55.695 [TRACE] [.io.openhabcloud.internal.CloudClient] - Sent headers to request 3831880
13:25:55.695 [TRACE] [.io.openhabcloud.internal.CloudClient] - {"headers":{"Transfer-Encoding":"chunked","Server":"Jetty(9.4.46.v20220331)","Date":"Tue, 06 Dec 2022 12:25:55 GMT","Content-Type":"application/json"},"responseStatusCode":200,"responseStatusText":"OK","id":3831880}
13:25:55.705 [DEBUG] [.io.openhabcloud.internal.CloudClient] - onResponseContent: 3831880, content size 192
13:25:55.710 [TRACE] [.io.openhabcloud.internal.CloudClient] - [{"name":"test","label":"test","link":"hxxps://myopenhab/rest/sitemaps/test","homepage":{"link":"hxxps://myopenhab/rest/sitemaps/test/test","leaf":false,"timeout":false,"widgets":[]}}]
13:25:55.714 [TRACE] [.io.openhabcloud.internal.CloudClient] - Sent content to request 3831880
13:25:55.719 [DEBUG] [.io.openhabcloud.internal.CloudClient] - onComplete: 3831880
13:25:55.725 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Finished responding to request 3831880
13:25:55.857 [TRACE] [.io.openhabcloud.internal.CloudClient] - Socket.IO Packet: EVENT (2)
13:25:55.862 [DEBUG] [.io.openhabcloud.internal.CloudClient] - on(): cancel
13:25:55.865 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Received cancel for request 3831880
13:25:55.869 [TRACE] [.io.openhabcloud.internal.CloudClient] - Socket.IO Packet: EVENT (2)
13:25:55.874 [DEBUG] [.io.openhabcloud.internal.CloudClient] - on(): cancel
13:25:55.877 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Received cancel for request 3831880
13:26:04.793 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Socket.IO ping
13:26:04.853 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Socket.IO pong: 60 ms
13:26:29.854 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Socket.IO ping
13:26:29.911 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Socket.IO pong: 57 ms
13:26:54.912 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Socket.IO ping
13:26:54.966 [DEBUG] [.io.openhabcloud.internal.CloudClient] - Socket.IO pong: 54 ms

I managed to get more logs but could not understand what was the trigger. To me, it looks like something is running in a loop. The request to load app.js is failing and I get >200 app.js to load?

2022-12-06 14:42:01.731 [DEBUG] [io.openhabcloud.internal.CloudClient] - on(): request
2022-12-06 14:42:01.735 [DEBUG] [io.openhabcloud.internal.CloudClient] - Got request 3854255
2022-12-06 14:42:01.738 [DEBUG] [io.openhabcloud.internal.CloudClient] - Path /precache-manifest.c980545ddd49691ed83c7abbab4543ac.js
2022-12-06 14:42:01.743 [DEBUG] [io.openhabcloud.internal.CloudClient] - Method GET
2022-12-06 14:42:01.746 [DEBUG] [io.openhabcloud.internal.CloudClient] - Headers: {"sec-fetch-mode":"no-cors","referer":"hxxps://home.myopenhab/service-worker.js","sec-fetch-site":"same-origin","accept-language":"en-US,en;q=0.9,hr;q=0.8","host":"home.myopenhab:443","dnt":"1","cache-control":"max-age=0","accept-encoding":"gzip, deflate, br","user-agent":"openhab-cloud/0.0.1","accept":"*/*","sec-fetch-dest":"script"}
2022-12-06 14:42:01.758 [TRACE] [io.openhabcloud.internal.CloudClient] - Body 
2022-12-06 14:42:01.761 [DEBUG] [io.openhabcloud.internal.CloudClient] - Query null
2022-12-06 14:42:01.765 [DEBUG] [io.openhabcloud.internal.CloudClient] - Request method is GET
2022-12-06 14:42:01.768 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-mode = no-cors
2022-12-06 14:42:01.773 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header referer = hxxps://home.myopenhab/service-worker.js
2022-12-06 14:42:01.779 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-site = same-origin
2022-12-06 14:42:01.783 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept-language = en-US,en;q=0.9,hr;q=0.8
2022-12-06 14:42:01.789 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header host = home.myopenhab:443
2022-12-06 14:42:01.794 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header dnt = 1
2022-12-06 14:42:01.798 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header cache-control = max-age=0
2022-12-06 14:42:01.802 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept-encoding = gzip, deflate, br
2022-12-06 14:42:01.808 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header user-agent = openhab-cloud/0.0.1
2022-12-06 14:42:01.812 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header accept = */*
2022-12-06 14:42:01.816 [DEBUG] [io.openhabcloud.internal.CloudClient] - Jetty set header sec-fetch-dest = script
2022-12-06 14:42:01.821 [DEBUG] [io.openhabcloud.internal.CloudClient] - onHeaders 3854255
2022-12-06 14:42:01.823 [TRACE] [io.openhabcloud.internal.CloudClient] - Sent headers to request 3854255
2022-12-06 14:42:01.832 [TRACE] [io.openhabcloud.internal.CloudClient] - {"headers":{"Server":"Jetty(9.4.46.v20220331)","ETag":"\"1656195018000\"","Content-Length":"18723","Content-Type":"application/javascript"},"responseStatusCode":200,"responseStatusText":"OK","id":3854255}
2022-12-06 14:42:01.840 [DEBUG] [io.openhabcloud.internal.CloudClient] - onResponseContent: 3854255, content size 16248
2022-12-06 14:42:01.846 [TRACE] [io.openhabcloud.internal.CloudClient] - self.__precacheManifest = [
  {
    "revision": "24ea62738a8a1262e0fe",
    "url": "/css/0.app.css"
  },
  {
    "revision": "24ea62738a8a1262e0fe",
    "url": "/js/0.app.js"
  },
  {
    "revision": "9dda7f2c7618c0c13845",
    "url": "/js/1.app.js"
  },
  {
    "revision": "692ee32498236bdd1012",
    "url": "/js/2.app.js"
  },
  {
    "revision": "326d8a4e8ec71a226998",
    "url": "/css/3.app.css"
  },
  {
    "revision": "326d8a4e8ec71a226998",
    "url": "/js/3.app.js"
  },
  {
    "revision": "e8f3f213476524ca47f3",
    "url": "/js/4.app.js"
  },....................................

Not to mention issues like other had in other topics related to myopenhab

service-worker.js:1 Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'hxxps://home.myopenhab/precache-manifest.f6294c7bab91a15c0940bbc3e43cf394.js' failed to load.
    at hxxps://home.myopenhab/service-worker.js:1:1
(anonymous) @ service-worker.js:1
The script does not have a MIME type.

I was trying to use
[Cloud Connector Troubleshooting 3.3 (BETA)but when starting with trace level there is a huge dump of wired characters and data that does not make any sense. I guess it is because this loop is running.

Any idea what could go wrong? I tried to isolate just openhab and its connectivity to the internet and myopenhab server, so, without any other binding or logic whatsoever.

Same here. I moved my docker installation from a rpi4 to a ubuntu server host, no luck in getting UI3 from the cloud. Tried releases from 3.1 to 3.4, fresh new instances of the container, even from the suggested yml from docker hub pages but always the same behaviour. Sometimes, pressing F5 or ctrl-F5 does some steps and loads parts of the UI but never the whole inteface.
I am still reading the forum in search for hints but am running out of clues.

I have one personal instance of opehnab-cloud which has the exact same behaviour, so I suppose the issue should ben client-side.

Workaround: log in into karaf console and set global log level on DEBUG
log:set DEBUG

Tried again to log into cloud: everything is smooth. Why that?!

1 Like