TheThingSystem / steward

The Thing System is a set of software components and network protocols that aims to fix the Internet of Things. Our steward software is written in node.js making it both portable and easily extensible. It can run on your laptop, or fit onto a small single board computer like the Raspberry Pi.
http://thethingsystem.com
Other
347 stars 81 forks source link

Steward fails with uncaught exception #218

Closed larryboy44 closed 10 years ago

larryboy44 commented 10 years ago

If I start the steward with my son's gaming machine (MARTIAZ) running, the steward fails with an uncaught exception.

The machine is a Win7 box that had the Windows uPNP service running. I disabled that so TTS couldn't discover it and the problem went away.

Log is as follows:

info: [devices] loading climate driver debug: [climate] begin info: [devices] loading gateway driver info: [devices] loading indicator driver info: [devices] loading lighting driver info: [devices] loading media driver debug: [media] begin info: [devices] loading motive driver debug: [motive] begin info: [devices] loading presence driver info: [devices] loading sensor driver info: [devices] loading switch driver info: [devices] loading wearable driver debug: [wearable] begin info: [climate] loading ecobee-control driver info: [climate] loading flower-power-sensor driver info: [climate] loading koubachi-sensor driver info: [climate] loading nest-control driver info: [climate] loading netatmo-sensor driver info: [climate] loading oregon-scientific-sensor driver info: [climate] loading plantlink-sensor driver info: [climate] loading samsung-control driver info: [climate] loading teldus-meteo driver info: [climate] loading yoctopuce-meteo driver info: [discovery] SSDP listening on http://0.0.0.0:1900 info: [gateway] loading automatic-cloud gateway info: [gateway] loading ecobee-cloud gateway info: [devices] failing ecobee-cloud gateway (continuing) diagnostic=Cannot find module 'ecobee-api' info: [gateway] loading flower-power-cloud gateway info: [gateway] loading insteon-9761 gateway info: [gateway] loading koubachi-cloud gateway info: [gateway] loading lockitron-cloud gateway info: [gateway] loading nest-cloud gateway info: [gateway] loading netatmo-cloud gateway info: [gateway] loading openzwave-usb gateway info: [gateway] loading plantlink-cloud gateway info: [gateway] loading reelyactive-reel gateway info: [gateway] loading rfxcom-usb gateway info: [gateway] loading telldus-live-cloud gateway info: [gateway] loading tesla-cloud gateway info: [gateway] loading wink-cloud gateway info: [gateway] loading yoctopuce-hub gateway info: [gateway] loading zigbee-xstick gateway info: [discovery] reelyactive-reel driver listening on udp://:7018 info: [indicator] loading cassandra-nosql driver info: [indicator] loading dweetio-sensor driver info: [indicator] loading grovestreams-sensor driver info: [indicator] loading mqtt-text driver info: [indicator] loading nma-text driver info: [indicator] loading prowl-text driver info: [indicator] loading wink-dial driver info: [indicator] loading wink-nimbus driver info: [indicator] loading xively-sensor driver info: [lighting] loading blink1-led driver info: [lighting] loading blinkstick-led driver info: [lighting] loading heroicrobotics driver info: [lighting] loading hue driver info: [lighting] loading insteon-led driver info: [lighting] loading lifx-bulb driver info: [lighting] loading robosmart-led driver info: [lighting] loading tabu-lumen driver info: [lighting] loading tcpi-led driver ** WARNING * The program 'node' uses the Apple Bonjour compatibility layer of Avahi. * WARNING * Please fix your application to use the native API of Avahi! * WARNING * For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node * WARNING * The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. * WARNING * Please fix your application to use the native API of Avahi! * WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister info: [lighting] loading yoctopuce-color driver info: [lighting] loading yoctopuce-powercolor driver info: [discovery] PixelPusher listening on udp://:7331 info: [media] loading audio-sonos driver info: [media] loading audio-upnp driver info: [media] loading pioneer-receiver driver info: [media] loading video-appletv driver info: [media] loading video-chromecast driver info: [media] loading video-roku driver info: [motive] loading automatic-vehicle driver info: [motive] loading lockitron-lock driver info: [motive] loading tesla-model-s driver info: [presence] loading fob driver info: [presence] loading mobile-mqtt driver info: [presence] loading reelyactive-tag driver info: [switch] loading insteon-dimmer driver info: [switch] loading insteon-onoff driver info: [switch] loading telldus-dimmer driver info: [switch] loading telldus-onoff driver info: [switch] loading wemo-onoff driver info: [switch] loading wink-onoff driver info: [switch] loading wink-pivot-power-genius driver info: [switch] loading zwave-dimmer driver info: [switch] loading zwave-onoff driver info: [wearable] loading watch driver notice: [steward] start uuid=2f402f80-da50-11e1-9b23-b827eba79df1 info: [server] listening on wss://:8888 info: [server] listening on wss://:8887 info: [server] redirecting from http://:80 to https://_:8888 info: [server] unable to listen on http://_:80 diagnostic=listen EADDRINUSE {"local":{"address":"0.0.0.0","port":80}} info: [server] loading console route info: [server] loading manage route info: [server] loading oneshot route info: [server] loading root route info: [server] loading ble discovery info: [server] loading mac discovery info: [server] loading owl discovery info: [server] loading portscan discovery info: [server] loading ssdp discovery info: [server] loading tsrp discovery info: [discovery] OWL driver listening on multicast udp://224.192.32.19:22600 info: [discovery] SSDP listening on http://192.168.1.208:1900 info: [discovery] TSRP listening on multicast udp://224.0.9.1:22601 info: [discovery] UPnP listening on http://192.168.1.208:8886 info: [discovery] BLE stateChange state=unsupported warning: [steward] place/1 Home event=getWeather, diagnostic=check in 3312.073 seconds info: [discovery] mDNS Apple TV (2) url=http://192.168.1.133:7000/ info: [discovery] UPnP 192.168.1.106 - Sonos CONNECT:AMP url=http://192.168.1.106:1400/ info: [discovery] UPnP 192.168.1.139 - Sonos CONNECT url=http://192.168.1.139:1400/ info: [discovery] UPnP 192.168.1.107 - Sonos CONNECT:AMP url=http://192.168.1.107:1400/ info: [discovery] UPnP 192.168.1.105 - Sonos CONNECT:AMP url=http://192.168.1.105:1400/ info: [devices] found Apple TV (2) deviceID=3, deviceType=/device/media/appletv/video info: [devices] found 192.168.1.106 - Sonos CONNECT:AMP deviceID=5, deviceType=urn:schemas-upnp-org:device:ZonePlayer:1 info: [devices] found 192.168.1.139 - Sonos CONNECT deviceID=7, deviceType=urn:schemas-upnp-org:device:ZonePlayer:1 info: [devices] found 192.168.1.107 - Sonos CONNECT:AMP deviceID=6, deviceType=urn:schemas-upnp-org:device:ZonePlayer:1 info: [discovery] UPnP 192.168.1.132 - Sonos PLAY:5 url=http://192.168.1.132:1400/ info: [devices] found 192.168.1.105 - Sonos CONNECT:AMP deviceID=8, deviceType=urn:schemas-upnp-org:device:ZonePlayer:1 info: [discovery] UPnP 192.168.1.108 - Sonos CONNECT:AMP url=http://192.168.1.108:1400/ info: [discovery] UPnP 192.168.1.110 - Sonos BRIDGE url=http://192.168.1.110:1400/ info: [discovery] PORT starting scan info: [devices] found 192.168.1.132 - Sonos PLAY:5 deviceID=4, deviceType=urn:schemas-upnp-org:device:ZonePlayer:1 info: [discovery] UPnP MARTIAZ url=http://192.168.1.111:2869/ info: [devices] found 192.168.1.108 - Sonos CONNECT:AMP deviceID=9, deviceType=urn:schemas-upnp-org:device:ZonePlayer:1 info: [devices] found 192.168.1.110 - Sonos BRIDGE deviceID=2, deviceType=Sonos ZoneBridge ZB100 debug: [media] device/5 Sitting Room event=subscribe, state=end, code=200, err=null, headers={"sid":"uuid:RINCON_000E58D3387001400_sub0000010258","timeout":"Second-86400","server":"Linux UPnP/1.0 Sonos/24.1-74200 (ZP120)","connection":"close"} info: [media] device/5 Sitting Room subscribe=uuid:RINCON_000E58D3387001400_sub0000010258, path=/MediaRenderer/AVTransport/Event, sequence=0, seconds=86399 debug: [media] device/7 Office event=subscribe, state=end, code=200, err=null, headers={"sid":"uuid:RINCON_000E58A8E64201400_sub0000011749","timeout":"Second-86400","server":"Linux UPnP/1.0 Sonos/24.1-74200 (ZP90)","connection":"close"} info: [media] device/7 Office subscribe=uuid:RINCON_000E58A8E64201400_sub0000011749, path=/MediaRenderer/AVTransport/Event, sequence=0, seconds=86399 debug: [media] device/6 Pool Deck event=subscribe, state=end, code=200, err=null, headers={"sid":"uuid:RINCON_000E58D3944C01400_sub0000011666","timeout":"Second-86400","server":"Linux UPnP/1.0 Sonos/24.1-74200 (ZP120)","connection":"close"} info: [media] device/6 Pool Deck subscribe=uuid:RINCON_000E58D3944C01400_sub0000011666, path=/MediaRenderer/AVTransport/Event, sequence=0, seconds=86399 info: [devices] found MARTIAZ deviceID=11, deviceType=urn:schemas-upnp-org:device:MediaRenderer:1 debug: [media] device/8 Master Suite event=subscribe, state=end, code=200, err=null, headers={"sid":"uuid:RINCON_000E58D3941001400_sub0000010838","timeout":"Second-86400","server":"Linux UPnP/1.0 Sonos/24.1-74200 (ZP120)","connection":"close"} info: [media] device/8 Master Suite subscribe=uuid:RINCON_000E58D3941001400_sub0000010838, path=/MediaRenderer/AVTransport/Event, sequence=0, seconds=86399 info: [discovery] PORT finished scan debug: [media] device/4 Quilting Room event=subscribe, state=end, code=200, err=null, headers={"sid":"uuid:RINCON_000E585E9A5401400_sub0000009794","timeout":"Second-86400","server":"Linux UPnP/1.0 Sonos/24.1-74200 (ZPS5)","connection":"close"} info: [media] device/4 Quilting Room subscribe=uuid:RINCON_000E585E9A5401400_sub0000009794, path=/MediaRenderer/AVTransport/Event, sequence=0, seconds=86399 debug: [media] device/9 Great Room event=subscribe, state=end, code=200, err=null, headers={"sid":"uuid:RINCON_000E58D3419C01400_sub0000010849","timeout":"Second-86400","server":"Linux UPnP/1.0 Sonos/24.1-74200 (ZP120)","connection":"close"} info: [media] device/9 Great Room subscribe=uuid:RINCON_000E58D3419C01400_sub0000010849, path=/MediaRenderer/AVTransport/Event, sequence=0, seconds=86399 error: [media] device/11 MARTIAZ event=getTransportInfo, diagnostic=HTTP response code 404 for "urn:schemas-upnp-org:service:AVTransport:1#GetTransportInfo" error: [media] device/11 MARTIAZ event=currentTrack, diagnostic=HTTP response code 404 for "urn:schemas-upnp-org:service:AVTransport:1#GetPositionInfo" alert: [steward] exception diagnostic=Cannot read property 's:Body' of undefined alert: [steward] exception stack=[{"fileName":"/home/pi/steward/steward/node_modules/sonos/lib/sonos.js","lineNumber":91,"functionName":null,"typeName":null,"methodName":null,"columnNumber":35,"native":false},{"fileName":"/home/pi/steward/steward/node_modules/sonos/node_modules/xml2js/lib/xml2js.js","lineNumber":255,"functionName":"","typeName":"Parser","methodName":null,"columnNumber":20,"native":false},{"fileName":"events.js","lineNumber":95,"functionName":"Parser.EventEmitter.emit","typeName":"Parser","methodName":"EventEmitter.emit","columnNumber":17,"native":false},{"fileName":"/home/pi/steward/steward/node_modules/sonos/node_modules/xml2js/lib/xml2js.js","lineNumber":225,"functionName":"Object.saxParser.onclosetag","typeName":"Object","methodName":"saxParser.onclosetag","columnNumber":24,"native":false},{"fileName":"/home/pi/steward/steward/node_modules/sonos/node_modules/xml2js/node_modules/sax/lib/sax.js","lineNumber":615,"functionName":"emit","typeName":"Object","methodName":null,"columnNumber":33,"native":false},{"fileName":"/home/pi/steward/steward/node_modules/sonos/node_modules/xml2js/node_modules/sax/lib/sax.js","lineNumber":620,"functionName":"emitNode","typeName":"Object","methodName":null,"columnNumber":3,"native":false},{"fileName":"/home/pi/steward/steward/node_modules/sonos/node_modules/xml2js/node_modules/sax/lib/sax.js","lineNumber":861,"functionName":"closeTag","typeName":"Object","methodName":null,"columnNumber":5,"native":false},{"fileName":"/home/pi/steward/steward/node_modules/sonos/node_modules/xml2js/node_modules/sax/lib/sax.js","lineNumber":1293,"functionName":"Object.write","typeName":"Object","methodName":"write","columnNumber":29,"native":false},{"fileName":"/home/pi/steward/steward/node_modules/sonos/node_modules/xml2js/lib/xml2js.js","lineNumber":273,"functionName":"Parser.exports.Parser.Parser.parseString","typeName":"Parser","methodName":"exports.Parser.Parser.parseString","columnNumber":29,"native":false},{"fileName":"/home/pi/steward/steward/node_modules/sonos/node_modules/xml2js/lib/xml2js.js","lineNumber":6,"functionName":"Parser.parseString","typeName":"Parser","methodName":"parseString","columnNumber":61,"native":false}] uncaught exception: TypeError: Cannot read property 's:Body' of undefined

mrose17 commented 10 years ago

interesting. could you do me a favor:

turn MARTIAZ back on and run this

    % cd steward/steward
    % node ../scripts/list-ssdp.js

capture the output. let it run until it stops, and then cut-and-paste that. this reports on all the SSDP-discoverable devices on your network. thanks!

after that, you can do this:

    % cd steward # top-level
    % git pull
    % cd steward
    % rm -rf node_modules/sonos
    % npm -l install sonos

then restart the steward and i don't think it will crash… (-;

larryboy44 commented 10 years ago

When I got the MARTIAZ computer running again it doesn't show up in the ssdp log. I've confirmed that the uPnP services are running, and since there was a mention of utorrent in that previous log I started a torrent download and still nothing.

When starting the steward it no longer fails, but that could just be the fix you mentioned in the previous message.

mrose17 commented 10 years ago

that is rather odd. if it's running UPnP, then list-ssdp.js should find it. ok, well, if the problem happens again, please start by running list-ssdp.js and we'll go from there. thanks for your patience!

larryboy44 commented 10 years ago

Did you include a fix for the uncaught exception in that update you asked me to install a few messages ago? And thanks for your help!

On Thu, May 8, 2014 at 8:31 PM, mrose17 notifications@github.com wrote:

that is rather odd. if it's running UPnP, then list-ssdp.js should find it. ok, well, if the problem happens again, please start by running list-ssdp.js and we'll go from there. thanks for your patience!

— Reply to this email directly or view it on GitHubhttps://github.com/TheThingSystem/steward/issues/218#issuecomment-42630460 .

mrose17 commented 10 years ago

i put in a fix for https://github.com/TheThingSystem/steward/issues/219 … i'm still not sure what is going on with this issue...