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

I may have fixed the crashes #124

Open
BetoRn opened this issue Jan 16, 2018 · 64 comments
Open

I may have fixed the crashes #124

BetoRn opened this issue Jan 16, 2018 · 64 comments

Comments

@BetoRn
Copy link

BetoRn commented Jan 16, 2018

This plugin installs version 1.1.6 of harmonyhubjs-client library, later versions have addressed the xmpp errors not beign handled.

So, I installed the latest harmonyhubjs-client version and removed the dependency under homebridge-harmonyhub installation folder, homebridge has been running for a week without issues.

@imsturmdernacht
Copy link

imsturmdernacht commented Jan 17, 2018

Just for the linux beginners.... What is exactly to do? Just install harmonyhubjs-client in version 1.16? How to remove dependencys of homebridge-harmonyhub folder? And finaly: What was your problem? The Error: MAX_CLIENTS=6 or the (XMPP authentication failure)? Does this trick solve both problems?

@michaeldulrich
Copy link

I'd be curious if it continues to stay up for you @BetoRn. I'm currently testing with a forked version where all that's changed is that dependency in packages.json.

@BetoRn
Copy link
Author

BetoRn commented Jan 17, 2018

@imsturmdernacht
for install harmonyhubjs-client:
sudo npm install -g harmonyhubjs-client@latest

for finding homebridge-harmonyhub folder:
npm -g -l | grep harmony

and to remove
sudo rm -r [homebridge-harmonyhub_folder]/node_modules/harmonyhubjs-client

@BetoRn
Copy link
Author

BetoRn commented Jan 17, 2018

@michaeldulrich i'm also curious to see if this works for someone else, or if I just have been lucky.
i'm scared to even look at my pi and cause a crash, another day without crashes so far

@michaeldulrich
Copy link

@BetoRn I've only had it up 3 hours or so in a docker container, but so far no problems.

@imsturmdernacht
Copy link

I'm excited. I made the changes and tried to force the crash. No crashes of the Homebridge yet. I will report again this evening.

@imsturmdernacht
Copy link

imsturmdernacht commented Jan 18, 2018

Now I can definitely say the latest harmonyhubjs-client solves the xmpp issues. Homebridge-harmonyhub works again perfectly. Maybe @KraigM can update the plugins dependencies. Thanks for reporting @BetoRn

@michaeldulrich
Copy link

I'm running this fork - https://github.com/samsymons/homebridge-harmonyhub - where the only change is the harmonyhubjs-client dependency bump and haven't had any problems.

@VeniceNerd
Copy link

Please let this be true! I LOVED this plugin but had to remove it because it destroyed my HomeKit setup several times.

@michaeldulrich can you explain how to install the fork?

@michaeldulrich
Copy link

@VeniceNerd On standard homebridge, it might be best to follow @BetoRn's method.

I'm using https://github.com/oznu/docker-homebridge so I just added "yarn add https://github.com/samsymons/homebridge-harmonyhub" to my startup.sh file, which adds the plugin every time I start the container.

@ToddGreenfield
Copy link

After running/testing for couple of days with the updated harmonyhub-client package I just started seeing the errors show up in my syslog. I had installed the harmonyhub-client (globally), uninstalled the homebridge-harmonyhub plugin, reinstalled the current version (1.1.10), then deleted the harmonyhub-client node directory from within the homebridge-harmonyhub node-modules directory. All was working well for a couple of days then "Error: MAX_CLIENTS=6" again.
@michaeldulrich @BetoRn how is your testing coming along?

@michaeldulrich
Copy link

@ToddGreenfield I do see the "Error: MAX_CLIENTS=6" in my logs a few times, so maybe I'm just lucky that docker is just restarting the container when it errors like that?

I'll keep testing.

@ToddGreenfield
Copy link

I run homebridge as a service on RPI and have it restart automatically on error as well. No docker though. I am seeing it error/crash a few times per day still.

@VeniceNerd
Copy link

So the crashing hasn’t been solved after all? I was so hopeful. :( Is this plug in no longer maintained? I loved it so much but the crashing really messes with my other homebridge plugins. Don’t want to risk that again.

@onefish2
Copy link

I installed samsymons/homebridge-harmonyhub fork and rebooted my Harmony Hub. No crashes in the past few days on a Pi3 running the current version of Raspbian.

Also node-v=v8.9.4
And npm -v=5.6.0

@BetoRn
Copy link
Author

BetoRn commented Jan 22, 2018

I also run homebridge as a service, if it's crashing I haven't noticed. I'll take a look at the logs when i find some time.
Before this, when homebridge crashed it used to take down the hole raspberrypi, that's not happening anymore.

@ToddGreenfield
Copy link

The homebridge instance (running as a service) was still crashing/erroring with xmpp/core/stanza errors, but it doesn't take the whole RPI down with it. If you also run the homebridge-harmonyhub plugin in its own homebridge instance it also will not take everything else out with it, but at least in my case it does continue to error out/crash the instance a couple of times per day.

When using the latest harmonyhubjs-client package, I am still seeing crashing and errors in the syslog. Experimenting further along the lines of using the latest package releases, I updated node-xmpp-client and node-xmpp-stanza the same way. I am no longer seeing the wholesale crashes in the syslog file, but am now seeing the two errors like below. The homebridge service does NOT appear to crash from what I see in the syslogs and the plugin continues to work turning on/off my connected devices - so this is making some progress.

Jan 22 10:00:51 homepi-a homebridge[4144]: errorhub XMPP authentication failure
Jan 22 10:00:51 homepi-a homebridge[4144]: errorhub XMPP authentication failure

I don't have time to research further right now, but will continue to monitor.

@BetoRn
Copy link
Author

BetoRn commented Jan 22, 2018

I think this is expected, here are the release notes for harmonyhubjs-client v1.1.9 it says

xmpp: Handle XMPP error events

It didn't fixed the errors, they are now being handled properly (so it won't crashes).

This library hasn't been updated since octuber 2016, so i think this is as close as we get on stability at least as long as homebridge-harmonyhub continues to use that for comunicating with the hub.

Many nodejs Harmony Hub related projects uses this same library.

@vzlgdu
Copy link

vzlgdu commented Jan 22, 2018

The problem was NOT solved: yestrerday I reinstalled the plugin and in 24h, homebridge has crashed six times always wit the message "MAX CLIENTS"....

@ToddGreenfield
Copy link

Right, I can confirm I am still seeing crashes again. It must have needed to run for a longer period. Unfortunate. I have completely removed all xmpp and harmony related packages. I recall from a while back reading that the older version of this plugin may work without issue - the only draw back is it does not do automatic discovery and the IP of the hub is needed. I will probably start testing that version later this week-

@VeniceNerd
Copy link

Please keep us updated. It’s unfortunate that this plug in keeps crashing homebridge. Really hoping for a solution!

@starlessblack
Copy link

I ran the earlier version for several months. My recollection is that it crashed somewhat less frequently than the newer plugin versions. I just installed the latest plugin and followed the aforementioned tips to mitigate the errors and crashing (the newer harmonyhubjs-client and removing old dependency).

And now I'm bummed to hear it hasn't fixed the crashing after all :-(

The good news is that if you powercycle your Harmony hub once a day (easy to schedule in middle of the night with a smart plug) and schedule Homebridge to restart daily as well (despite running as systemd service with auto-restart, still helps), then it's pretty much bullet proof.

@mensa84
Copy link

mensa84 commented Jan 25, 2018

In earlier versions there was the possibility to add each Harmony Hub separate in the config.json by name and IP address. Maybe this would help I think.

But does anyone know the syntax how to add more hubs separate in config.json and disable auto-discovery. I habe set static DHCP entries for my 2 Harmony Hubs on my router, so the IP addresses of the Hubs will not change.

@starlessblack
Copy link

When I was running the old 0.1.1 version, I explicitly defined the IP address of my hub in config.json--unfortunately, that doesn't help with regard to this bug.

@mensa84
Copy link

mensa84 commented Jan 25, 2018

But this would help at least against the bug of always saying "same UUID" right?
How can I install version 0.1.1?

@starlessblack
Copy link

I don't recall what the "same UUID" bug is--can you give more details on that? To install a different version, just do "sudo npm -g install homebridge-harmonyhub@0.1.1" (or ...@0.2.0 or @latest, etc.)

@mensa84
Copy link

mensa84 commented Jan 25, 2018

That error appears every few hours, cause harmonyhub tried to add one of my two hubs twice and homebridge stops:
`/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:264
throw new Error("Cannot add a bridged Accessory with the same UUID as another bridged Accessory: " + existing.UUID);
^

Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 71560c9f-f148-456f-8f6b-b2775394e008
`

You can't restart homebridge until you remove the accessories directory. But if you do that, you have to re-sort a lot in HomeKit. So that is no solution.

Do you have any plan how to solve that problem?

@starlessblack
Copy link

Oh, so that stems from having multiple hubs—I only have one, so I have experience with it. Perhaps that’s why the plugin’s rewrote the multihub code in later plugin versions. I think you can still define the hubs specifically by IP in the config.json in recent version of the plugin, so maybe you should try that to see if it helps your issue.

@mensa84
Copy link

mensa84 commented Jan 25, 2018

I did try now, but unfortunately I get the message at starting homebridge, that ip addressess are ignored, because now it is using only auto-discovery. and that auto-discovery brings up that problems.

so which is the last version which is running stable with 2 harmony hubs?

@VeniceNerd
Copy link

So I'm currently running the standard configuration of Harmony Hub in a dedicated Docker (to prevent the plugin to take down the rest of my HomeKit Automation) and I'm seeing this error message in my logs:

> errorhub { Error: connect ENETUNREACH 10.0.1.32:5222 - Local (0.0.0.0:0)
>     at Object._errnoException (util.js:1022:11)
>     at _exceptionWithHostPort (util.js:1044:20)
>     at internalConnect (net.js:971:16)
>     at net.js:1065:9
>     at _combinedTickCallback (internal/process/next_tick.js:131:7)
>     at process._tickCallback (internal/process/next_tick.js:180:9)
>   code: 'ENETUNREACH',
>   errno: 'ENETUNREACH',
>   syscall: 'connect',
>   address: '10.0.1.32',
>   port: 5222 }
> errorhub { Error: connect ENETUNREACH 10.0.1.31:5222 - Local (0.0.0.0:0)
>     at Object._errnoException (util.js:1022:11)
>     at _exceptionWithHostPort (util.js:1044:20)
>     at internalConnect (net.js:971:16)
>     at net.js:1065:9
>     at _combinedTickCallback (internal/process/next_tick.js:131:7)
>     at process._tickCallback (internal/process/next_tick.js:180:9)
>   code: 'ENETUNREACH',
>   errno: 'ENETUNREACH',
>   syscall: 'connect',
>   address: '10.0.1.31',
>   port: 5222 }

Is that the error message you guys are seeing? What is the cause of this?

@CASINOS
Copy link

CASINOS commented Jan 30, 2018

If it can help, this the message error an version 03.0-alpha.2

Error: MAX_CLIENTS=6
at Connection.onStanza (/usr/lib/node_modules/homebridge-harmonyhub/node_modules/node-xmpp-core/lib/Connection.js:355:17)
at StreamParser. (/usr/lib/node_modules/homebridge-harmonyhub/node_modules/node-xmpp-core/lib/Connection.js:226:10)
at emitOne (events.js:96:13)
at StreamParser.emit (events.js:191:7)
at SaxLtx. (/usr/lib/node_modules/homebridge-harmonyhub/node_modules/node-xmpp-core/lib/StreamParser.js:58:14)
at emitOne (events.js:96:13)
at SaxLtx.emit (events.js:191:7)
at SaxLtx._handleTagOpening (/usr/lib/node_modules/homebridge-harmonyhub/node_modules/ltx/lib/parsers/ltx.js:31:18)
at SaxLtx.write (/usr/lib/node_modules/homebridge-harmonyhub/node_modules/ltx/lib/parsers/ltx.js:105:26)
at StreamParser.write (/usr/lib/node_modules/homebridge-harmonyhub/node_modules/node-xmpp-core/lib/StreamParser.js:123:17)
at Connection.onData (/usr/lib/node_modules/homebridge-harmonyhub/node_modules/node-xmpp-core/lib/Connection.js:305:17)
at emitOne (events.js:101:20)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at TCP.onread (net.js:561:20)

@starlessblack
Copy link

So I finally got my first “xmpp authentication failure” message in logs this morning, after about 7.5 days uptime. I guess I’ll just continue to wait and see if and when it finally takes down Homebridge and/or the Pi.

@starlessblack
Copy link

Soooo, I did a little digging and found my router restarted yesterday morning a bit before I received that "xmpp authentication failure" error in the Homebridge logs...I'm guessing that it was probably due to the Harmony Hub and RaspberryPi losing wi-fi connectivity for a bit and, thus, communications with each other. Homebridge service still has not restarted, and everything still seems to be running fine at the moment. No further errors since then.

@starlessblack
Copy link

I received another couple xmpp authentication failure messages in logs yesterday, and it finally took Homebridge down, and it restarted itself.

Been doing a little more investigation this morning, and I'm wondering about the aforementioned fix in this thread. I installed the newer harmonyhubjs-client package, then removed the old client package from the homebridge-harmonyhub/node_modules folder, but then how does the harmonyhub plug use the new js-client package? How does it get registered as a dependency for the harmony plugin?

The reason I ask is because I happened to notice when running npm -g list that the harmonyhub plugin has an "unmet dependency" error now.npm ERR! missing: harmonyhubjs-client@github:e7hz3r0/harmonyhubjs-client, required by homebridge-harmonyhub@0.3.0-alpha.2

@starlessblack
Copy link

Well, mine still crashes regularly. Seems to happen roughly daily--which is more frequently than I remember the 0.1.1 plugin crashing. For the moment, I'm back to nightly power-cycling my Harmony Hub via a smart plug and then restarting Homebridge a few minutes later.

@carloscae
Copy link

For me it works randomly. Crashes on homebridge are constant, but that wouldn't be an issue as a run it as a service. Real problem is that now, it won't load again the scenes on restart and all buttons are unresponsive. If I clear cache, buttons vanish, of course. Then I need to power cycle the hub, reinstall plugins and then they're back on... for a couple of hours.

I guess i'll switch to IFTTT homebridge switches.

@starlessblack
Copy link

The thing is, even with Homebridge running as service set to restart on failure after 10 seconds, you're still looking at at least 30-45 seconds of Home app unresponsiveness while you wait for Homebridge to come back up and everything to get re-propagated and settled. You think 10 seconds is nothing until you experience the disruption right when you're trying to turn on or off some lightbulbs or something :)

I was going to use the IFTTT-to-Harmony arrangement, but once I landed on a powercycling/Homebridge-rebooting method that kept everything humming along, I just kept using the harmony plugin since it's faster than IFTTT commands sent from internet.

@carloscae
Copy link

I had no more Homebridge crashes after removing the Harmony plugin.
IFTTT does have a much bigger delay, but it's a reasonable trade-off for the peace of mind of your relatives not complaining all the time. =)

@starlessblack
Copy link

Yeah, I got rid of all my Homebridge crashing and kept my Harmony plugin functional by putting the Harmony hub on a smartplug (could also use a cheap light timer switch) that powercycles it in the middle of the night 1x a day and then setting crontab to reboot Homebridge service right afterwards and then once again 12hrs later. Ever since then it's solid as a rock.

I did come across someone in the Macrumors forums who said he's running Harmony plugin on Homebridge on a Raspberry Pi and has never had any problems with it. He claims it's never crashed on him since whittling down his Harmony activities to like 5 or 6. I tried just that thing a while back and it never made any difference. So who knows...guess he's one of the lucky ones :)

@shred86
Copy link

shred86 commented Mar 12, 2018

Luckily, I haven’t had any issues and I’m running 0.3.0-alpha 2. I have one Harmony Hub with only two activities and my Homebridge is running as an add-on for my Hassio (Home Assistsnt) setup. It’s been running for about a month now with no crashes. I was really concerned before setting it up based on this thread but for whatever reason, it’s been stable so far.

@matijus91
Copy link

People. It’s a shame this plugin crashes that much. It one of the best plugins! It there anyone who uses a program who helps it auto restart it again when it crashes? If so please let me now how you did dat in de raspberry Pi.

I am heavily dependent on Homebridge as I use it for al the thinks I can’t do my own. I driving a electric wheelchair so I use it for opening doors, curtains, kitchen supplies... now I did try harmony it works for like a week and then crashes every minute so I removed it now. I’m thinking about a extra Pi with homedridge so it do not crash al my important things.

Any suggestions will help!

@starlessblack
Copy link

Yeah, I got rid of all my Homebridge crashing and kept my Harmony plugin functional by putting the Harmony hub on a smartplug (could also use a cheap light timer switch) that powercycles it in the middle of the night 1x a day and then setting crontab to reboot Homebridge service right afterwards and then once again 12hrs later. Ever since then it's solid as a rock.

@starlessblack
Copy link

Oh, and I use the old 0.1.1 plugin, since it’s more stable than the newer versions.

@matijus91
Copy link

Yeah I was thinking about that to... but there is not a digital way of killing Homebridge en restart it again every 12h? Where can I download the older version?

@CASINOS
Copy link

CASINOS commented Apr 1, 2018

I use Putty on my PC and start HOMEBRIDGE :
Redemarrge HOMEKIT toutes les 30 sec
bash -c 'while [ 0 ]; do homebridge; sleep 30; done'

@shred86
Copy link

shred86 commented Apr 1, 2018

For those of you experiencing crashing issues - do you have multiple Harmony Hubs?

I've been running this plugin for over a month now without a crash but I'm only running one Harmony Hub. I'm also running Homebridge as an add-on to Home Assistant, but I don't think that should really matter. I was thinking about picking up another Harmony Hub but I'm thinking this issue is when multiple hubs are running.

While not ideal, another solution might be to run something like Home Assistant and use the Harmony component. Now that Home Assistant has "native" HomeKit support (i.e. you don't need to use Homebridge), you can just expose the Harmony activities as switches through Home Assistant which will show up in HomeKit.

@carloscae
Copy link

carloscae commented Apr 1, 2018 via email

@starlessblack
Copy link

Yes I use version 0.1.1 which can be installed by “sudo -g npm install homebridge-harmonyhub@0.1.1”

To restart homebridge, just use “sudo crontab -e” and add a line “0 4 * * * systemctl restart homebridge.service” to restart it everyday at 4AM (or more often!)

@starlessblack
Copy link

@shred86 No, the crashes happen with only one hub. I also tried reducing the number of Harmony activities from like 7 down to 4, but the crashes were just as persistent.

Way back when I first began using the Harmony plugin and before getting my setup stabilized with regular power cycling and Homebridge restart jobs, I considered going Home Assistant. But, honestly, with 0.1.1 and daily power cycling, it's pretty much rock solid, and I'd rather not go reinvent the wheel setting up my bulbs and other accessories in Hass.io now that my Homebridge is dialed in.

@rpmorale
Copy link

@shred86 Are you still powercycling your hub and Homebridge?

@shred86
Copy link

shred86 commented Apr 11, 2018

I’m not running this plugin anymore as I’m using the HomeKit component for Home Assistant which I have linked to my Harmony Hub. However, when I was running this plugin, I was not power cycling the hub or Homebridge. I ran it for about 2 months with no issues.

@rpmorale
Copy link

@shred86. Ok. In the previous threads you mentioned power cycling at 4am with the Harmony plugin, so I thought i’d ask. Is Home Assistant more stable? How do I install it? Thanks

@carloscae
Copy link

carloscae commented Apr 11, 2018 via email

@starlessblack
Copy link

@shred86 It may have been me that you're remembering--I powercycle my Harmony Hub at 4AM along with restarting Homebridge 2x a day, and it's rock solid. On a fresh Homebridge and Harmony plugin install, it seems to be stable for about a month, and then it starts having more and more errors until you blow away the cached accessories and persist folders. Powercycling and restarting Homebridge seem to keep all those issues at bay.

@shred86
Copy link

shred86 commented Apr 11, 2018

@rpmorale That must’ve been starlessblack you’re thinking of as I’ve never mentioned anything regarding power cycling my hub. As for Home Assistsnt, I’m not a software engineer and I have no issues using it. There’s definitely a learning curve though but there’s a lot of resources and YouTube videos out there to guide you.

@rpmorale
Copy link

@starlessblack are you still power cycling to keep it somewhat stable. Thanks all for the suggestions.

@starlessblack
Copy link

@rpmorale Yes, honestly it's rock solid with daily powercycle of Harmony at 4AM and then restart of Homebridge service at ~4:02AM and again at 4:00PM.

@iandronowicz
Copy link

F*** amazing... This plugins crashes everything, and the problem is that I couldn't find a single log on my 2 running instances of Homebridge of the crash. Its like an overflow that makes randomly one of the 2 instances of Homebridge to not respond anymore. When I disabled it everything started to work flawlessly again.

The strange thing is that this plugin worked fine for a couple of days... I don't know exactly what the problem is but for sure is whit the harmony hub plugin

@humphreyyy
Copy link

humphreyyy commented Jul 5, 2018 via email

@msetten
Copy link

msetten commented Aug 12, 2018

I also have these crash issues (one harmony hub). To keep homebridge running while these crashes still occur, I start it with: while :; do homebridge; done
This way, every time it crashes, it will automatically start again.

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