Cloud Connection Errors

I install and manage systems using OH 3.2 on RPi 4’s and have had a problem with my most recent install template where I get the typical cloud connection issue:

2022-04-08 13:43:44.046 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance. Reconnecting.

I also get this leak error:

2022-04-08 13:42:26.606 [WARN ] [okhttp3.OkHttpClient                ] - A connection to https://myopenhab.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

These errors repeat constantly.

So I downloaded the latest version of openHABian, installed it on new hardware, and installed the Cloud Connector without making any other changes.

Same result. Oh, I also tried updating to the latest stable version of OH through the configuration console but again, no change.

Any ideas as to what’s going on and how to resolve this?

Really? Noone? To reiterate, I am getting this in a newly downloaded install of OH3.2 on new RPi hardware, with no other changes made. Isn’t this happening to everyone else who is downloading the latest release then?

Perhaps look at the discussions under “openHAB Cloud”, including a troubleshooting version of the cloud connector that you can install.

Tried that with the same results. I haven’t gone into the enhanced logging. I assume there are people with more knowledge than me already working on it.

If you enable more logging it might tell what is wrong. One example is wrong credentials.

Yes I tried to eliminate possibilities like that by downloading a fresh install, installing on new hardware, and installing the cloud plugin with no other changes. Right away I get those leak errors with no changes to the system.

Sorry, I am not sure about the leak errors/warnings. I think everybody gets those

I was referring to the hard error which is really the thing you are interested. By enabling verbose logging, you will get the reason why it cannot connect, if I recall correctly

OK I got the log going. I don’t know what it means but here it is:

2022-04-13 13:55:37.184 [TRACE] [io.openhabcloud.internal.CloudClient] - Manager.EVENT_TRANSPORT
2022-04-13 13:55:37.186 [TRACE] [io.openhabcloud.internal.CloudClient] - Transport.EVENT_REQUEST_HEADERS
2022-04-13 13:55:37.189 [DEBUG] [io.openhabcloud.internal.CloudClient] - Socket.IO connecting
2022-04-13 13:55:37.321 [DEBUG] [io.openhabcloud.internal.CloudClient] - Socket.IO OPEN
2022-04-13 13:55:37.323 [TRACE] [io.openhabcloud.internal.CloudClient] - Manager.EVENT_TRANSPORT
2022-04-13 13:55:37.324 [TRACE] [io.openhabcloud.internal.CloudClient] - Transport.EVENT_REQUEST_HEADERS
2022-04-13 13:55:37.327 [TRACE] [io.openhabcloud.internal.CloudClient] - Transport.EVENT_REQUEST_HEADERS
2022-04-13 13:55:37.459 [DEBUG] [io.openhabcloud.internal.CloudClient] - Socket.IO Packet: ERROR (4)
2022-04-13 13:55:37.461 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance: not authorized. Reconnecting after 30000 ms.
2022-04-13 13:55:37.463 [TRACE] [io.openhabcloud.internal.CloudClient] - Transport.EVENT_REQUEST_HEADERS
2022-04-13 13:55:37.466 [DEBUG] [io.openhabcloud.internal.CloudClient] - Socket.IO CLOSE: forced close

not authorized

I propose you check your uuid and secret configuration in myopenhab.org. Could there be a typo or extra space somewhere?

This is happening before I get to that step. As soon as I load the plugin I start getting the error every 30 seconds, after a few minutes the leak errors start as well.

Registering with myopenhab doesn’t change things. This is happening in several systems I’m managing.

That is weird indeed, I have only seen “Not authorized” error when uuid and/or secret is configured incorrectly in myopenhab.org.

Perhaps some others have troubleshooting steps to diagnose this further

Yeah the crazy thing is that I just started having this problem on the last two systems I’ve built. I saw the errors here but didn’t think too much of it. I thought it was maybe some new error because I hadn’t registered them with myopenhab yet but when I did I realized it was a real problem.

Again, since then I have tried to remove any variables. I can download a fresh version of openHABian, install it on new hardware, install the cloud plugin, and I get this error every 30 seconds. I would think that if that’s happening to me it should be happening to anyone else following the same steps. I really expected to see this as a known issue. Really don’t get it…

Back on this. I just downloaded the stable version of openHABian to a different computer, flashed a new card with a different OS, and installed it in a new RPi. After installation finished I skipped setup and install the cloud connector (3.2 version). Getting the same errors. Can anyone else confirm this problem for me? I’m on a network with two other, older instalations, that ae not having this problem.

Log:

tail -f /var/log/openhab/openhab.log /var/log/openhab/events.log
Filter
==> /var/log/openhab/openhab.log <==
==> /var/log/openhab/events.log <==
==> /var/log/openhab/openhab.log <==
2022-05-05 19:50:54.796 [INFO ] [.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2022-05-05 19:50:56.452 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.
2022-05-05 19:51:04.339 [INFO ] [org.openhab.ui.internal.UIService   ] - Started UI on port 8080
2022-05-05 19:51:07.179 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Started HABPanel at /habpanel
2022-05-05 19:52:43.385 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Stopped HABPanel
2022-05-05 19:52:43.557 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2022-05-06 15:18:59.157 [WARN ] [.io.rest.auth.internal.TokenResource] - Couldn't find a user with a session matching the provided refresh_token
2022-05-06 15:18:59.165 [WARN ] [.io.rest.auth.internal.TokenResource] - Token issuing failed: invalid_grant
2022-05-06 15:19:29.304 [INFO ] [p.auth.internal.AuthorizePageServlet] - First user account created: openhabian
2022-05-06 15:19:39.083 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'America/New_York'.
2022-05-06 15:19:39.089 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'en_US'.
2022-05-06 15:21:36.933 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance. Reconnecting.
2022-05-06 15:21:38.267 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance. Reconnecting.
2022-05-06 15:21:40.764 [WARN ] [okhttp3.OkHttpClient                ] - A connection to https://myopenhab.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
2022-05-06 15:21:40.937 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance. Reconnecting.
2022-05-06 15:21:46.619 [WARN ] [okhttp3.OkHttpClient                ] - A connection to https://myopenhab.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
2022-05-06 15:21:46.839 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance. Reconnecting.
2022-05-06 15:21:53.412 [WARN ] [okhttp3.OkHttpClient                ] - A connection to https://myopenhab.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
2022-05-06 15:21:53.648 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance. Reconnecting.
2022-05-06 15:22:14.591 [WARN ] [okhttp3.OkHttpClient                ] - A connection to https://myopenhab.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
2022-05-06 15:22:14.754 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance. Reconnecting.
2022-05-06 15:22:43.776 [WARN ] [okhttp3.OkHttpClient                ] - A connection to https://myopenhab.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
2022-05-06 15:22:43.784 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance. Reconnecting.

Anyone? Just looking for confirmation (or not).

@fullmoonguru I can confirm that many many people successfully use 3.2.0 release and 3.3.0-SNAPSHOT versions without the “not authorized” error you are seeing.

@ssalonen Thanks. That being the case, how do I determine why I’m having this issue? Especially since I have removed every variable I can think of and it’s happening with fresh downloads of openHABian with no changes? Is there additional logging or something that will help to identify the issue?

I am building a new 3.2.0 system right now and after installing the 3.2.0 cloud connector plugin I started getting this log warning:

- Error connecting to the openHAB Cloud instance: not authorized. Reconnecting after 30000 ms.

Then I installed Tailscale andgot this (with the last log being the one I’ve been seeing before):

2022-05-20 08:21:52.225 [WARN ] [org.apache.karaf.shell.ssh.Activator] - Exception caught while starting SSH server
java.net.BindException: Address already in use
	at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
	at sun.nio.ch.Net.bind(Net.java:455) ~[?:?]
	at sun.nio.ch.Net.bind(Net.java:447) ~[?:?]
	at sun.nio.ch.AsynchronousServerSocketChannelImpl.bind(AsynchronousServerSocketChannelImpl.java:164) ~[?:?]
	at org.apache.sshd.common.io.nio2.Nio2Acceptor.bind(Nio2Acceptor.java:81) ~[bundleFile:2.8.0]
	at org.apache.sshd.common.io.nio2.Nio2Acceptor.bind(Nio2Acceptor.java:171) ~[bundleFile:2.8.0]
	at org.apache.sshd.server.SshServer.start(SshServer.java:331) ~[bundleFile:2.8.0]
	at org.apache.karaf.shell.ssh.Activator.createAndRunSshServer(Activator.java:129) [bundleFile:?]
	at org.apache.karaf.shell.ssh.Activator.doStart(Activator.java:116) [bundleFile:?]
	at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:312) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
==> /var/log/openhab/events.log <==
2022-05-20 08:21:52.792 [INFO ] [openhab.event.ChannelTriggeredEvent ] - logreader:reader:LogReader:newErrorEvent triggered 2022-05-20 08:21:52.224 [ERROR] [che.sshd.common.io.nio2.Nio2Acceptor] - bind(/100.117.31.68:8101) - failed (BindException) to bind: Address already in use
2022-05-20 08:21:52.795 [INFO ] [openhab.event.ChannelTriggeredEvent ] - logreader:reader:LogReader:newWarningEvent triggered 2022-05-20 08:21:52.225 [WARN ] [org.apache.karaf.shell.ssh.Activator] - Exception caught while starting SSH server
==> /var/log/openhab/openhab.log <==
2022-05-20 08:21:58.282 [WARN ] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance: not authorized. Reconnecting after 30000 ms.
==> /var/log/openhab/events.log <==
2022-05-20 08:21:58.833 [INFO ] [openhab.event.ChannelTriggeredEvent ] - logreader:reader:LogReader:newWarningEvent triggered 2022-05-20 08:21:58.282 [WARN ] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance: not authorized. Reconnecting after 30000 ms.
==> /var/log/openhab/openhab.log <==
2022-05-20 08:22:29.661 [WARN ] [okhttp3.OkHttpClient                ] - A connection to https://myopenhab.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

Maybe a clue.

OK now several minutes later I’m getting the first error again about every minute. This is different than the errors I was getting at the top of this thread so something seems to have changed. My install is from a template I created in March so that’s not new. I ran an update on openHABiian and also openHAB, through the openHABian config consol. Something in these updates has changed it seems.

Another 30 minutes and, since I was seeing different errors, I tried going to myopenhab.org and registering and now I have a successful connection and the errors have stopped.

Hi I got the same issue. A nightmare for several days. I used the same application and I switch my installation from rasp 3 to Rasp 5. Si I went in my account in myopenhab.org where I entered new uuid And new secret. It was not working. I solved the problem by clicking in myopenhab.org account on “delete items and events”. Then it worked perfectly. I supposed there was address conflict between old and new installation. It always simple when you get the solution, but it took several days. I hope it will help many people facing the same issue. Claude