codmpm / node-red-contrib-loxone

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

Facing TypeError (Cannot read property 'uri' of undefined) after upgrade #69

Closed hoschult closed 2 years ago

hoschult commented 2 years ago

Hi all,

after upgrading my node red instance to latest version, I receive errors from loxone module - see below.... After throwing the error, node-red instance stopped.

error in syslog:

Feb 26 14:36:37 raspimain Node-RED[1728]: 26 Feb 14:36:37 - [error] TypeError: Cannot read property 'uri' of undefined
Feb 26 14:36:37 raspimain Node-RED[1728]:     at API.<anonymous> (/home/pi/.node-red/node_modules/node-red-contrib-loxone/loxone/loxone.js:222:37)
Feb 26 14:36:37 raspimain Node-RED[1728]:     at API.emit (events.js:314:20)
Feb 26 14:36:37 raspimain Node-RED[1728]:     at Connection.<anonymous> (/home/pi/.node-red/node_modules/node-lox-ws-api/lib/API.js:119:14)
Feb 26 14:36:37 raspimain Node-RED[1728]:     at Connection.emit (events.js:314:20)
Feb 26 14:36:37 raspimain Node-RED[1728]:     at Connection.handle_message (/home/pi/.node-red/node_modules/node-lox-ws-api/lib/Connection.js:174:18)
Feb 26 14:36:37 raspimain Node-RED[1728]:     at WebSocketConnection.<anonymous> (/home/pi/.node-red/node_modules/node-lox-ws-api/lib/Connection.js:140:14)
Feb 26 14:36:37 raspimain Node-RED[1728]:     at WebSocketConnection.emit (events.js:314:20)
Feb 26 14:36:37 raspimain Node-RED[1728]:     at WebSocketConnection.processFrame (/home/pi/.node-red/node_modules/node-lox-ws-api/node_modules/websocket/lib/WebSocketConnection.js:554:26)
Feb 26 14:36:37 raspimain Node-RED[1728]:     at /home/pi/.node-red/node_modules/node-lox-ws-api/node_modules/websocket/lib/WebSocketConnection.js:323:40
Feb 26 14:36:37 raspimain Node-RED[1728]:     at processTicksAndRejections (internal/process/task_queues.js:79:11)
Feb 26 14:36:37 raspimain systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE

Any ideas where I can look into to resolve this issue?

codmpm commented 2 years ago

Hey,

seems to be a problem with ws-lox-api. We will have a look into this. Could you maybe post your current nodeJS and node-red version?

Best, Patrik

hoschult commented 2 years ago

Hi Patrik,

thx. Good question... I restored the whole .node-red directory and did the upgrade once again. After this procedure, loxone connectivity came back and error disappeared. So maybe the error was triggered by an inconsistent upgrade (only guessing). In the actual setup, no problems are occurring. Versions are:

Feb 28 11:09:06 raspimain Node-RED[30706]: 28 Feb 11:09:06 - [info] Node-RED version: v2.2.2 Feb 28 11:09:06 raspimain Node-RED[30706]: 28 Feb 11:09:06 - [info] Node.js version: v12.22.6 Feb 28 11:09:06 raspimain Node-RED[30706]: 28 Feb 11:09:06 - [info] Linux 5.10.63-v7l+ arm LE Feb 28 11:09:08 raspimain Node-RED[30706]: 28 Feb 11:09:08 - [info] Loading palette nodes

Holger

codmpm commented 2 years ago

Could you get me the output of node -v?

So currently everything works?

hoschult commented 2 years ago

here we go:

pi@raspimain:~ $ node -v v12.22.6

Yes, currently all works fine - thx for your support!

codmpm commented 2 years ago

Ok. Will have an eye on that. Get back to me if you the problem occurs again.

Aledan862 commented 2 years ago

Hello, I have same issue.

[14:26:28] INFO: Starting NGinx...
5 Sep 14:26:28 - [info] [loxone-miniserver:1372a7129dd04670] Miniserver connected (192.168.100.222:80) using Token-Enc
5 Sep 14:26:28 - [red] Uncaught Exception:
5 Sep 14:26:28 - [error] TypeError: Cannot read properties of undefined (reading 'uri')
    at API.<anonymous> (/config/node-red/node_modules/node-red-contrib-loxone/loxone/loxone.js:222:37)
    at API.emit (node:events:527:28)
    at Connection.<anonymous> (/config/node-red/node_modules/node-lox-ws-api/lib/API.js:119:14)
    at Connection.emit (node:events:527:28)
    at Connection.handle_message (/config/node-red/node_modules/node-lox-ws-api/lib/Connection.js:174:18)
    at WebSocketConnection.<anonymous> (/config/node-red/node_modules/node-lox-ws-api/lib/Connection.js:140:14)
    at WebSocketConnection.emit (node:events:527:28)
    at WebSocketConnection.processFrame (/config/node-red/node_modules/websocket/lib/WebSocketConnection.js:554:26)
    at /config/node-red/node_modules/websocket/lib/WebSocketConnection.js:323:40
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
[14:26:29] WARNING: Node-RED crashed, halting add-on
s6-rc: info: service legacy-services: stopping

Tried to reinstall addon, also tried to restore from backup. Nothing helped.