swissmanu / harmonyhubjs-client

A Node.JS library which allows you to interact with your Logitech Harmony Hub.
https://github.com/swissmanu/harmonyhubjs-client
MIT License
155 stars 42 forks source link

Suddenly getting errors when logging into the hub #28

Closed maddox closed 7 years ago

maddox commented 7 years ago
Hub discovered: Bedroom at 192.168.1.109.
  harmonyhubjs:client:login login on hub 192.168.1.109 +0ms
  harmonyhubjs:client:login:hub perform hub login +0ms
  harmonyhubjs:client:login:hub retrieve identity by logging in as guest +1ms
Hub discovered: Family Room at 192.168.1.106.
  harmonyhubjs:client:login login on hub 192.168.1.106 +19ms
  harmonyhubjs:client:login:hub perform hub login +0ms
  harmonyhubjs:client:login:hub retrieve identity by logging in as guest +0ms
  harmonyhubjs:client:login:hub XMPP client connected +57ms
  harmonyhubjs:client:login:hub received XMPP stanza: <iq xmlns:stream="http://etherx.jabber.org/streams"/> +14ms
  harmonyhubjs:client:login:hub XMPP client connected +3ms
  harmonyhubjs:client:login:hub received XMPP stanza: <iq xmlns:stream="http://etherx.jabber.org/streams"/> +12ms
  harmonyhubjs:client:login:hub received XMPP stanza: <iq id="676771" to="guest" type="get" xmlns:stream="http://etherx.jabber.org/streams"><oa xmlns="connect.logitech.com" mime="vnd.logitech.connect/vnd.logitech.pair" errorcode="200" errorstring="OK"/></iq> +144ms
/Users/jmaddox/source/harmony-api/node_modules/harmonyhubjs-client/lib/login/hub.js:59
      if (response.identity && response.identity !== undefined) {
                  ^

TypeError: Cannot read property 'identity' of undefined
    at Client.<anonymous> (/Users/jmaddox/source/harmony-api/node_modules/harmonyhubjs-client/lib/login/hub.js:59:19)
    at emitOne (events.js:90:13)
    at Client.emit (events.js:182:7)
    at Client._handleStanza (/Users/jmaddox/source/harmony-api/node_modules/node-xmpp-client/lib/Client.js:227:12)
    at Client.onStanza (/Users/jmaddox/source/harmony-api/node_modules/node-xmpp-client/lib/Client.js:221:8)
    at emitOne (events.js:90:13)
    at Connection.emit (events.js:182:7)
    at Connection.onStanza (/Users/jmaddox/source/harmony-api/node_modules/node-xmpp-core/lib/Connection.js:377:10)
    at StreamParser.<anonymous> (/Users/jmaddox/source/harmony-api/node_modules/node-xmpp-core/lib/Connection.js:231:10)
    at emitOne (events.js:90:13)
maddox commented 7 years ago

I think one of the node-xmpp-* packages may have gotten bumped and is causing this crash.

It may be that a bug got fixed there, that this package was not crashing on, and is now crashing on.

maddox commented 7 years ago

I tested for the existence of response on my fork, and it doesn't crash anymore. But it also doesn't log in. It's def getting a bad response on the log in part of this.

dale3h commented 7 years ago

Same issue here:

Starting discovery.
Hub discovered: Harmony Hub at 192.168.1.70.
stanza.children[0].attrs: { xmlns: 'connect.logitech.com',
  mime: 'vnd.logitech.connect/vnd.logitech.pair',
  errorcode: '200',
  errorstring: 'OK' }
BODY: [empty]
/home/dale/node/harmony-api/node_modules/harmonyhubjs-client/lib/login/hub.js:61
      if (response.identity && response.identity !== undefined) {
                  ^

TypeError: Cannot read property 'identity' of undefined
    at Client.<anonymous> (/home/dale/node/harmony-api/node_modules/harmonyhubjs-client/lib/login/hub.js:61:19)
    at emitOne (events.js:77:13)
    at Client.emit (events.js:169:7)
    at Client._handleStanza (/home/dale/node/harmony-api/node_modules/harmonyhubjs-client/node_modules/node-xmpp-client/lib/Client.js:227:12)
    at Client.onStanza (/home/dale/node/harmony-api/node_modules/harmonyhubjs-client/node_modules/node-xmpp-client/lib/Client.js:221:8)
    at emitOne (events.js:77:13)
    at Connection.emit (events.js:169:7)
    at Connection.onStanza (/home/dale/node/harmony-api/node_modules/harmonyhubjs-client/node_modules/node-xmpp-client/node_modules/node-xmpp-core/lib/Connection.js:377:10)
    at StreamParser.<anonymous> (/home/dale/node/harmony-api/node_modules/harmonyhubjs-client/node_modules/node-xmpp-client/node_modules/node-xmpp-core/lib/Connection.js:231:10)
    at emitOne (events.js:77:13)
maddox commented 7 years ago

I tracked the problem down to node-xmpp-client. Anything newer than 3.0.0 breaks. Rolling back and freezing to 3.0.0 makes it work again.

lanzer commented 7 years ago

I'm running xmpp client 3.0.0 but still have no luck. xmpp stanza is at 1.1.0 as listed in package.json

Same error, response body is empty.

maddox commented 7 years ago

@lanzer I'm not sure why. Make sure you rm -Rf node_modules and re run npm install.

swissmanu commented 7 years ago

29 and latest version 1.1.10 should fix this. thanks for a short confirmation.

maddox commented 7 years ago

@swissmanu thanks!

ewgor commented 7 years ago

Hi, this thread is closed? I cannot start the bridge because of some xmpp issue and i followed "@lanzer I'm not sure why. Make sure you rm -Rf node_modules and re run npm install." and i get this errors trying to reinstall npm:

pi@raspberrypi:~ $ sudo rm -Rf node_modules
pi@raspberrypi:~ $ sudo npm install
npm ERR! install Couldn't read dependencies
npm ERR! Linux 4.4.21-v7+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! path /home/pi/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -2
npm ERR! syscall open

npm ERR! package.json ENOENT: no such file or directory, open '/home/pi/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/npm-debug.log

Can anyone please help? Thanks.

swissmanu commented 7 years ago

please check your files. npm ERR! package.json ENOENT: no such file or directory, open '/home/pi/package.json' says there is no package.json in your current directory.