Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HB-Config No longer works after latest update #1913

Closed
3 tasks
adavison007 opened this issue Dec 7, 2023 · 47 comments
Closed
3 tasks

HB-Config No longer works after latest update #1913

adavison007 opened this issue Dec 7, 2023 · 47 comments
Labels

Comments

@adavison007
Copy link

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

@adavison007 adavison007 added the bug label Dec 7, 2023
@JurgenLB
Copy link

JurgenLB commented Dec 7, 2023

See discussion in #1912
Kind regards

@town3r
Copy link

town3r commented Dec 8, 2023

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

@jonnyborbs
Copy link

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

@bwp91
Copy link
Contributor

bwp91 commented Dec 8, 2023

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.

@jonnyborbs
Copy link

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.

@jonnyborbs
Copy link

CleanShot 2023-12-08 at 10 15 46

See attached

@NorthernMan54
Copy link
Contributor

@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

@NorthernMan54
Copy link
Contributor

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

@jonnyborbs
Copy link

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

@NorthernMan54
Copy link
Contributor

@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 ?

@JurgenLB
Copy link

JurgenLB commented Dec 8, 2023

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
Copy link

jonnyborbs commented Dec 8, 2023

@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

@jonnyborbs
Copy link

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

@town3r
Copy link

town3r commented Dec 8, 2023

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

@jonnyborbs
Copy link

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

@adavison007
Copy link
Author

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

@adavison007 adavison007 reopened this Dec 8, 2023
@jonnyborbs
Copy link

You got it :)

@adavison007
Copy link
Author

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

That would be good to know

@jonnyborbs
Copy link

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.

@NorthernMan54
Copy link
Contributor

@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

@jonnyborbs
Copy link

jonnyborbs commented Dec 8, 2023

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

@jonnyborbs
Copy link

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

@NorthernMan54
Copy link
Contributor

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

@town3r
Copy link

town3r commented Dec 8, 2023

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

@jonnyborbs
Copy link

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

@jonnyborbs
Copy link

jonnyborbs commented Dec 8, 2023

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.

@jonnyborbs
Copy link

jonnyborbs commented Dec 8, 2023

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

@jonnyborbs
Copy link

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.

@town3r
Copy link

town3r commented Dec 8, 2023

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

@NorthernMan54
Copy link
Contributor

@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
Copy link

@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.

@NorthernMan54
Copy link
Contributor

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

@adavison007
Copy link
Author

@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?

@jonnyborbs
Copy link

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
Copy link

jonnyborbs commented Dec 8, 2023

@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

@adavison007
Copy link
Author

@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

@NorthernMan54
Copy link
Contributor

@jonnyborbs What is in the unattended-upgrades file ?

@jonnyborbs
Copy link

@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.

@adavison007
Copy link
Author

@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
Copy link

@jonnyborbs What is in the unattended-upgrades file ?

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

@jonnyborbs
Copy link

jonnyborbs commented Dec 8, 2023

@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)

@adavison007
Copy link
Author

@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 :)

@NorthernMan54
Copy link
Contributor

@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
Copy link

@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!

@NorthernMan54
Copy link
Contributor

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.

@jonnyborbs
Copy link

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!

@adavison007
Copy link
Author

Thanks for everyone’s support, now closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants