OpenHAB-cloud (docker) setup.Your openHAB is not online

I have installed the openhab-cloud locally with docker according to instructions on DockerHub.

  • The local setup works.
  • I registered an email address, the uuid and secret.
  • I have setup the correct address for the openHab cloud connector

But the local openhab-cloud keeps telling me: "Your openHAB is not online. Please check if your installation is running or recheck the openHAB settings in your account"

If I connect the cloud connector to https://myopenhab.org/ (and use exactly the same uuid and secret), it works perfectly.

All I can see in the openhab.log when connecting to the local cloud is:

Disconnected from the openHAB Cloud service

Suggestions would be welcome.

Does host in config.json file contain the FQDN of the external hostname ?

Since it was not working. I have set the domain ${DOMAIN_NAME} to a fixed local ip in both docker-compose.yml, config.json and -of course- in the cloud connector in openhab.

Also, all the docker containers are running on the same (local) machine.

Suggestions about how to debug where the problem is, are welcome.

Have a look at apps.js.
This code snippet might not be taken from the latest release so yours might look different:

if (taskEnv === 'main') {
    setInterval(function () {
        logger.debug('openHAB-cloud: Checking for offline openHABs (' + Object.keys(offlineOpenhabs).length + ')');
        for (var offlineOpenhabUuid in offlineOpenhabs) {
            if (Date.now() - offlineOpenhabs[offlineOpenhabUuid] < 5 * 60 * 1000) {
                continue;
            }
            delete offlineOpenhabs[offlineOpenhabUuid];
            logger.debug('openHAB-cloud: openHAB with ' + offlineOpenhabUuid + ' is offline > 300 sec, time to notify the owner');
            Openhab.findOne({
                uuid: offlineOpenhabUuid
            }).exec(function (error, openhab) {
              if (!openhab || error) {
                  return;
              }
              //if this has not connected to another server, then notify
              if(openhab.serverAddress == internalAddress){
                notifyOpenHABOwnerOffline(openhab);
              }
            });
        }
    }, 60000);
}

You could add additional debug output statements to detect at which step your cloud instance is detected to be offline.
As far as I understand the code if openhab server address is the internal address the code assumes it is offline.

I think mine looks similar to yours. What am I looking for?

if (taskEnv === 'main') {
    setInterval(function () {
        logger.debug('openHAB-cloud: Checking for offline openHABs (' + Object.keys(offlineOpenhabs).length + ')');
        for (var offlineOpenhabUuid in offlineOpenhabs) {
            if (Date.now() - offlineOpenhabs[offlineOpenhabUuid] < 5 * 60 * 1000) {
                continue;
            }
            delete offlineOpenhabs[offlineOpenhabUuid];
            logger.debug('openHAB-cloud: openHAB with ' + offlineOpenhabUuid + ' is offline > 300 sec, time to notify the owner');
            Openhab.findOne({
                uuid: offlineOpenhabUuid
            }).exec(function (error, openhab) {
              if (!openhab || error) {
                  return;
              }
              //if this has not connected to another server, then notify
              if(openhab.serverAddress == internalAddress){
                notifyOpenHABOwnerOffline(openhab);
              }
            });
        }
    }, 60000);
}

btw, my openhabcloud-app logging says

2020-10-20 23:00:39:3939 debug: openHAB-cloud: Checking for offline openHABs (0)
2020-10-20 23:00:39:3939 debug: openHAB-cloud: Checking orphaned rest requests (0)
2020-10-20 23:01:39:3939 debug: openHAB-cloud: Checking for offline openHABs (0)
2020-10-20 23:01:39:3939 debug: openHAB-cloud: Checking orphaned rest requests (0)
2020-10-20 23:02:39:3939 debug: openHAB-cloud: Checking for offline openHABs (0)
2020-10-20 23:02:39:3939 debug: openHAB-cloud: Checking orphaned rest requests (0)
2020-10-20 23:03:39:3939 debug: openHAB-cloud: Checking for offline openHABs (0)
2020-10-20 23:03:39:3939 debug: openHAB-cloud: Checking orphaned rest requests (0)
2020-10-20 23:04:39:3939 debug: openHAB-cloud: Checking for offline openHABs (0)
2020-10-20 23:04:39:3939 debug: openHAB-cloud: Checking orphaned rest requests (0)
2020-10-20 23:05:00:000 info: openHAB-cloud: every5min statistics collection job started
2020-10-20 23:05:00:000 info: openHAB-cloud: every5min statistics collection job finished
2020-10-20 23:05:39:3939 debug: openHAB-cloud: Checking for offline openHABs (0)
2020-10-20 23:05:39:3939 debug: openHAB-cloud: Checking orphaned rest requests (0)
2020-10-20 23:06:39:3939 debug: openHAB-cloud: Checking for offline openHABs (0)
2020-10-20 23:06:39:3939 debug: openHAB-cloud: Checking orphaned rest requests (0)
2020-10-20 23:07:39:3939 debug: openHAB-cloud: Checking for offline openHABs (0)
2020-10-20 23:07:39:3939 debug: openHAB-cloud: Checking orphaned rest requests (0)

I saw this part just now (it’s in the code)

You could add additional debug output statements to detect at which step your cloud instance is detected to be offline.
As far as I understand the code if openhab server address is the internal address the code assumes it is offline.

I was thinking to comment these:

              if(openhab.serverAddress == internalAddress){
                notifyOpenHABOwnerOffline(openhab);
              }

But I can’t, since it is a docker container…