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

Homebridge-nest crashing homebridge (this just started happening) #106

Closed
leoneleone opened this issue Jan 4, 2017 · 32 comments
Closed

Comments

@leoneleone
Copy link

/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/websocket_extensions.js:133
this._pipeline.processIncomingMessage(message, callback, context);
^

TypeError: Cannot read property 'processIncomingMessage' of undefined
at Extensions.processIncomingMessage (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/websocket_extensions.js:133:19)
at Client._emitMessage (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:442:22)
at Client._emitFrame (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:405:19)
at Client.parse (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:144:18)
at Client.parse (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/client.js:56:58)
at IO.write (/usr/local/lib/node_modules/homebridge-nest/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/streams.js:80:16)
at TLSSocket.ondata (_stream_readable.js:555:20)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at TLSSocket.Readable.push (_stream_readable.js:134:10)
at TLSWrap.onread (net.js:543:20)

@rglink
Copy link

rglink commented Jan 4, 2017

+1 got the exact same issue. Looks like an issue communicating with Nest. Did they change the API, or is API not working properly?

@leoneleone
Copy link
Author

I think it must've been something going on with the Nest servers. Seems to have corrected itself now. Homebridge started running again 👍🏼

I hadn't changed anything at all.
Possibly best to close this issue as it was an issue on the Nest-end rather than the plugin 🙂

@leoneleone
Copy link
Author

Closing

@leoneleone
Copy link
Author

Ok. So this has started happening again today 😔

@leoneleone leoneleone reopened this Jan 7, 2017
@leoneleone
Copy link
Author

Anyone else seeing this error?
What is going on with the Nest servers?!

This is quite frustrating

@tsm4sh
Copy link

tsm4sh commented Jan 7, 2017

all good for me...I'm set up with a gen1 Nest Thermostat, gen1 Protect, new Cam, and the new api without any issues.

@leoneleone
Copy link
Author

@tsm4sh
Thanks for letting me know 🙏
I'll have to check my setup to find out what's going on.

@tsm4sh
Copy link

tsm4sh commented Jan 7, 2017

@leoneleone, I suggest removing/uninstalling the Nest plugin and any other plugins you may have installed, then uninstall homebridge as well, and reinstall homebridge and the plugins. I had to do that at one point when I started messing with all this stuff and it seemed to clear out some gremlins.

Note: I'm also running v6.9.4 of Node.js, on macOS Sierra, not the newer v7.4.0. I'm also using the newest versions of the Nest APIs, which are newer/different than the ones outlined in the installation instructions.

@davidtennant8082
Copy link

Not sure what I was running when the issue arises as I haven't updated anything since I got homebridge working.

Nuked everything this morning to troubleshoot and installed from scratch and issue. Removed all but login and password from the config file to fall back on legacy API. Have nothing else running on Homebridge other than 1 nest thermostat.

@tjq100
Copy link

tjq100 commented Jan 7, 2017

I've got the same thing. Been fine till today.

@rglink
Copy link

rglink commented Jan 8, 2017

Yep, not working anymore.

@leoneleone
Copy link
Author

@tsm4sh
Thanks for the advice.
I've removed homebridge from my HomeKit Configuration. Will try and complete reinstall tomorrow.
I'm running Node 6.6.0 so might upgrade that.

This has happened to me once before, and hours later homebridge starting working again. That's why I suspect it's an issue happening with the Nest servers rather than homebridge itself.

Will let you know if anything works out.

@leoneleone
Copy link
Author

@rglink @tjq100
You might want to try just leaving it be without any tinkering to see if the problem corrects itself. Frustrating I know. Just shows how HomeKit functions quickly become part of the daily routine. Once that's broken things seem far more cumbersome.
First world problems ultimately 😬

Let me know if anything changes guys.

@randyinla
Copy link

This is also the 2nd time this has happened to me and it is still not working, so I removed homebridge-nest from my homebridge config.js file.

Maybe the nest plugin could add some error handling to the processIncomingMessage function to deal with an undefined response rather than crashing and causing homebridge to quit? Would be much nicer to sense an undefined response and simply put something in the output log. That way, all of my other homebridge devices still work.

@alexandrupaulpopa
Copy link

alexandrupaulpopa commented Jan 8, 2017 via email

@ghost
Copy link

ghost commented Jan 8, 2017

lol, another reminder to check git first :)
I removed / reinstalled all files.. did not work

@PencilDH
Copy link

PencilDH commented Jan 8, 2017

Hey Guys, this seems to be happening to quite a free people, does anyone understand the underling issue or debugged it?

If we are sure this is a Nest issue we should report it to Nest as we are developers to be looked at?! there is more than 10~20 people with the same issue that happens intermitently.

As suggest @Muzach on another issue #107 the script should also be made more robust to handle this errors rather than crashing

I can also confirm that removing token from the .json and falling back to legacy API worked for me

@rglink
Copy link

rglink commented Jan 8, 2017

I agree on the error processing part, but haven't had the time to reply.

Very much looks like a communication issue since the issue occurs in the pipeline incoming message from nest. Also since the issue sometimes resolves itself doesn't make it a clear scripting issue.

Looking forward to how this thread evolves...

@conradhagemans
Copy link

For now I removed the Nest platform in config.json of Homebridge. Homebridge runs again fine.
Hopefully there will be an update of the NPM Nest module.

@pmvrmc
Copy link

pmvrmc commented Jan 9, 2017

I am having the same issue, I hope they fix it soon...

@rtoohil
Copy link

rtoohil commented Jan 11, 2017

For what it's worth, I don't think I would have closed this. The issue is still open -- without code fixes, the plugin doesn't work.

I'm still hoping I can find a few minutes to test out changing to a newer version of firebase (which will pull in a newer version of the websocket plugin), which I think we've shown does fix the issue. I'm just not sure if there are breaking/non-backwards compatible changes in the newer version of firebase.

@pmvrmc
Copy link

pmvrmc commented Jan 11, 2017

Unfortunately firebase 3.0 has breaking changes, and 2.X has an outdated version of the "faye-websocketa" dependency.

For more info look into this pull request.

I fixed this issue by having an automated process that goes to the firebase dependency "faye-websocketa" and changes its package.json to use version of "websocket-driver" >=0.5.4.

I hope this helps!

@rtoohil
Copy link

rtoohil commented Jan 11, 2017

So, I think given that, it might make sense to use npm shrinkwrap. That'd be a pretty simple commit/pull request, and it should be a reasonable solution in the short-term.

@tekkkon
Copy link

tekkkon commented Jan 12, 2017

yes, nest firebase is not catching up to 3.x and it is using 2.4.x which has dependency on "faye-websocket" -> "[email protected]"

to fix the issue, you need to bump up the "websocket-driver>=0.5.2", using the latest 0.6.5 works for me

@simonrb2000
Copy link

simonrb2000 commented Jan 13, 2017

Mine has stopped working with the fix... Was working until about an hour ago. Now loading Homebridge it stops..

[1/13/2017, 7:35:50 PM] Loaded plugin: homebridge-nest
[1/13/2017, 7:35:50 PM] Registering platform 'homebridge-nest.Nest'
[1/13/2017, 7:35:50 PM] ---
[1/13/2017, 7:35:50 PM] Loaded plugin: homebridge-rasppi-gpio-garagedoor
[1/13/2017, 7:35:50 PM] Registering accessory 'homebridge-rasppi-gpio-garagedoor.RaspPiGPIOGarageDoor'
[1/13/2017, 7:35:50 PM] ---
[1/13/2017, 7:35:50 PM] Loaded config.json with 1 accessories and 1 platforms.
[1/13/2017, 7:35:50 PM] ---
[1/13/2017, 7:35:50 PM] Loading 1 platforms...
[1/13/2017, 7:35:50 PM] Initializing Nest platform...
[1/13/2017, 7:35:50 PM] Fetching Nest devices.
[1/13/2017, 7:35:50 PM] Loading 1 accessories...
[1/13/2017, 7:35:50 PM] [Garage Door] Initializing RaspPiGPIOGarageDoor accessory...
[1/13/2017, 7:35:50 PM] [Garage Door] Door Switch Pin: 4
[1/13/2017, 7:35:50 PM] [Garage Door] Door Sensor Pin: 14
[1/13/2017, 7:35:50 PM] [Garage Door] Door Poll in ms: 4000
[1/13/2017, 7:35:50 PM] [Garage Door] Door Opens in seconds: 20
[1/13/2017, 7:35:50 PM] [Garage Door] Setting state to 1

@rtoohil
Copy link

rtoohil commented Jan 13, 2017

Still works for me -- I've had to restart it once, but that was it.

@leoneleone
Copy link
Author

leoneleone commented Jan 14, 2017

@tekkkon
Glad its working for you. I'm still having problems here.

can you give us some instructions for how you bumped up the "websocket-driver>=0.5.2", using the latest 0.6.5?

It would be great if you submit a pull request with the changes you made which fixed the issue for you.

Thanks man. I think all of us suffering from the issue would appreciate it

@leoneleone
Copy link
Author

leoneleone commented Jan 14, 2017

So everything seems to be working as normal now since updating to the latest version of Homebridge which was published yesterday. I'll have to give it more time to see if the firebase error appears again to be sure.

Can anyone confirm that the latest version of homebridge fixes the issue for them?
If so I could close the issue....

Thanks everyone

@rtoohil
Copy link

rtoohil commented Jan 14, 2017

#109

I don't see why homebridge's update would have fixed the problem.

If you want to test my fix, you could clone the homebridge-nest repo somewhere on your homebridge server, checkout my branch, and then run the plugin in debug mode. Or, copy the npm-shrinkwrap.json over and run npm install.

It'll be easiest if the pull request gets merged in, since that should get it up and running for everyone (I think).

@simonrb2000
Copy link

simonrb2000 commented Jan 14, 2017 via email

@rglink
Copy link

rglink commented Jan 14, 2017

Mine has been working without updating any modules. To overcome the crashing when no correct incoming message is found I created an AppleScript that restarts homebridge once every hour. Also the issue started without any software changes and beforehand mine worked for over a year. So I am not sure that a script needs to be replaced. Only error handling could be better so homebridge doesn't crash. Will the hotfix fix this issue?

@leoneleone
Copy link
Author

@simonrb2000
Thanks for the info.
Yes I agree, there's no logical reason why updating homebridge would fix the firebase/websocket issue. Could just be a coincidence, but I haven't had an issue since updating despite having had to restart homebridge several times today because of a separate internal home networking issue.

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

No branches or pull requests