luisiam / homebridge-liftmaster2

LiftMaster Plugin for HomeBridge (API 2.0): https://github.com/nfarina/homebridge
61 stars 15 forks source link

Copious liftmaster2 errors since 5/25/2019 #60

Open hepcat72 opened 5 years ago

hepcat72 commented 5 years ago

Homebridge stopped working for me out of the blue today. Siri complained my devices weren't responding. I started poking around in the logs and the homebridge-out log has 858096 lines with an error from liftmaster2 mentioning 'ECONNRESET'. 858080 of those lines have been added since 5/25 (today is 5/30). The homebridge-error log also has 21300 lines containing "homebridge-liftmaster2". 93% of the entire log is filled with almost exclusively this error after line 4385 (out of 65001 lines in the file):

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Request._callback (/usr/lib/node_modules/homebridge-liftmaster2/index.js:249:23)
    at Request.self.callback (/usr/lib/node_modules/homebridge-liftmaster2/node_modules/request/request.js:185:22)
    at Request.emit (events.js:197:13)
    at Request.<anonymous> (/usr/lib/node_modules/homebridge-liftmaster2/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:197:13)
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-liftmaster2/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:285:20)
    at IncomingMessage.emit (events.js:202:15)
    at endReadableNT (_stream_readable.js:1132:12)

I'm not sure how I managed to get homebridge back and running. It took dozens of tries and tweaks before homebridge could be re-added to the home app, but after finally getting it to re-add to my home app, I noted that the garage door was not present among my devices anymore.

And now that I think about it, I recall that last night, I'd noticed a number of notifications from the home app that the garage door had closed. There were a couple dozen of those notifications on the lock screen when I woke up. There had been no open events. The MyQ app indicated that the garage door had been closed all night.

The liftmaster2 entries in the log number about a dozen a second and if it's not the ECONNRESET error, it's Logged in with MyQ user ID 0.

So something's going on here.

hepcat72 commented 5 years ago

It appears that these errors were crashing homebridge a dozen times a minute and pm2 was restarting it. I finally removed the liftmaster2 info from the config.json and homebridge seems to have stabilized.

Is anyone else having trouble with liftmaster2?

jasonstcyr commented 5 years ago

I having the same issue.

hepcat72 commented 5 years ago

Late last night, I npm removed homebridge-liftmaster2 and swapped it out for homebridge-chamberlain, which does not appear to be affected by this issue.

jasonstcyr commented 5 years ago

Good to know thanks!

pvanessen commented 5 years ago

Same issue. Will try the chamberlain workaround

RemuxZaph commented 5 years ago

I had the same issue. I reinstalled the plugin since it was showing 0.1.0 and not the latest 0.5.0. Pulling from npm gives you the outdated version. You'll have on install using the direct command: " npm install -g git+https://github.com/luisiam/homebridge-liftmaster2.git"

I'll switch to the Chamberlain one though if the error ever comes back.

jasonstcyr commented 5 years ago

Good to know thanks! I'll try that. Haven't had a chance to sit down and fix mine yet.

hepcat72 commented 5 years ago

BTW, homebridge-chamberlain does get the same error response from the remote server that the version of liftmaster2 I was getting, but the chamberlain was gracefully catching it. The error happens occasionally. I saw it in my logs after the chamberlain install over the weekend and it was caught and handled. It doesn't appear to have crashed homebridge. So I'd be interested to know what the newer liftmaster2 version does when the error occurs - i.e. whether it crashes homebridge with an uncaught exception and it automatically restarts, or whether it catches the exception and recovers. If it crashes, you'll see a bunch of startups every minute during the period the server sends an error.

jasonstcyr commented 5 years ago

So what is happening? Is it just going down for sporadic times spans? If so wonder if anyone has figured out how to use the API routes that the MYQ or WebApp app actually uses because they are different.

image

hepcat72 commented 5 years ago

This might answer that...

https://unofficialliftmastermyq.docs.apiary.io/#reference/0/system-detail

JaredBoone commented 5 years ago

I had the same issue. I reinstalled the plugin since it was showing 0.1.0 and not the latest 0.5.0. Pulling from npm gives you the outdated version. You'll have on install using the direct command: " npm install -g git+https://github.com/luisiam/homebridge-liftmaster2.git"

Upgrading to 0.5 worked for me too. I've contacted the package maintainer on npmjs so that we can get an updated version published.