johnlemonse / homebridge-telldus

36 stars 22 forks source link

unexpected token C, and crash #52

Closed tvillingett closed 6 years ago

tvillingett commented 6 years ago

I got this tonight, and problems with reconnecting afterwards, I'm a bit bad at interpreting where it went wrong...

From the log of homebridge: 20:01:34 - /user/profile 20:01:34 - { event: 'json', diagnostic: 'Unexpected token C', body: 'Could not select database: telldus_api@olivia.machine.telldus.com' } 20:01:34 - [TelldusLive] Unexpected token C 20:01:34 - You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection: SyntaxError: Unexpected token C at Object.parse (native) at /usr/local/lib/node_modules/homebridge-telldus/node_modules/telldus-live/telldus-live.js:223:28 at passBackControl (/usr/local/lib/node_modules/homebridge-telldus/node_modules/oauth/lib/oauth.js:390:11) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-telldus/node_modules/oauth/lib/oauth.js:409:9) at emitNone (events.js:72:20) at IncomingMessage.emit (events.js:166:7) at endReadableNT (_stream_readable.js:893:12) at doNTCallback2 (node.js:429:9) at process._tickDomainCallback (node.js:384:17)

mifi commented 6 years ago

I was also unable to turn off my light when i left tonight. Turns out telldus live is down. https://live.telldus.com shows: Could not select database: telldus_live@olivia.machine.telldus.com

mifi commented 6 years ago

It's working for me now. Regarding the crash, you should run homebridge in pm2 or similar to auto restart on crash.