homebridge/homebridge-config-ui-x

HB-Config No longer works after latest update

adavison007 opened this issue · 47 comments

Describe The Bug

HB-Config No longer works after latest update - Nothing happens when typing this command in via SSH

Logs

No response

Config

No response

Homebridge UI Version

Latest

Homebridge Version

Latest

Node.js Version

Latest

Operating System

Official Homebridge Raspberry Pi Image

Environment Info

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

Raspberry Pi Model

None

See discussion in #1912
Kind regards

I'm also still experiencing this issue.

Was able to get homebridge-config-ui-x working again and the web UI is up and running.

But the sudo hb-config command no longer works.

Nothing happens after hitting return.

Super don't want to nuke my whole setup

We can also move discussion of hb-config here @Staubgeborener

Hi all, there have been no changes to hb-config in the 4.54.x versions, and there are no plans to remove it.

It's likely that if you tried to update to 4.54.0 within the first hour or so after its release, then the hb-config service was deleted. A reinstall of homebridge-config-ui-x should get this working again.

Hi all, there have been no changes to hb-config in the 4.54.x versions, and there are no plans to remove it.

It's likely that if you tried to update to 4.54.0 within the first hour or so after its release, then the hb-config service was deleted. A reinstall of homebridge-config-ui-x should get this working again.

That doesn't seem to be true - I've reinstalled (as have dozens of my friends in that other issue) and the binary is still a 1 byte, empty file.

CleanShot 2023-12-08 at 10 15 46

See attached

@jonnyborbs

Mine is

28K -rwxr-xr-x 1 root root 26K Nov 28 13:18 /usr/local/sbin/hb-config

That particular file is not part of home bridge-config-ui-x, and is only part of the homebridge-raspbian-image

The original file is here - https://github.com/homebridge/homebridge-raspbian-image/tree/latest/stage3_homebridge/01-homebridge/files

The one hb-config-new is the current version, and hb-config is a legacy version

Interesting. The fact remains that it was there before this plugin upgrade and is gone now though...

@jonnyborbs Looking at your screen shot, that file was last updated on Dec 2 @ 17:11 local time. Am thinking it has been borked since then. Do you recall making any changes then ?

The original file is here - https://github.com/homebridge/homebridge-raspbian-image/tree/latest/stage3_homebridge/01-homebridge/files

The one hb-config-new is the current version, and hb-config is a legacy version

@NorthernMan54 in that image the file hb-config is 0 lines (0 loc) · 1 Byte
image

@jonnyborbs Looking at your screen shot, that file was last updated on Dec 2 @ 17:11 local time. Am thinking it has been borked since then. Do you recall making any changes then ?

I don't remember doing anything there, no. I haven't logged directly into the box in ages before the trouble yesterday

I also wasn't the only one for whom the file vanished after the UI plugin upgrade yesterday, there were loads of reports of the same

What commands should we run in order to restore hb-config with those files?

@adavison007 I think you might have mistakenly marked this as closed, could you reopen?

Mine also stopped working after the UI update yesterday.... no error when running, nothing simply happens after typing the command in.

You got it :)

What commands should we run in order to restore hb-config with those files?

That would be good to know

I am wondering if this is a packaging and release issue based on the repo you linked @NorthernMan54 - since the hb-config file in that commit is indeed empty, I wonder if the hb-config-new version was not included in the releases.

@jonnyborbs Looking at forensically for a second, what does these commands show on your system ?

pi@homebridge:~ $ ls -lc /usr/local/sbin/hb-config
-rwxr-xr-x 1 root root 26145 Nov 28 13:21 /usr/local/sbin/hb-config
pi@homebridge:~ $ ls -l /usr/local/sbin/hb-config
-rwxr-xr-x 1 root root 26145 Nov 28 13:18 /usr/local/sbin/hb-config

My understanding is that the repository / package is only used when a new homebridge raspbian image is installed onto a SD card, and not used by homebridge-config-ui-x. But we need to look further into why / how the file was truncated

If you are in an emergency situation and need the file back immediately:

  1. Log in to your console
  2. run sudo wget https://raw.githubusercontent.com/homebridge/homebridge-raspbian-image/latest/stage3_homebridge/01-homebridge/files/hb-config-new -O /usr/local/sbin/hb-config-new ; sudo chmod +x /usr/local/sbin/hb-config-new
  3. You can then run sudo hb-config-new to access the utility
  4. Selecting option 8 will update the original file. Do this and exit the utility
  5. Run sudo rm /usr/local/sbin/hb-config-new
  6. You should now have the config utility back as expected

But I still think this is something that should be corrected in a packaged release and not via this method

@NorthernMan54 here you go
CleanShot 2023-12-08 at 11 01 55

Humm, still shows Dec 2nd

What about

pi@homebridge:~ $ ls -l /etc/hb-release 
-rw-r--r-- 1 root root 56 Nov 28 13:18 /etc/hb-release
pi@homebridge:~ $ cat /etc/hb-release
"homebridge/homebridge-raspbian-image-v1.1.2-\(64bit\)"

That is the build image for your homebridge-raspbian image

If you are in an emergency situation and need the file back immediately:

  1. Log in to your console

  2. run sudo wget https://raw.githubusercontent.com/homebridge/homebridge-raspbian-image/latest/stage3_homebridge/01-homebridge/files/hb-config-new -O=/usr/local/sbin/hb-config-new ; sudo chmod +x /usr/local/sbin/hb-config-new

  3. You can then run sudo hb-config-new to access the utility

But I still think this is something that should be corrected in a packaged release and not via this method, which is why I did not replace the existing file in situ

I'm getting this:

image

If you are in an emergency situation and need the file back immediately:

  1. Log in to your console
  2. run sudo wget https://raw.githubusercontent.com/homebridge/homebridge-raspbian-image/latest/stage3_homebridge/01-homebridge/files/hb-config-new -O=/usr/local/sbin/hb-config-new ; sudo chmod +x /usr/local/sbin/hb-config-new
  3. You can then run sudo hb-config-new to access the utility

But I still think this is something that should be corrected in a packaged release and not via this method, which is why I did not replace the existing file in situ

I'm getting this:

image

Sorry mate I had a typo. I updated the command above

Humm, still shows Dec 2nd

What about

pi@homebridge:~ $ ls -l /etc/hb-release 
-rw-r--r-- 1 root root 56 Nov 28 13:18 /etc/hb-release
pi@homebridge:~ $ cat /etc/hb-release
"homebridge/homebridge-raspbian-image-v1.1.2-\(64bit\)"

That is the build image for your homebridge-raspbian image

Here you go again, v different than yours but that is to be expected I think
CleanShot 2023-12-08 at 11 09 02

July 2020 sounds about right for when I would have imaged this initially and it's been upgraded in place ever since.

There's also this potentially related anomaly I reported: homebridge/homebridge-apt-pkg#21

This is probably unrelated. I am zeroing in on pre- or post- install scripts in the UI package

As a side note: I ran the hb-config-new file which I retrieved from the latest commit, and used option 8 - the update this tool.. option, and it retrieved the file from GitHub and replaced the original hb-config file as expected.

So I still really think there is some pre- or post- install script that is not properly instantiating the new version as part of the UI package upgrades.

@jonnyborbs Thank you!
hb-config is back up and running.

@jonnyborbs Spent the last while digging thru things, and not seeing a trigger, I even went so far as to grab your version from 2020 and looked for a trigger. Did you see anything ?

@jonnyborbs Spent the last while digging thru things, and not seeing a trigger, I even went so far as to grab your version from 2020 and looked for a trigger. Did you see anything ?

Sorry, I'm not clear what you mean by trigger here. Do you mean an event that could have triggered the update? Only thing I can think of is I had to shut the RPi down for the first time in ages due to some electrical work I was doing around that time.

I was looking for a trigger in the code, that would cause hb-config to be erased / truncated

What date / time do you have for these ?

pi@homebridge:~ $ ls -l /etc/update-motd.d/*
-rwxr-xr-x 1 root root 23 Apr 4 2017 /etc/update-motd.d/10-uname
-rwxr-xr-x 1 root root 353 Nov 28 13:18 /etc/update-motd.d/15-linux
-rwxr-xr-x 1 root root 1532 Nov 28 13:18 /etc/update-motd.d/20-homebridge

@jonnyborbs Thank you! hb-config is back up and running.

What commands did you do to make this happen and did it affect the system running without a rebuild of config?

I was looking for a trigger in the code, that would cause hb-config to be erased / truncated

What date / time do you have for these ?

pi@homebridge:~ $ ls -l /etc/update-motd.d/* -rwxr-xr-x 1 root root 23 Apr 4 2017 /etc/update-motd.d/10-uname -rwxr-xr-x 1 root root 353 Nov 28 13:18 /etc/update-motd.d/15-linux -rwxr-xr-x 1 root root 1532 Nov 28 13:18 /etc/update-motd.d/20-homebridge

CleanShot 2023-12-08 at 11 51 10

@jonnyborbs Thank you! hb-config is back up and running.

What commands did you do to make this happen and did it affect the system running without a rebuild of config?

Scroll up a bit, I posted a step by step

@jonnyborbs Thank you! hb-config is back up and running.

What commands did you do to make this happen and did it affect the system running without a rebuild of config?

Scroll up a bit, I posted a step by step

This? sudo wget https://raw.githubusercontent.com/homebridge/homebridge-raspbian-image/latest/stage3_homebridge/01-homebridge/files/hb-config-new -O=/usr/local/sbin/hb-config-new ; sudo chmod +x /usr/local/sbin/hb-config-new

@jonnyborbs What is in the unattended-upgrades file ?

@jonnyborbs Thank you! hb-config is back up and running.

What commands did you do to make this happen and did it affect the system running without a rebuild of config?

Scroll up a bit, I posted a step by step

This? sudo wget https://raw.githubusercontent.com/homebridge/homebridge-raspbian-image/latest/stage3_homebridge/01-homebridge/files/hb-config-new -O=/usr/local/sbin/hb-config-new ; sudo chmod +x /usr/local/sbin/hb-config-new

Keep scrolling. That is one step and that version has a typo in it.

@jonnyborbs Thank you! hb-config is back up and running.

What commands did you do to make this happen and did it affect the system running without a rebuild of config?

Scroll up a bit, I posted a step by step

This? sudo wget https://raw.githubusercontent.com/homebridge/homebridge-raspbian-image/latest/stage3_homebridge/01-homebridge/files/hb-config-new -O=/usr/local/sbin/hb-config-new ; sudo chmod +x /usr/local/sbin/hb-config-new

Keep scrolling. That is one step and that version has a typo in it.

Don't worry, I'm too scared at trying if I have to pull it together, if you have a moment it would be good for all steps and commands on this response. It would be highly appreciated

@jonnyborbs What is in the unattended-upgrades file ?

It's boring...
CleanShot 2023-12-08 at 11 55 13

@jonnyborbs Thank you! hb-config is back up and running.

What commands did you do to make this happen and did it affect the system running without a rebuild of config?

Scroll up a bit, I posted a step by step

This? sudo wget https://raw.githubusercontent.com/homebridge/homebridge-raspbian-image/latest/stage3_homebridge/01-homebridge/files/hb-config-new -O=/usr/local/sbin/hb-config-new ; sudo chmod +x /usr/local/sbin/hb-config-new

Keep scrolling. That is one step and that version has a typo in it.

Don't worry, I'm too scared at trying if I have to pull it together, if you have a moment it would be good for all steps and commands on this response. It would be highly appreciated

I already did. Keep scrolling.

#1913 (comment)

@jonnyborbs Thank you! hb-config is back up and running.

What commands did you do to make this happen and did it affect the system running without a rebuild of config?

Scroll up a bit, I posted a step by step

This? sudo wget https://raw.githubusercontent.com/homebridge/homebridge-raspbian-image/latest/stage3_homebridge/01-homebridge/files/hb-config-new -O=/usr/local/sbin/hb-config-new ; sudo chmod +x /usr/local/sbin/hb-config-new

Keep scrolling. That is one step and that version has a typo in it.

Don't worry, I'm too scared at trying if I have to pull it together, if you have a moment it would be good for all steps and commands on this response. It would be highly appreciated

I already did. Keep scrolling.

#1913 (comment)

That worked a charm, big thanks :)

@jonnyborbs I have a working theory on what happened with hb-config, and would like your opinion if it makes makes sense.

1 - Back in late November the hb-config file was truncated on the homerbidge-raspbian-image repo. ( This was done as the first step in merging hb-config-new back into hb-config )

2 - In your case on Dec 2, you had ran hb-config and used the update command ( This would have run normally, but it downloaded the blank file and would have broken the file)

3 - Yesterday you tried the command again, and discovered it was missing.

Does this make sense ?

@jonnyborbs I have a working theory on what happened with hb-config, and would like your opinion if it makes makes sense.

1 - Back in late November the hb-config file was truncated on the homerbidge-raspbian-image repo. ( This was done as the first step in merging hb-config-new back into hb-config )

2 - In your case on Dec 2, you had ran hb-config and used the update command ( This would have run normally, but it downloaded the blank file and would have broken the file)

3 - Yesterday you tried the command again, and discovered it was missing.

Does this make sense ?

Everything about it except my not remembering having done this ☹️ .bash_history isn't timestamped in this OS so I can't confirm or deny this concretely, but it sounds plausible enough in the absence of something more verifiable!

Am thinking we can close this, as I think this is the scenario that caused the issue. I did scour the various homebridge component code bases looking for other triggers, but did not see anything. Am thinking that unless something else comes up, we can close this.

Not my issue originally but I agree FWIW, particularly since at least two other folks besides me used my workaround above successfully. Thanks for all the help!

Thanks for everyone’s support, now closing