-
Notifications
You must be signed in to change notification settings - Fork 65
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-service update-node issue: Stops homebridge from starting. #106
Comments
Same problem with me. Fresh install from homebridge-raspian-image and then sudo apt update && sudo apt upgrade -y and then updating nodejs with hb-config and this error occurs. |
Confirming this as well. The issue seems it might be related to this (note: I'm at work and can't test to confirm). My logs were not clear on specifics. Nonetheless, might be a good idea for someone to look into. I was able to recover my config from auto-backups. After running Also this image hasn't been updated to node v18.5 yet, so the highest node version included in this dist is v18.13. |
Same thing just happened to me ... grr.. but |
@moodler I think that should get you into working state again. With node 18.13.0. Then do NOT do a Wait for a fix or an updated homebridge apt package. I’m actually not sure if this bug is something with the image, or config-ui-x or homebridge itself. |
I had the same issue as well, using sudo hb-service update-node do not start homebridge after that, I try then sudo hb-service update-node 18.13 and it give me permission errors : |
Many thanks, pponce removing/installing did the trick. Sadly, even though I also restored all my old backup config on top afterwards, my Home app lost all memory of the many many customisations I had made (83 accessories to rename/style in 25 rooms, so I had to do that again. But that's Home Life :) |
@moodler recommend the “controller” app, @rionshin I’ve tried also going back to older node versions after updating to 18.15.0 using update-node. But it never worked for me. I think the first time you run he-service update-node it messes up the homebridge install or at least the node environment settings in some way. Going back does not fix it for me. |
You bloody legend - well worth it! |
@pponce I performed the same steps you listed and could NOT recreate your issue On MacOS Monterey on a MacBook Pro with the M1, I flashed a 64GB SD card with RPI Imager 1.7.4, Homebridge RPI Image 2022-11-10 My RPI is connected to a monitor/keyboard and ethernet, and I just needed to select keyboard ( English US ), and set a password for the PI account. I then SSH'd into the pi
Then
The only difference being that 18.16 is current as of April 12 |
@NorthernMan54
Steps i just took to update node:
Is there a reason you wait 15 minutes after an apt-get dist-upgrade? |
I just ran This was very repeatable for me as i must have done the fresh image install 4-5 times before finally just giving up and staying on 18.13.0.
Any ideas for me to try and troubleshoot? |
@NorthernMan54 |
@pponce I'm wondering if the node upgrade that got corrupted some how, or if the copy on the internet that you are downloading is being corrupted. The actual update process under the covers is pretty straight forward, it downloads a copy of nodejs from nodejs.org, then extracts ( untar ) it into the homebridge directory structure. The other possibility could be a SD card failing or ??? |
One question , is there 64bit image for Homebridge for Raspberry , because when I use the tool it always download the 32bit version . |
@rionshin There is no 64 bit image for homebridge, only 32 bit |
For the folks with the issue, can you share what uname -m returns ie this is from one of my older RPI4's
We think we may have identified the trigger ( a recent OS update changed what is returned from uname -m ), and am looking for data to confirm |
@NorthernMan54 quick update.
Then downloaded node to my pi home directory and copied node over to /opt/homebridge/bin
Success! Udpated to latest node 18.16.0 with no issues on homebridge start. My hunch was, similar to what i think you are honing in on above, that the node update command, for me was downloading the wrong nodejs version. It was perhaps downloading V8 node? I installed the homebridge-image so i believe that should be 32bit and should be downloading the V7 version. Here is my uname -m ; cat /etc/os-release output:
|
Cross posting the explanation for the issue. |
Raspberry Pi Model
Raspberry Pi 4 B
Describe The Bug
This issue is happening for me on a bare metal install on rPI 4B from latest homebridge image.
Running into an issue with updating node to 18.15.0
I just installed latest homebridge image from scratch yesterday.
sudo apt-get update
sudo apt-get dist-upgrade
All was good.
I now had node version 18.13.0.
Thats when homebridge would not start.
The update-node command appears to work.
Homebridge at this point wont start.
When i then try and run the update command again.
sudo hb-service update-node
I get this error
/usr/bin/env: ‘node’: No such file or directory
I am able to enter the shell:
Notice the bash error? And also the Node.js version is blank.
When I navigate to
cd /opt/homebridge/bin/
And see directory contents
ls -l
I am able to see that node is present. So I don't understand why the error.Also if it's useful. When installing hombridge via the image. Homebridge appears to run as user pi.
This is all starting from a fresh homebridge image install. So there is no other Nodejs manager that was installed.
I was able to repeat this issue from fresh install many times. I kept thinking I must have done something wrong.
I believe one time during my retry attempts I was able to update to node 18.15.0 successfully. On this one succesful update, I upgraded to it from the hb-service shell, and ran the update-node command. Homebridge worked and was on the latest 18.15.0 node. Subsequently I ran a
sudo apt-get update, sudo apt-get dist-upgrade
series of command, which also updated the homebridge package. That downgraded me to node 18.13.0. Homebridge would still load. So all was good. However after anhb-service update-node
command. Homebridge then would no longer start again. Had the same issues noted above.So i think something happens that messes up the ability to upgrade node via
hb-service update-node
after performing your first os homebridge package update viaapt-get install homebridge
.I'm afraid right now of updating node via hb-service. I've got everything working.
Any ideas what may be going on?
Any ideas on how to recover from the "/usr/bin/env: ‘node’: No such file or directory" error if i were to try and update again?
Thanks for the help!
Logs
No response
The text was updated successfully, but these errors were encountered: