WebThingsIO / gateway

WebThings Gateway - a self-hosted web application for monitoring and controlling a building over the web
http://webthings.io/gateway
Mozilla Public License 2.0
2.62k stars 339 forks source link

Disabling Voco add-on crashes Gateway #2298

Closed flatsiedatsie closed 5 years ago

flatsiedatsie commented 5 years ago

I noticed it before, and now did a tail of the log:

Nov 19 12:45:08 gateway run-app.sh[7001]: #033[37m#033[2m2019-11-19 12:45:08.967 INFO   : voco: Notifier: voco-notifier unloaded#033[22m#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m2019-11-19 12:45:08.982 ERROR  : #033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m2019-11-19 12:45:08.984 ERROR  : /home/pi/mozilla-iot/gateway/build/webpack:/src/plugin/plugin.js:374#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m        const handler = adapter.eventHandlers[Constants.THING_ADDED];#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m^#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m2019-11-19 12:45:08.985 ERROR  : TypeError: Cannot read property 'eventHandlers' of undefined#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m    at Plugin.onMsg (/home/pi/mozilla-iot/gateway/build/webpack:/src/plugin/plugin.js:374:1)#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m    at IpcSocket.onData (/home/pi/mozilla-iot/gateway/node_modules/gateway-addon/lib/ipc.js:171:10)#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m    at emitOne (events.js:116:13)#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m    at Socket.emit (events.js:211:7)#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m    at addChunk (_stream_readable.js:263:12)#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m    at readableAddChunk (_stream_readable.js:250:11)#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m    at Socket.Readable.push (_stream_readable.js:208:10)#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m    at Socket._receive (/home/pi/mozilla-iot/gateway/node_modules/nanomsg/lib/index.js:204:8)#033[39m
Nov 19 12:45:08 gateway run-app.sh[7001]: #033[31m    at Socket.<anonymous> (/home/pi/mozilla-iot/gateway/node_modules/nanomsg/lib/index.js:218:24)#033[39m
Nov 19 12:45:09 gateway run-app.sh[7001]: npm ERR! code ELIFECYCLE
Nov 19 12:45:09 gateway run-app.sh[7001]: npm ERR! errno 1
Nov 19 12:45:09 gateway run-app.sh[7001]: npm ERR! webthings-gateway@0.10.0 run-only: `node build/gateway.js`
Nov 19 12:45:09 gateway run-app.sh[7001]: npm ERR! Exit status 1
Nov 19 12:45:09 gateway run-app.sh[7001]: npm ERR!
Nov 19 12:45:09 gateway run-app.sh[7001]: npm ERR! Failed at the webthings-gateway@0.10.0 run-only script.
Nov 19 12:45:09 gateway run-app.sh[7001]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Nov 19 12:45:09 gateway run-app.sh[7001]: npm ERR! A complete log of this run can be found in:
Nov 19 12:45:09 gateway run-app.sh[7001]: npm ERR!     /home/pi/.npm/_logs/2019-11-19T11_45_09_042Z-debug.log
Nov 19 12:45:09 gateway systemd[1]: mozilla-iot-gateway.service: Main process exited, code=exited, status=1/FAILURE

From the logs is seems to be related to the notifier?

flatsiedatsie commented 5 years ago

I'm getting errors enabling the add-on too. Adding the authorization code in the settings also results in errors. Perhaps your code already fixed them. But just in case:

voco_error1 voco_error2 voco_error3

mrstegeman commented 5 years ago

@flatsiedatsie Could you post or send me the full log file, so that I can have more context? mstegeman@mozilla.com if you want to email.

mrstegeman commented 5 years ago

Oh, nevermind. This is indeed the same issue.

flatsiedatsie commented 4 years ago

Since users have to add the API code to the settings page, and the settings page of Voco always crashes, there is a serious barrier to using Voco. Luckily, after a power cycle the new settings are applied, but users might not realise this.

Basically, I'm wondering if this bug is serious enough to warrant a point release?

mrstegeman commented 4 years ago

We're planning on doing a point release but have been holding off until Pontoon is enabled for localization. That should hopefully be happening this week.