homebridge/homebridge-config-ui-x

hb-service status reporting that homebridge isn't running when it is

NathanJohnNJ opened this issue ยท 2 comments

Describe The Bug

I wasn't sure whether to report this on the main homebridge repo or this one, but I believe the hb-service is part of the config-ui-x. If that's not the case I'm happy for this to be closed and I can report it on the homebridge repo if needed.
Also, this isn't actually causing me any issues since the information I'm getting from the command is incorrect, so my homebridge is still running fine and I can still use everything, its just a small bug I noticed recently that I noticed hadn't been fixed in the last few updates so I thought I would flag it up.
I'm not 100% sure when this started happening, but I suspect it was around the time Bookworm was officially released as that seemed to cause no end of issues for me with other things, but I noticed a couple of days ago that when I run
sudo hb-service status
it is always reporting that Homebridge UI is not running (Screenshot attached). I am running homebridge on a RPi 400 that is running Debian Bookworm, and I followed the official instructions for the installation of homebridge. As such I have the repository added to my sources list so last night I reinstalled homebridge with
sudo apt-get install --reinstall homebridge
to see if that would fix the issue but it didn't. I have been reading through your documentation again today and have noticed that on the list of commands given for a Debian install of homebridge, 'hb-service status' isn't actually listed along with the others ('start, stop, restart, logs, etc..), so I'm wondering whether it has been removed from this type of setup? It is still reported in the command line though when you run 'sudo hb-service' for the usage information (Second screenshot attached).
I should also mention I am currently running the latest beta versions of both homebridge and hombridge-config-ui-x, so I thought it might just be an issue with one of those. However when I did my reinstall last night, it put me back on the latest official release of both so I ran the command then with the same output, before switching back to both beta's and trying the command again (with the same output again).
As I said, it's not causing me any issues myself and the rest of the commands seem to be working, as is the rest of my homebridge installation, but I just wanted to flag it up. I've been using homebridge for years now on a few different platforms over the years and I absolutely love it, so keep up the good work guys! I've also been using the beta versions for as long as I can remember and never given any feedback, so I thought it might be about time I made myself useful and reported something.
Let me know if you need any further information from me to help with this, and Happy New Year to everyone ๐Ÿ˜ !!

hb-service-status
hb-service

Logs

HomeKitPi:~:% sudo hb-service status
โ„น Testing hb-service is running on port 8581...
โœ– Homebridge UI Not Running

Config

{
    "bridge": {
        "name": "Homebridge ****",
        "username": "**:**:**:**:**:**",
        "port": *****,
        "pin": "***-**-***",
        "bind": [
            "eth0",
            "wlan0"
        ],
        "advertiser": "resolved"
    },
    "platforms": [
        {
            "name": "My Homebridge",
            "port": 8581,
            "auth": "form",
            "theme": "dark-mode-grey",
            "temp": "/sys/class/thermal/thermal_zone0/temp",
            "tempUnits": "c",
            "lang": "auto",
            "sudo": true,
            "sessionTimeout": 86400000,
            "ssl": {
                "key": "/var/lib/homebridge/certs/privkey.pem",
                "cert": "/var/lib/homebridge/certs/fullchain.pem"
            },
            "linux": {
                "shutdown": "sudo shutdown",
                "restart": "sudo reboot"
            },
            "scheduledBackupPath": "/home/homebridge/homebridgeBackups",
            "platform": "config"
        },
        {
            "name": "TuyaWebPlatform",
            "options": {
                "platform": "tuya"
            },
            "defaults": [
                {
                    "device_type": "light",
                    "min_brightness": "0",
                    "max_brightness": "1100",
                    "light_characteristics": [
                        "Brightness"
                    ]
                },
                {
                    "device_type": "light",
                    "min_brightness": "0",
                    "max_brightness": "1100",
                    "light_characteristics": [
                        "Brightness"
                    ]
                },
                {
                    "device_type": "light",
                    "min_brightness": "0",
                    "max_brightness": "1100",
                    "light_characteristics": [
                        "Brightness",
                        "Color"
                    ]
                },
                {
                    "device_type": "light"
                },
                {
                    "device_type": "light",
                    "min_brightness": "0",
                    "max_brightness": "1100",
                    "light_characteristics": [
                        "Brightness",
                        "Color"
                    ]
                },
                {
                    "device_type": "light",
                    "min_brightness": "0",
                    "max_brightness": "1100",
                    "light_characteristics": [
                        "Brightness",
                        "Color"
                    ]
                },
                {
                    "device_type": "light"
                },
                {
                    "device_type": "light",
                    "min_brightness": "0",
                    "max_brightness": "1100",
                    "light_characteristics": [
                        "Brightness",
                        "Color"
                    ]
                },
                {
                    "device_type": "light"
                },
                {
                    "device_type": "light"
                },
                {
                    "device_type": "light"
                },
                {
                    "device_type": "light",
                    "min_brightness": "0",
                    "max_brightness": "1100",
                    "light_characteristics": [
                        "Brightness"
                    ]
                },
                {
                    "device_type": "light"
                },
                {
                    "device_type": "outlet"
                },
                {
                    "device_type": "light",
                    "min_brightness": "0",
                    "max_brightness": "1100",
                    "light_characteristics": [
                        "Brightness"
                    ]
                },
                {
                    "device_type": "light",
                    "min_brightness": "0",
                    "max_brightness": "1100",
                    "light_characteristics": [
                        "Brightness"
                    ]
                },
                {
                    "device_type": "outlet"
                }
            ],
            "scenes": false,
            "hiddenAccessories": [],
            "_bridge": {},
            "platform": "TuyaWebPlatform"
        },
        {
            "options": {
                "lang": "en",
                "projectType": "2",
                "valve": [
                    {
                        "isActive": true
                    }
                ],
                "motion": [
                    {
                        "overrideTuya": 0
                    }
                ],
                "ignoreDevices": [],
                "debug": false
            },
            "name": "TuyaPlatform",
            "_bridge": {},
            "platform": "TuyaPlatform"
        },
        {
            "name": "TuyaIR",
            "deviceRegion": "eu",
            "smartIR": [
                {
                    "autoFetchRemotesFromServer": false,
                    "configuredRemotes": [
                        {
                            "diy": true,
                            "model": "Tower Fan",
                            "brand": "Honeywell"
                        },
                        {
                            "model": "TV",
                            "brand": "LG"
                        }
                    ]
                }
            ],
            "platform": "TuyaIR",
            "_bridge": {}
        }
    ],
    "accessories": [
        {
            "accessory": "http-motion-sensor",
            "name": "Bedroom Motion Sensor",
            "port": ****,
            "_bridge": {}
        }
    ],
    "disabledPlugins": [
        "homebridge-dummy",
        "homebridge-dummy-radio-switch"
    ]
}

Homebridge UI Version

v4.54.2-beta.79

Homebridge Version

v1.7.1-beta.21

Node.js Version

v20.10.0

Operating System

Ubuntu / Debian (or a variant)

Environment Info

  • Using Docker?
  • Using Hyper-V?
  • Using hb-service?

Raspberry Pi Model

Other (specify in description)

Under the covers homebridge-config-ui-x is running a very simple command to determine if the homebridge UI is running -

const res = await axios.get(`http://localhost:${this.uiPort}/api`);

You can emulate this from the command line with curl http://localhost:8581/api

In my case this is what I see from the command line

homebridge@jesse:/var/lib/homebridge $ hb-service status
โ„น Testing hb-service is running on port 8581...
โœ” Homebridge UI Running

homebridge@jesse:/var/lib/homebridge $ curl http://localhost:8581/api
Hello World!homebridge@jesse:/var/lib/homebridge $ 

Ah, the curl command returns an error for me. I've enabled SSL/TLS so it can't be reached over http anymore. I would suggest an edit to the command so it can adapt for those using SSL/TLS, but my error is down to my cert only being valid for my domain, not localhost. Not sure if that's something that could be worked into the config at all so you can specify your custom domain and the command would update with either http/https and custom domain. Something like...

let domain, url;
(!customDomain) ? domain = "localhost" : domain = ${customDomain};
(!tls) ? url = `http://${domain}:${this.uiPort}/api`: url = `https://${domain}:${this.uiPort}/api`;
const res = await axios.get(url); 

But in the grand scheme of things this is probably very insignificant ๐Ÿ˜… I'll get this closed now, have a play with my own set up regarding implementing a check for that command, probably break everything a few times, and then maybe one day the opportunity will arise for me to share it with someone haha!

Thanks very much for the reply and nod in the right direction anyway @NorthernMan54, it's much appreciated!