johnlemonse / homebridge-telldus

36 stars 22 forks source link

TypeError: Cannot read property 'statusCode' of undefined #46

Closed SubZane closed 6 years ago

SubZane commented 6 years ago

When trying to run it after entering all the API keys I get the following unknown error

Any idea?

/usr/lib/node_modules/homebridge-telldus/node_modules/telldus-live/telldus-live.js:221 if (!!err) return callback(err, response.statusCode); ^

TypeError: Cannot read property 'statusCode' of undefined at /usr/lib/node_modules/homebridge-telldus/node_modules/telldus-live/telldus-live.js:221:47 at ClientRequest. (/usr/lib/node_modules/homebridge-telldus/node_modules/oauth/lib/oauth.js:421:9) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:191:7) at TLSSocket.socketErrorListener (_http_client.js:358:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:191:7) at emitErrorNT (net.js:1279:8) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9)

mifi commented 6 years ago

Seems there is a bug in telldus-live npm module that we depend on. https://github.com/TheThingSystem/node-telldus-live/pull/9

Maybe there is something wrong with the network or something? Did you get any more log output?

SubZane commented 6 years ago

It turns out that there was an error in the config.json, maybe a typographic qutationmark or something, because it worked after I ran the config through a jsonlint, formatted it neatly and pasted it back again.

SubZane commented 6 years ago

As it turns out, my raspberry pi also had lost internet connection :P

carlfranzon commented 6 years ago

I got this problem when the Telldus Live! service was down, so it is most likely due to connection issues.

SubZane commented 6 years ago

ah yes that could be it as well. Maybe clearer error reporting could be done? if not, add a faq? :)

mifi commented 6 years ago

Like I said, this is a bug in https://github.com/TheThingSystem/node-telldus-live/pull/9 Seems that project is not being maintained, so we could write a replacement for it, but I don't have time for that now.

I'll add an FAQ 👍

danielkihlgren commented 6 years ago

Should this be closed? I'm often having problems with this since it shuts down my homebridge server. It seems to be fixed in https://github.com/arevenes/node-telldus-live Maybe that should be used instead?

mifi commented 6 years ago

The maintainer of https://github.com/TheThingSystem/node-telldus-live should merge the PR

danielkihlgren commented 6 years ago

It’s merged now