marcoraddatz / homebridge-docker

Dockerized Homebridge. No plugins pre-defined, hassle-free setup. Read instructions!
Apache License 2.0
128 stars 47 forks source link

homebridge command not found #12

Closed nicx closed 7 years ago

nicx commented 7 years ago

hi, I just restarted my Synology after a few weeks and homebridge is no more working. I diddnt do any changes, it have been working foor some months now. In the logfile of the container I can see:

/root/run.sh: line 69: homebridge: command not found stdout 06:56:11 Logged in as: stdout 06:56:11 root stdout 06:56:11 /root/.homebridge/.env not found. stdout 06:56:11 Default env variables will be used. stdout 06:56:11 Updating Homebridge.

This is repeated every time after the homepridge plugin installation succeeded, so the starting process is in an endless loop.

what could i do?

udochrist commented 7 years ago

Same here. Restarted and suddenly homebridge command not found.

i used a terminal to do a npm install homebridge to understand whats going on and get the following output

root@six:~# npm install homebridge                                                                                       
/root                                                                                                                    
`-- homebridge@0.4.17                                                                                                    

npm WARN enoent ENOENT: no such file or directory, open '/root/package.json'                                             
npm WARN root No description                                                                                             
npm WARN root No repository field.                                                                                       
npm WARN root No README data                                                                                             
npm WARN root No license field.        

all CXX builds have succeeded, no error from the compilation of dns_sd and ed25519. the homebridge command is nowhere on the path. It is contained in node_modules/homebridge/bin.

as a quick fix i have edited the run.sh and added a

PATH=/root/node_modules/homebridge/bin
export PATH

before the start and the container starts

marcoraddatz commented 7 years ago

I'm currently not at home, so cannot test changes, but as I can see, there's a new Homebridge version (0.4.17). Maybe the auto-update did crash the plugin. Will have a closer look soon.

Firehed commented 7 years ago

Seems likely given my previous experiences with Homebridge in general. Perhaps it would be better to use explicit versions (at least for tagged builds, maybe not latest) instead of auto-updating - it should result in a much more predictable image.

benzman81 commented 7 years ago

@marcoraddatz I added the following lines before the Homebridge auto update. This fixed issues with homebridge 0.4.17 as it needed an update of HAP-nodejs.

# Updating HAP-nodejs echo "Updating HAP-nodejs." npm update -g hap-nodejs

marcoraddatz commented 7 years ago

Thanks, @benzman81. Will provide an update on Wednesday which might include that fix.

@Firehed The package used explicit binding until October last year. When Apple updated iOS, previous versions broke. I then decided to implement an auto-update to avoid those problems, but now Homebridge updates seem to break the system, too. No matter what I'll do: Homebridge will always be experimental 😉

I currently think on adding a variable to let users decide whether they want to use the auto-update or not. Also, I might add a second variable where the Homebridge version can be set explicitly.

Demonderik commented 7 years ago

Also, I might add a second variable where the Homebridge version can be set explicitly. That would be perfect! We need the option to rollback stable version.

Now I am still without homebridge - new hap-nodejs incompatible with hombridge-knx plugin...

deadbone commented 7 years ago

good to see I'm not alone :) @marcoraddatz : yes it's experimental and you've got a lot of followers :)

deadbone commented 7 years ago

no luck for me with the bendman81's fix. 👍

But it seems the command "npm update -g hap-nodejs" is not used (and I don't understand why)

Updating HAP-nodejs

echo "Updating HAP-nodejs." npm update -g hap-nodejs

Update Homebridge

echo "Updating Homebridge." npm update -g homebridge

So I commented the command "npm update -g homebridge" and it's now working for me

PS : i'm using the latest image downloaded today

Demonderik commented 7 years ago

deadbone, glad it works for you, but what file you changed? and how? I tried to add "npm update -g hap-nodejs" line to install.sh, but it cause even more problems.

Thanks!

deadbone commented 7 years ago

first,

I created a new container with the image you had previously downloaded

you configure the new container (I use the same settings, the same folder than the older one) and you DON'T start it.

Then

on a computer, ssh to your NAS (obviously, you replace the names between <> by yours sudo docker cp :/root/run.sh /volume1/

sudo vi /volume1//run.sh

Then

you comment the line

echo "Updating Homebridge."

npm update -g homebridge

After that :

sudo docker cp /volume1//run.sh :/root/

And now you can start your container

2 Things :

I'm new on docker, so maybe it's not the best way to do that

Putting extra commands in the install.sh is not the best way, because it's specific to homebridge. That's why there is a script run.sh called before the home bridge's launch

Hope I can help you :)

Demonderik commented 7 years ago

deadbone, thanks a lot! Absolutely clear explanation. Will try today.

marcoraddatz commented 7 years ago

A few moments ago I pushed a new release to the Docker queue with some bigger changes: The auto-update has been removed to avoid future breaks and has been replaced with an explicit version binding. Even though, it might not be the most elegant solution, the pre-installed version can now be updated via env variable.

Version 0.4.17 is now pre-installed on latest, develop and 2.2.

Demonderik commented 7 years ago

Marco, Version 2.2 runs fine! Thank you.

Though it still not saves me - homebridge-knx plugin now crashes during eibd parsing if I try to control my devices. But this is another story...

deadbone commented 7 years ago

Marco 👍

Demonderik commented 7 years ago

JFYI : Developers just fixed node eibd implementation. With eibd v0.3.9 homebridge-knx works now on node > v6.2.0!