Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Homebridge stuck in bootloop with homebrige-liftmaster2 json error #37

Open
dawger1 opened this issue Jan 29, 2018 · 11 comments
Open

Homebridge stuck in bootloop with homebrige-liftmaster2 json error #37

dawger1 opened this issue Jan 29, 2018 · 11 comments

Comments

@dawger1
Copy link

dawger1 commented Jan 29, 2018

Hi there,

I recently pulled oznu's latest homebridge image for raspberry pi, but for some reason, it dumped all of my plugins. I re-installed the liftmaster2 plugin, and now my homebridge server seems to be stuck in a boot loop. Here's what my log file shows when I restart my homebridge server:

homebridge_1 | *** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
homebridge_1 | *** WARNING *** Please fix your application to use the native API of Avahi!
homebridge_1 | *** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node
homebridge_1 | *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
homebridge_1 | *** WARNING *** Please fix your application to use the native API of Avahi!
homebridge_1 | *** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister
homebridge_1 | [2018-1-29 17:03:13] Loaded plugin: homebridge-dummy
homebridge_1 | [2018-1-29 17:03:13] Registering accessory 'homebridge-dummy.DummySwitch'
homebridge_1 | [2018-1-29 17:03:13] ---
homebridge_1 | [2018-1-29 17:03:15] Loaded plugin: homebridge-liftmaster2
homebridge_1 | [2018-1-29 17:03:15] Registering platform 'homebridge-liftmaster2.LiftMaster2'
homebridge_1 | [2018-1-29 17:03:15] ---
homebridge_1 | [2018-1-29 17:03:16] Loaded plugin: homebridge-nest
homebridge_1 | [2018-1-29 17:03:16] Registering platform 'homebridge-nest.Nest'
homebridge_1 | [2018-1-29 17:03:16] ---
homebridge_1 | [2018-1-29 17:03:17] Loaded plugin: homebridge-platform-wemo
homebridge_1 | [2018-1-29 17:03:17] Registering platform 'homebridge-platform-wemo.BelkinWeMo'
homebridge_1 | [2018-1-29 17:03:17] ---
homebridge_1 | [2018-1-29 17:03:18] Loaded plugin: homebridge-config-ui-x
homebridge_1 | [2018-1-29 17:03:18] Registering platform 'homebridge-config-ui-x.config'
homebridge_1 | [2018-1-29 17:03:18] ---
homebridge_1 | [2018-1-29 17:03:18] Loaded config.json with 0 accessories and 3 platforms.
homebridge_1 | [2018-1-29 17:03:18] ---
homebridge_1 | [2018-1-29 17:03:19] Loading 3 platforms...
homebridge_1 | [2018-1-29 17:03:19] [WeMo Platform] Initializing BelkinWeMo platform...
homebridge_1 | [2018-1-29 17:03:19] [MyQ] Initializing LiftMaster2 platform...
homebridge_1 | [2018-1-29 17:03:19] [Nest] Initializing Nest platform...
homebridge_1 | [2018-1-29 17:03:19] [Nest] Fetching Nest devices.
homebridge_1 | [2018-1-29 17:03:19] Loading 0 accessories...
homebridge_1 | [2018-1-29 17:03:19] [WeMo Platform] Online: Living Room Lights [6038E0496D48]
homebridge_1 | [2018-1-29 17:03:19] [WeMo Platform] Online: Kitchen Lights [6038E04B2A04]
homebridge_1 | [2018-1-29 17:03:19] [WeMo Platform] Online: Kitchen Table Lights [149182D8C390]
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Online: Upstairs Christmas Lights [58EF68D9EE70]
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Online: Dining Room Lights [149182D865E4]
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Online: Front Room Lights [149182CCA07C]
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Online: Davids Lamp [6038E05BA710]
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Online: Front Room Christmas Lights [58EF68D9FCC8]
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Online: Playroom Lamp [6038E05BB254]
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Online: Front Porch and Garage Lights [149182505F6C]
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Online: Main Floor Bathroom Lights [149182D88550]
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Living Room Lights - Get state: On
homebridge_1 | [2018-1-29 17:03:20] [WeMo Platform] Davids Lamp - Get state: On
homebridge_1 |
homebridge_1 | /homebridge/node_modules/homebridge-liftmaster2/index.js:249
homebridge_1 | var json = JSON.parse(body);
homebridge_1 | ^
homebridge_1 | SyntaxError: Unexpected token < in JSON at position 0
homebridge_1 | at JSON.parse ()
homebridge_1 | at Request._callback (/homebridge/node_modules/homebridge-liftmaster2/index.js:249:23)
homebridge_1 | at Request.self.callback (/homebridge/node_modules/request/request.js:186:22)
homebridge_1 | at emitTwo (events.js:126:13)
homebridge_1 | at Request.emit (events.js:214:7)
homebridge_1 | at Request. (/homebridge/node_modules/request/request.js:1163:10)
homebridge_1 | at emitOne (events.js:116:13)
homebridge_1 | at Request.emit (events.js:211:7)
homebridge_1 | at IncomingMessage. (/homebridge/node_modules/request/request.js:1085:12)
homebridge_1 | at Object.onceWrapper (events.js:313:30)
homebridge_1 | at emitNone (events.js:111:20)
homebridge_1 | at IncomingMessage.emit (events.js:208:7)
homebridge_1 | at endReadableNT (_stream_readable.js:1055:12)
homebridge_1 | at _combinedTickCallback (internal/process/next_tick.js:138:11)
homebridge_1 | at process._tickCallback (internal/process/next_tick.js:180:9)

Can somebody please help me fix this?

@dawger1
Copy link
Author

dawger1 commented Jan 30, 2018

Update: I tried uninstalling the plugin and clearing my config.json files. The homebridge server now starts normally, and everything else seems fine. As soon as I re-install Liftmaster2 and re-add my config.json details, I end up with the same error messages at startup.

@dawger1
Copy link
Author

dawger1 commented Jan 30, 2018

I'm not sure how I did it, but after removing and installing the plugin a number of times, I just re-installed the plug-in, and all appears to be well again.

@tkundhi
Copy link

tkundhi commented Feb 4, 2018

I am having this same error. I've removed and reinstalled the plug-in multiple times without success. The only change is the information in the log. Usually it doesn't have the details. See example 1. However occasionally it has the same exact details as posted by @dawger1 . See example 2.

Any help is appreciated.

==============================
Example 1 - occurs most often but contains no details except for same file and line number.

raspberrypi homebridge[25073]: var json = JSON.parse(body);
raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
raspberrypi systemd[1]: homebridge.service: Unit entered failed state.
raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.

==============================
Example 2 - rare example has detail

raspberrypi homebridge[22358]: /usr/lib/node_modules/homebridge-liftmaster2/index.js:249
raspberrypi homebridge[22358]: var json = JSON.parse(body);
raspberrypi homebridge[22358]: ^
raspberrypi homebridge[22358]: SyntaxError: Unexpected token < in JSON at position 0
raspberrypi homebridge[22358]: at JSON.parse ()
raspberrypi homebridge[22358]: at Request._callback (/usr/lib/node_modules/homebridge-liftmaster2/index.js:249:23)
raspberrypi homebridge[22358]: at Request.self.callback (/usr/lib/node_modules/homebridge-liftmaster2/node_modules/request/request.js:186:22)
raspberrypi homebridge[22358]: at emitTwo (events.js:126:13)
raspberrypi homebridge[22358]: at Request.emit (events.js:214:7)
raspberrypi homebridge[22358]: at Request. (/usr/lib/node_modules/homebridge-liftmaster2/node_modules/request/request.js:1163:10)
raspberrypi homebridge[22358]: at emitOne (events.js:116:13)
raspberrypi homebridge[22358]: at Request.emit (events.js:211:7)
raspberrypi homebridge[22358]: at IncomingMessage. (/usr/lib/node_modules/homebridge-liftmaster2/node_modules/request/request.js:1085:12)
raspberrypi homebridge[22358]: at Object.onceWrapper (events.js:313:30)
raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
raspberrypi systemd[1]: homebridge.service: Unit entered failed state.
raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.

@zjensen
Copy link

zjensen commented Feb 10, 2018

Alright finally figured it out. The only version of this package that is published is 0.1.0, which has the json error mentioned above. So by default, adding this plugin through homebridge will pull from npm and install the broken version.

To fix this, go to your package.json, and run:
npm install -save git+https://github.com/luisiam/homebridge-liftmaster2.git

This will install the correct version of this package.

@tkundhi
Copy link

tkundhi commented Feb 12, 2018

@zjensen thanks! That worked. My status issues are resolved. The Garage Door is now showing in HomeKit. No need to me to purchase the Chamberlain HomeKit bridge for now. Works from Home and and via Siri.

@smshapiro85
Copy link

I would just like to report that zjensen's solution worked for me as well. All I did was uninstall and then reinstall using his command:
npm install -save git+https://github.com/luisiam/homebridge-liftmaster2.git

@danhausman
Copy link

try and fix permissions first

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

Then install using this command:

sudo npm install -g git+https://github.com/luisiam/homebridge-liftmaster2.git

@RemuxZaph
Copy link

Started getting a similar issue. Here's the output:

[5/30/2019, 12:51:54 PM] 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:196:13)
at Request.<anonymous> (/usr/lib/node_modules/homebridge-liftmaster2/node_modules/request/request.js:1161:10)
at Request.emit (events.js:196:13)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-liftmaster2/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:284:20)
at IncomingMessage.emit (events.js:201:15)
at endReadableNT (_stream_readable.js:1130:12)
[5/30/2019, 12:51:54 PM] Got SIGTERM, shutting down Homebridge...

Worked for for 2 months then stopped today. Maybe Liftmaster/Chamberlain changed something?

@dkhaley
Copy link

dkhaley commented May 31, 2019

Like amitgir, I had this working and it stopped working today (30 May 2019). I get the exact same error messages as above.

Does anybody still have this working?

@danhausman
Copy link

danhausman commented May 31, 2019

Mine seems to be working fine.

Dan

@RemuxZaph
Copy link

I reinstalled the package using "npm install -g git+https://github.com/luisiam/homebridge-liftmaster2.git" rather than via the Config UI plugin and now all works. For some reason the npm command is pulling an outdated version like someone had mentioned above.

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

No branches or pull requests

7 participants