[SOLVED] Myopenhab keeps staying offline

Hi
My account on myopenhab shows I’m offline all the time.

On the log file I see this failure every 5 seconds:

2018-10-25 21:09:13.820 [DEBUG] [io.socket.client.Manager            ] - attempting reconnect
2018-10-25 21:09:13.821 [DEBUG] [io.socket.client.Manager            ] - readyState CLOSED
2018-10-25 21:09:13.821 [DEBUG] [io.socket.client.Manager            ] - opening https://www.myopenhab.org:443/
2018-10-25 21:09:13.822 [DEBUG] [io.socket.client.Manager            ] - connection attempt will timeout after 20000
2018-10-25 21:09:13.822 [DEBUG] [io.socket.engineio.client.Socket    ] - creating transport 'polling'
2018-10-25 21:09:13.823 [DEBUG] [io.socket.engineio.client.Socket    ] - setting transport polling
2018-10-25 21:09:13.823 [DEBUG] [t.engineio.client.transports.Polling] - polling
2018-10-25 21:09:13.823 [DEBUG] [ngineio.client.transports.PollingXHR] - xhr poll
2018-10-25 21:09:13.824 [DEBUG] [ngineio.client.transports.PollingXHR] - xhr open GET: https://www.myopenhab.org/socket.io/?EIO=3&transport=polling
2018-10-25 21:09:13.824 [DEBUG] [ngineio.client.transports.PollingXHR] - sending xhr with url https://www.myopenhab.org/socket.io/?EIO=3&transport=polling | data null
2018-10-25 21:09:13.981 [DEBUG] [.www.protocol.http.HttpURLConnection] - sun.net.www.MessageHeader@3fa9752d10 pairs: {GET /socket.io/?EIO=3&transport=polling HTTP/1.1: null}{clientversion: 2.3.0}{openhabversion: 2.3.0}{remoteaccess: true}{secret: ***********}{uuid: ***********}{User-Agent: Java/1.8.0_181}{Host: www.myopenhab.org}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
2018-10-25 21:09:14.059 [DEBUG] [.www.protocol.http.HttpURLConnection] - sun.net.www.MessageHeader@3b96f60018 pairs: {null: HTTP/1.1 404 Not Found}{Server: GitHub.com}{Content-Type: text/html; charset=utf-8}{ETag: "5b9391e2-6e0"}{Access-Control-Allow-Origin: *}{X-GitHub-Request-Id: 6C6A:248E:13C23CE:1AC9ED8:5BD1FB5F}{Content-Length: 1760}{Accept-Ranges: bytes}{Date: Thu, 25 Oct 2018 18:09:10 GMT}{Via: 1.1 varnish}{Age: 2915}{Connection: keep-alive}{X-Served-By: cache-hhn1547-HHN}{X-Cache: HIT}{X-Cache-Hits: 40}{X-Timer: S1540490950.470202,VS0,VE0}{Vary: Accept-Encoding}{X-Fastly-Request-ID: c9ecb7af79253acce6a8b6fba2b80d8d05ef4414}
2018-10-25 21:09:14.060 [DEBUG] [io.socket.engineio.client.Socket    ] - socket error io.socket.engineio.client.EngineIOException: xhr poll error
2018-10-25 21:09:14.061 [DEBUG] [io.socket.client.Manager            ] - connect_error
2018-10-25 21:09:14.061 [DEBUG] [io.socket.client.Manager            ] - cleanup
2018-10-25 21:09:14.062 [DEBUG] [io.socket.client.Manager            ] - reconnect attempt error
2018-10-25 21:09:14.063 [DEBUG] [io.socket.client.Manager            ] - will wait 5000ms before reconnect attempt
2018-10-25 21:09:14.063 [DEBUG] [io.socket.engineio.client.Socket    ] - socket close with reason: transport error
2018-10-25 21:09:14.064 [DEBUG] [t.engineio.client.transports.Polling] - transport not open - deferring close
2018-10-25 21:09:16.233 [DEBUG] [org.eclipse.jetty.io.ManagedSelector] - Channel java.nio.channels.SocketChannel[connection-pending remote=/10.0.0.1:9090] timed out while connecting, closing it
2018-10-25 21:09:16.233 [DEBUG] [nt.io.WebSocketClientSelectorManager] - Connection Failed
java.net.SocketTimeoutException: Connect Timeout
	at org.eclipse.jetty.io.ManagedSelector$ConnectTimeout.run(ManagedSelector.java:683) [76:org.eclipse.jetty.io:9.3.21.v20170918]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
2018-10-25 21:09:19.065 [DEBUG] [io.socket.client.Manager            ] - attempting reconnect

My Java version is:
java version “1.8.0_181”
Java™ SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)

Running on Windows 8.1

I’ve trying changing my UUID and secret, tried updating Java to the latest, tried rebooting.
Nothing seems to help.

Anyone has an idea what am I missing?

Perhaps the local firewall is preventing connections.

I tried disabling the firewall on the client side as well as on my router.
Still getting the 404 errors.

what is the host running on IP 10.0.0.1 ?

Not sure what was it at that time.
I check the log again now and I don’t see that timeout error.

2018-11-18 23:22:08.438 [DEBUG] [io.socket.client.Manager            ] - attempting reconnect
2018-11-18 23:22:08.438 [DEBUG] [io.socket.client.Manager            ] - readyState CLOSED
2018-11-18 23:22:08.438 [DEBUG] [io.socket.client.Manager            ] - opening https://www.myopenhab.org:443/
2018-11-18 23:22:08.438 [DEBUG] [io.socket.client.Manager            ] - connection attempt will timeout after 20000
2018-11-18 23:22:08.438 [DEBUG] [io.socket.engineio.client.Socket    ] - creating transport 'polling'
2018-11-18 23:22:08.439 [DEBUG] [io.socket.engineio.client.Socket    ] - setting transport polling
2018-11-18 23:22:08.439 [DEBUG] [t.engineio.client.transports.Polling] - polling
2018-11-18 23:22:08.439 [DEBUG] [ngineio.client.transports.PollingXHR] - xhr poll
2018-11-18 23:22:08.439 [DEBUG] [ngineio.client.transports.PollingXHR] - xhr open GET: https://www.myopenhab.org/socket.io/?EIO=3&transport=polling
2018-11-18 23:22:08.439 [DEBUG] [ngineio.client.transports.PollingXHR] - sending xhr with url https://www.myopenhab.org/socket.io/?EIO=3&transport=polling | data null
2018-11-18 23:22:08.590 [DEBUG] [.www.protocol.http.HttpURLConnection] - sun.net.www.MessageHeader@22ba0c9910 pairs: {GET /socket.io/?EIO=3&transport=polling HTTP/1.1: null}{clientversion: 2.3.0}{openhabversion: 2.3.0}{remoteaccess: true}{secret: **}{uuid: **}{User-Agent: Java/1.8.0_191}{Host: www.myopenhab.org}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
2018-11-18 23:22:08.665 [DEBUG] [.www.protocol.http.HttpURLConnection] - sun.net.www.MessageHeader@26858c1618 pairs: {null: HTTP/1.1 404 Not Found}{Server: GitHub.com}{Content-Type: text/html; charset=utf-8}{ETag: "5b9391e2-6e0"}{Access-Control-Allow-Origin: *}{X-GitHub-Request-Id: 5588:2763:3E40E8:53CCC7:5BF1CE5C}{Content-Length: 1760}{Accept-Ranges: bytes}{Date: Sun, 18 Nov 2018 21:22:08 GMT}{Via: 1.1 varnish}{Age: 2468}{Connection: keep-alive}{X-Served-By: cache-hhn1526-HHN}{X-Cache: HIT}{X-Cache-Hits: 52}{X-Timer: S1542576129.771592,VS0,VE0}{Vary: Accept-Encoding}{X-Fastly-Request-ID: 5c016b8dfa2c59eec363a377d1b968e58089b35a}
2018-11-18 23:22:08.666 [DEBUG] [io.socket.engineio.client.Socket    ] - socket error io.socket.engineio.client.EngineIOException: xhr poll error
2018-11-18 23:22:08.666 [DEBUG] [io.socket.client.Manager            ] - connect_error
2018-11-18 23:22:08.666 [DEBUG] [io.socket.client.Manager            ] - cleanup
2018-11-18 23:22:08.666 [DEBUG] [io.socket.client.Manager            ] - reconnect attempt error
2018-11-18 23:22:08.667 [DEBUG] [io.socket.client.Manager            ] - will wait 5000ms before reconnect attempt
2018-11-18 23:22:08.667 [DEBUG] [io.socket.engineio.client.Socket    ] - socket close with reason: transport error
2018-11-18 23:22:08.668 [DEBUG] [t.engineio.client.transports.Polling] - transport not open - deferring close

Try some basic troubleshooting steps… maybe they will help:

Login/Logout at the myopenhab.org website
Restart your OH2 service.

Your Java version seems ok, the myopenhab.org site is up… I don’t know what to suggest :frowning:

Maybe as a last check: make sure that you use https://myopenhab.org/ (not https://www.myopenhab.org:443/) in the openHAB Cloud configuration in PaperUI

edit: Actually this is the problem

The URL https://www.myopenhab.org/socket.io/?EIO=3&transport=polling gives a 404
while
The URL https://myopenhab.org/socket.io/?EIO=3&transport=polling works

next time, follow the docs to the letter :slight_smile:

Oh wow, I can’t believe I missed that.
Several hours of my life got wasted due to a “www”.

Thank you very much for the help, It’s working properly now.

1 Like

You are welcome!

Quoting Vincent @vzorglub :slight_smile: