virtualzone/landroid-bridge

App - Unhandled exception: SyntaxError: Unexpected token N in JSON at position 0`

Closed this issue · 15 comments

Get the following when trying to run

[2019-04-08T15:23:19.694] [INFO] server.ts - Starting Landroid Bridge... [2019-04-08T15:23:19.721] [INFO] server.ts - Setting port to 3000... [2019-04-08T15:23:20.268] [INFO] Mqtt - Connecting to MQTT Broker... [2019-04-08T15:23:20.296] [INFO] App - Adding static files path /usr/src/landroid-bridge/www [2019-04-08T15:23:20.301] [INFO] Scheduler - Skipping scheduler initialization (not enabled) [2019-04-08T15:23:20.339] [INFO] LandroidS - Initializing Landroid Cloud Service... [2019-04-08T15:23:20.353] [DEBUG] IoBrokerAdapter - UUID: 7a38a2f0-5a01-11e9-95b5-079d9f0c8e78 [2019-04-08T15:23:20.354] [WARN] IoBrokerAdapter - landroid-cloud-2.js will be replaced in next version by mqttCloud.js and worxConfig.js. Reason: better handling of models and mqttCloud supports more brands by a diffent config see also: https://www.npmjs.com/package/iobroker.kress [2019-04-08T15:23:20.357] [DEBUG] IoBrokerAdapter - API token set to *************** [2019-04-08T15:23:20.359] [DEBUG] IoBrokerAdapter - post:{"email":"******@gmail.com","password":"*******","uuid":"**********","type":"app","platform":"android"} [2019-04-08T15:23:20.361] [DEBUG] IoBrokerAdapter - ***************** [2019-04-08T15:23:21.022] [ERROR] App - Unhandled exception: SyntaxError: Unexpected token N in JSON at position 0

I have the same Problem

Landroid have updated their API, and this appears to need the ioBroker.landroid-s package updating in the first instance to version 2.5.5 (see https://github.com/MeisterTR/ioBroker.landroid-s/issues/20)

I've tried doing this locally, and it's successfully retrieved the latest version of the iobroker package, but the error still continues in landroid-bridge.

I think then the old version is still loaded somehow, in my homebridge-landroid plugin the new 2.5.5 version logs in successfully and otherwise works the same.

Also have 2.5.5 but still same error

I have tested it with 2.5.5 and no success either. I think only the new code is updated to the new API. This project is still using landroid-cloud-2.js instead of mqttCloud.js from this project: https://github.com/MeisterTR/ioBroker.landroid-s

I changed the code to use mqttCloud.js instead of the old landroid-cloud-2.js and everything is working again for me!
I created a pull request for this.

I can confirm @stefanlaheij fix fixes this issue, thanks! Closing!

I also confirm that the bridge is coming up for me again on the new 2019 Landroi M500 series. Thanks for the hint guys!

Hm, I am the only one getting the same error again? It worked since april, but now the same error again?

Me too. Worked, and then stopped working 2 days ago.

May 17 19:28:48 hassbian landroid-bridge[1707]: #033[32m[2019-05-17T19:28:48.812] [INFO] server.ts - #033[39mStarting Landroid Bridge... May 17 19:28:48 hassbian landroid-bridge[1707]: #033[32m[2019-05-17T19:28:48.823] [INFO] server.ts - #033[39mSetting port to 3000... May 17 19:28:49 hassbian landroid-bridge[1707]: #033[32m[2019-05-17T19:28:49.130] [INFO] Mqtt - #033[39mConnecting to MQTT Broker... May 17 19:28:49 hassbian landroid-bridge[1707]: #033[32m[2019-05-17T19:28:49.182] [INFO] App - #033[39mAdding static files path /home/homeassistant/landroid-bridge/www May 17 19:28:49 hassbian landroid-bridge[1707]: #033[32m[2019-05-17T19:28:49.184] [INFO] Scheduler - #033[39mSkipping scheduler initialization (not enabled) May 17 19:28:49 hassbian landroid-bridge[1707]: #033[32m[2019-05-17T19:28:49.197] [INFO] LandroidS - #033[39mInitializing Landroid Cloud Service... May 17 19:28:49 hassbian mosquitto[513]: 1558114129: New connection from 127.0.0.1 on port 1883. May 17 19:28:49 hassbian mosquitto[513]: 1558114129: New client connected from 127.0.0.1 as mqttjs_442c4a3c (c1, k60, u'mqtt'). May 17 19:28:49 hassbian landroid-bridge[1707]: #033[32m[2019-05-17T19:28:49.294] [INFO] Mqtt - #033[39mSuccessfully connected to MQTT Broker! May 17 19:28:49 hassbian landroid-bridge[1707]: #033[91m[2019-05-17T19:28:49.480] [ERROR] App - #033[39mUnhandled exception: SyntaxError: Unexpected token < in JSON at position 0

Same here:
Unhandled exception: SyntaxError: Unexpected token < in JSON at position 0

Please try again with the latest version, thanks.

I am now also getting Unhandled exception: SyntaxError: Unexpected token < in JSON at position 0 following a restart of my machine.

I've even removed it entirely and downloaded and configured from scratch.

Yep - I have the same problem with the "Unhandled exception"..
But I am not even using MQTT..