codmpm / node-red-contrib-loxone

Connect the Loxone Miniserver to node-red via the Websocket API
MIT License
74 stars 24 forks source link

uncaught exception on alpha version #32

Closed mabunixda closed 5 years ago

mabunixda commented 5 years ago

Hi,

i got following error today after upgrading to current alpha version of loxone:

4 Sep 13:45:05 - [info] [loxone-miniserver:b6668e.c75e197] Miniserver connected (172.16.0.33:80) using Token-Enc
4 Sep 13:45:05 - [red] Uncaught Exception:
4 Sep 13:45:05 - SyntaxError: Unexpected token $ in JSON at position 559
    at JSON.parse (<anonymous>)
    at new File (/usr/src/node-red/node_modules/node-lox-ws-api/lib/Message/File.js:8:30)
    at Connection.handle_message (/usr/src/node-red/node_modules/node-lox-ws-api/lib/Connection.js:140:39)
    at WebSocketConnection.<anonymous> (/usr/src/node-red/node_modules/node-lox-ws-api/lib/Connection.js:103:14)
    at WebSocketConnection.emit (events.js:189:13)
    at WebSocketConnection.processFrame (/usr/src/node-red/node_modules/websocket/lib/WebSocketConnection.js:554:26)
    at /usr/src/node-red/node_modules/websocket/lib/WebSocketConnection.js:323:40
    at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-red-docker@1.0.0 start: `node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-red-docker@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

its root cause seems to be within lox-ws-api but maybe you can give me a hint to create further debugging input for the component.

codmpm commented 5 years ago

Hey @mabunixda,

thank you. Did not test the alpha, yet. Maybe @alladdin can say something about this, as he is the maintainer of node-lox-ws-api. I'm sure he appreciates detailed debug information.

Can you state you used versions?

Cheers, Patrik

mabunixda commented 5 years ago

I used 10.3.8.28 - at the moment the latest version

codmpm commented 5 years ago

Ok. And which version of nodeJS and node-red, assuming that you use node-red-contrib-loxone 0.10.2 where node-lox-was-api 0.4.4 is used.

mabunixda commented 5 years ago

node-red 0.20.7 node 8.15.1

codmpm commented 5 years ago

Thank you. I've contacted @alladdin via email and hope he will get back soon.

mabunixda commented 5 years ago

I got the lines: "currentUser":{"name":"martin","uuid":"1234","isAdmin":$$isAdmin,"changePassword":$$changePwd,"userRights":$$userRights}

Based on my json skills and some research and validation checks this is not a valid json output . I gonna open a discussion within the beta channel about that development outcome :-(

mabunixda commented 5 years ago

Another program update of the loxone miniserver was necessary - even when the code is unchanged - to fix that problem ... some kind of caching problem within the miniserver :(

codmpm commented 5 years ago

Tahnk you!