Not seeing the dashboard in my OpenHAB Cloud instance

I have created a cloud instance and connected it to my local OpenHAB system. While I can see that the instance is online, I do not see the dashboard, only a blank page.

Here is what I did in terms of network.
I acquired a domain through Amazon Route 53, and entered openhabcloud.MyDomain.com instead of the dummy names in config.json:

“host”:“openhabcloud.MyDomain.com ”,
“proxyHost”:“home.openhabcloud.MyDomain.com”,

In the nginx default file, I put
server_name openhabcloud.MyDomain.com ;

I also acquired an elastic IP address and routed both openhabcloud.MyDomain.com and home.openhabcloud.MyDomain.com to it.

Any hints would be highly appreciated.

What do the nginx logfiles ( error- and access-log ) show ?

Hi, thanks for responding.
Here is the openhab-cloud-error.log (from /var/log/nginx)

2024/09/13 15:16:37 [error] 7403#7403: *1 connect() failed (111: Unknown error) while connecting to upstream, client: 73.234.97.133, server: openhabcloud.xxx.com, request: "GET /socket.io/?EIO=3&transport=websocket HTTP/1.1", upstream: "http://127.0.0.1:3000/socket.io/?EIO=3&transport=websocket", host: "openhabcloud.xxx.com"
2024/09/13 15:22:12 [error] 7403#7403: *18 open() "/home/ubuntu/openhab-cloud/public/css/app.558876b7e03cd74bcdfd.css" failed (2: No such file or directory), client: 73.234.97.133, server: openhabcloud.xxx.com, request: "GET /css/app.558876b7e03cd74bcdfd.css HTTP/1.1", host: "home.openhabcloud.xxx.com", referrer: "http://home.openhabcloud.xxx
.com/"
2024/09/13 15:22:12 [error] 7403#7403: *16 open() "/home/ubuntu/openhab-cloud/public/js/app.c0769f39a1ba699b096e.js" failed (2: No such file or directory), client: 73.234.97.133, server: openhabcloud.xxx.com, request: "GET /js/app.c0769f39a1ba699b096e.js HTTP/1.1", host: "home.openhabcloud.xxx.com", referrer: "http://home.openhabcloud.xxx.com/"

And here is the openhab-cloud.org-access.log

73.234.97.133 - - [13/Sep/2024:15:16:37 +0000] "GET /socket.io/?EIO=3&transport=websocket HTTP/1.1" 502 178 "-" "okhttp/3.8.1"
185.224.128.83 - - [13/Sep/2024:15:21:31 +0000] "GET / HTTP/1.1" 200 11365 "-" "Go-http-client/1.1"
185.224.128.83 - - [13/Sep/2024:15:21:33 +0000] "GET /cgi-bin/luci/;stok=/locale HTTP/1.1" 404 165 "-" "Go-http-client/1.1"
73.234.97.133 - - [13/Sep/2024:15:21:43 +0000] "GET / HTTP/1.1" 200 3302 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - - [13/Sep/2024:15:21:43 +0000] "GET /bootstrap/css/bootstrap.min.css HTTP/1.1" 200 113732 "http://3.89.171.7/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - - [13/Sep/2024:15:21:43 +0000] "GET /js/jquery.js HTTP/1.1" 200 92629 "http://3.89.171.7/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - - [13/Sep/2024:15:21:43 +0000] "GET /css/layout.css HTTP/1.1" 200 55791 "http://3.89.171.7/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - - [13/Sep/2024:15:21:43 +0000] "GET /bootstrap/js/bootstrap.js HTTP/1.1" 200 64051 "http://3.89.171.7/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - - [13/Sep/2024:15:21:43 +0000] "GET /js-plugin/rs-plugin/js/jquery.themepunch.revolution.min.js HTTP/1.1" 200 53423 "http://3.89.171.7/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - - [13/Sep/2024:15:21:43 +0000] "GET /js/Chart.min.js HTTP/1.1" 200 52091 "http://3.89.171.7/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - - [13/Sep/2024:15:21:44 +0000] "GET /js-plugin/jquery-cookie/jquery.cookie.js?_=1726240903999 HTTP/1.1" 200 1909 "http://3.89.171.7/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - - [13/Sep/2024:15:22:09 +0000] "GET / HTTP/1.1" 401 12 "http://3.89.171.7/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - xxx@gmail.com [13/Sep/2024:15:22:12 +0000] "GET / HTTP/1.1" 304 0 "http://3.89.171.7/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - xxx@gmail.com [13/Sep/2024:15:22:12 +0000] "GET /css/app.558876b7e03cd74bcdfd.css HTTP/1.1" 404 396 "http://home.openhabcloud.xxx.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - xxx@gmail.com [13/Sep/2024:15:22:12 +0000] "GET /js/app.c0769f39a1ba699b096e.js HTTP/1.1" 404 396 "http://home.openhabcloud.xxx.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
73.234.97.133 - xxx@gmail.com [13/Sep/2024:15:22:12 +0000] "GET /res/icons/favicon.svg HTTP/1.1" 304 0 "http://home.openhabcloud.xxx.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
34.145.165.227 - - [13/Sep/2024:15:22:12 +0000] "GET / HTTP/1.1" 401 12 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.197 Safari/537.36"
ubuntu@ip-10-0-1-24:

I am using Chrome Version 128.0.6613.138

Thanks

Kristof

I would HIGHLY suggest you scrub your FQDN IP and e-mail from this post ASAP or you will quickly find it being picked up by public search engines.
Also would be helpful if you wrapped your log in code fences use the </> button

Thanks. Hadn’t thought of this. :frowning:

Since I could connect to the instance from myopenhab.org, and since I can see it is online, I don’t think the problem is on the side of my local instance. I am not sure why the ‘upstream connection’ should fail, and I am not sure what other logs to look at. If anyone has a running OpenHAB Cloud instance, could they share their configuration?
Thanks.

My configuration is stored in post Not able to access openHAB home dashboard on custom openHAB cloud instance - #6 by Wolfgang_S

Thanks, I will try this out. So I need to start 2 copies of app.js and add all the additional proxy info to config.js?

That is how it is working for me and based on the feedback also for others that replied in that thread. There is one or there are two more threads in which I appended this configuration resp. linked to that thread.
In the past the proxy host had to start with the word home. It is also served by apps.js.

Do you replace the default file in sites-enabled with the conf file (as per the instructions in GitHub), or the nginx.conf file? Does it matter?
Thanks!

Also, I am getting the following error.

2024/09/19 17:20:31 [error] 4399#4399: *1 upstream timed out (110: Unknown error) while connecting to upstream, client: 73.234.97.133, server: openhabcloud.>
2024/09/19 17:22:31 [error] 4399#4399: *3 upstream timed out (110: Unknown error) while connecting to upstream, client: 73.234.97.133, server: openhabcloud.>
2024/09/19 17:24:31 [error] 4399#4399: *5 upstream timed out (110: Unknown error) while connecting to upstream, client: 

I am using the modified nginx file (For test purposes, I am using http).
nginx-mydomain.conf.txt (7.1 KB)

It is an additional file:

ls -ld /etc/nginx/sites-enabled/nginx-openhabcloud-lb.conf 
lrwxrwxrwx 1 root root 53 Feb 19  2022 /etc/nginx/sites-enabled/nginx-openhabcloud-lb.conf -> /etc/nginx/sites-available/nginx-openhabcloud-lb.conf

Could mean that nothing is running on the target port ( 3000, 3001 ).
Checkt it with

netstat -tulpn

Needs to show

tcp6       0      0 :::3000                 :::*                    LISTEN      957/node            
tcp6       0      0 :::3001                 :::*                    LISTEN      958/node

on the host where app.js is running.

Yes, you were right, the apps were not running. I should have checked this. I seem to have a problem with the service scripts. I am getting the following error (starting app.js manually with ‘sudo nohup node app.js’ works.

ep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]: internal/modules/cjs/loader.js:818
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:   throw err;
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:   ^
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]: Error: Cannot find module 'node:path'
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]: Require stack:
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]: - /home/ubuntu/openhab-cloud/system/index.js
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]: - /home/ubuntu/openhab-cloud/logger.js
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]: - /home/ubuntu/openhab-cloud/app.js
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at Function.Module._load (internal/modules/cjs/loader.js:667:27)
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at Module.require (internal/modules/cjs/loader.js:887:19)
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at require (internal/modules/cjs/helpers.js:85:18)
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at Object.<anonymous> (/home/ubuntu/openhab-cloud/system/index.js:3:14)
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at Module._compile (internal/modules/cjs/loader.js:999:30)
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at Module.load (internal/modules/cjs/loader.js:863:32)
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:     at Module.require (internal/modules/cjs/loader.js:887:19) {
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[9403]:   code: 'MODULE_NOT_FOUND',
Sep 20 19:03:17 ip-10-0-1-24 openhabcloud[94

I am using the following modification of your script:

[Unit]
Description=node.js openhab cloud server www process #(no disconnect notices/socket management)

[Service]
User=root
Group=root
LimitNOFILE=300
Environment=NODE_ENV=production
Environment=TASK=web
Environment=PORT=3001
Environment=HOST=192.168.0.19
#Environment=DEBUG=oath2orize
Restart=always
RestartSec=10                       # Restart service after 10 seconds if node service crashes
StandardOutput=syslog               # Output to syslog
StandardError=syslog                # Output to syslog
SyslogIdentifier=openhabcloud
WorkingDirectory=/home/ubuntu/openhab-cloud
ExecStart=/usr/bin/node --max-old-space-size=8192 /home/ubuntu/openhab-cloud/app.js
[Install]
WantedBy=multi-user.target or paste code here

I changed the user and group, the HOST variable to the IP address of my local OpenHAB instance and the path. Where did I go wrong?
Thanks.

The problem is with

it means it cannot find that npm module.

Which nodejs version do you use ?

Thanks a lot. I am using v14.21.3, I had problems with more recent versions earlier. Strangely enough, I am not seeing such problems when I am calling app.js directly, not through a service. As a bypass, I started app.js, and another copy setting PORT=3001, and for both HOST=192.168.0.19 (my local OpenHAB). I verified that both are running and listening on their respective ports. I am still not seeing the dashboard. So I guess I still have some other problems, besides the scripts.
,

I am using a dedicated user ( openhabcloud ) to start the service. That user has the node_modules directory with the related modules. I would assume that that directory is being used - but is it used as well if you use root as service account ?

anything in the logfiles ?

Thanks again. I changed the user to ubuntu. Now the scripts work, but still no dashboard.
The access log shows multiple entries of:

73.234.97.133 - - [21/Sep/2024:18:34:11 +0000] "GET /socket.io/?EIO=3&transport=websocket HTTP/1.1" 502 178 "-" "okhttp/3.8.1"
ubuntu@ip-10-0-1-24:/var/log/nginx$ 

The error log has:

2024/09/21 18:34:11 [error] 463#463: *23 connect() failed (111: Unknown error) while connecting to upstream, client: 73.234.97.133, server: openhabcloud.xxx.com, request: "GET /socket.io/?EIO=3&transport=websocket HTTP/1.1", upstream: "http://127.0.0.1:3000/socket.io/?EIO=3&transport=websocket", host: "openhabcloud.xxx.com"

Th syslog has
Sep 21 18:34:46 ip-10-0-1-24 openhabcloud[1413]: {"errno":-13,"code":"EACCES","syscall":"open","path":"logs/openhab-cloud-2024-09-21-process-3001.log"}
type or paste code here

For HOST, used the address of my local OpenHAB instance that I am trying to reach, is that correct? 192.168.0.19...
Both processes are up and running an listening on the appropriate ports, so I fear I must have somehow mangled the network setup.

Is there any ‘positive’ log entry in the access log files ?
The 502 in the access log file is the http return code for the related call and means that there was a problem.
Could it be that you have a mixture of using ip address 127.0.0.1 and ip-10-0-1-24 ?
It is possible to use 127.0.0.1 as long as the related service is hosted on the same host/computer. In case the service is running on a different computer the network address needs to be used instead of the localhost ip address.

I finally solved my problems. I was using 192.X.X.X as the address and should have used 127.0.0.1 instead. I used a conf file separating socketapp and webapp. It works with two instances of app.js listening on ports 3000 and 30001 (thanks again), but it also works with only one copy of app.js listening on port 3000. Here is the conf file I used for nginx for one copy.

# Used localhost as server, started 1 instance of app.js with port 3000 (works also with changing one port to 3001 and two instances of app.js listening)
#ssl_certificate /etc/letsencrypt/live/myopenhab.org/fullchain.pem;
#ssl_certificate_key /etc/letsencrypt/live/myopenhab.org/privkey.pem;

upstream webapp {
        #server 192.168.0.19:3000;
        server 127.0.0.1:3000;
}

upstream socketapp {
        #server 192.168.0.19:3001;
        server 127.0.0.1:3000;
}

#server {
#    listen 80 default_server;
#    listen [::]:80 default_server;
#    server_name myopenhab.org www.myopenhab.org home.myopenhab.org;
#    return 301 https://$server_name$request_uri;
#}

server {
    listen 80;
    server_name home.openhabcloud.xxx.com;

    charset utf-8;

    access_log /var/log/nginx/home.openhabcloud.xxx.com-access.log;
    error_log /var/log/nginx/home.openhabcloud.xxx.com-error.log;
    client_max_body_size 300m;

    root /var/www/html;

    location ~ /.well-known {
      allow all;
    }

    location / {
        proxy_pass http://socketapp;
        proxy_redirect off;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Real-IP $remote_addr ;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
        proxy_set_header X-Forwarded-Proto https;
    }
}
server {
    listen 80;
    server_name openhabcloud.xxx.org;

    charset utf-8;

    access_log /var/log/nginx/my.openhab.org-access.log;
    error_log /var/log/nginx/my.openhab.org-error.log;
    client_max_body_size 300m;

    root /var/www/html;

    location ~ /.well-known {
      allow all;
    }

location /css {
    alias  /home/ubuntu/openhab-cloud/public/css;
    }
location /js {
    alias /home/ubuntu/openhab-cloud/public/js;
    }
location /img {
    alias /home/ubuntu/openhab-cloud/public/img;
    }
location /bootstrap {
    alias /home/ubuntu/openhab-cloud/public/bootstrap;
    }
location /font-icons {
    alias /home/ubuntu/openhab-cloud/public/font-icons;
    }
location /fonts {
    alias /home/ubuntu/openhab-cloud/public/fonts;
    }
location /js-plugin {
    alias /home/ubuntu/openhab-cloud/public/js-plugin;
    }
location /downloads {
    alias /home/ubuntu/openhab-cloud/public/downloads;
    }

location ~ ^/(socket.io|rest|images|static|rrdchart.png|chart|openhab.app|WebApp|CMD|cometVisu|proxy|greent|jquery|classicui|ui|basicui|doc|start|icon|habmin|remote|habpanel|ifttt/v1/actions/command){
    proxy_pass http://socketapp;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header X-Real-IP $remote_addr ;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
    proxy_set_header X-Forwarded-Proto https;
}

location / {
    proxy_pass http://webapp;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr ;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
    proxy_set_header X-Forwarded-Proto https;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
#root html;
#}
}
 

I will now start looking at an ssl configuration.
Thanks again.

1 Like