Open raintonr opened 1 year ago
Can't see anything immediately obvious but noticed something probably unrelated: In the catch
below there should be a this.socket.close();
before this.reconnect();
. It's like this in the other catch
blocks after the socket is successfully opened and probably forgotten here:
let file: StructureFile;
try {
const fileString = await this.socket.send('data/LoxAPP3.json');
file = JSON.parse(fileString);
} catch (error) {
// do not stringify error, it can contain circular references
this.log.error(`Couldn't get structure file`);
this.reconnect();
return false;
}
looking for help!
host.IoBroker | 2023-01-31 23:34:38.430 | info | "system.adapter.loxone.0" disabled -- | -- | -- | -- host.IoBroker | 2023-01-31 23:34:38.307 | info | Restart adapter system.adapter.loxone.0 because enabled host.IoBroker | 2023-01-31 23:34:38.306 | error | instance system.adapter.loxone.0 terminated with code 6 (UNCAUGHT_EXCEPTION) host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: at processTicksAndRejections (node:internal/process/task_queues:78:11) host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: at flush (/opt/iobroker/node_modules/q/q.js:125:13) host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: at runSingle (/opt/iobroker/node_modules/q/q.js:137:13) host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: at /opt/iobroker/node_modules/q/q.js:624:44 host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: at Promise.promise.promiseDispatch (/opt/iobroker/node_modules/q/q.js:808:41) host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: at Promise.when (/opt/iobroker/node_modules/q/q.js:1142:31) host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: at /opt/iobroker/node_modules/q/q.js:890:30 host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: at _rejected (/opt/iobroker/node_modules/q/q.js:864:24) host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: at _handleBadAuthResponse (/opt/iobroker/node_modules/lxcommunicator/modules/WebSocket.js:336:14) host.IoBroker | 2023-01-31 23:34:38.306 | error | Caught by controller[2]: TypeError: Cannot read properties of undefined (reading '_setAuthenticating') host.IoBroker | 2023-01-31 23:34:38.305 | error | Caught by controller[1]: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason: host.IoBroker | 2023-01-31 23:34:38.305 | error | Caught by controller[0]: WebSocket: socket failed! WS Close Code: 1006 loxone.0 | 2023-01-31 23:34:37.761 | warn | Terminated (UNCAUGHT_EXCEPTION): Without reason loxone.0 | 2023-01-31 23:34:37.759 | info | terminating loxone.0 | 2023-01-31 23:34:37.744 | error | Cannot read properties of undefined (reading '_setAuthenticating') loxone.0 | 2023-01-31 23:34:37.744 | error | TypeError: Cannot read properties of undefined (reading '_setAuthenticating') at _handleBadAuthResponse (/opt/iobroker/node_modules/lxcommunicator/modules/WebSocket.js:336:14) at _rejected (/opt/iobroker/node_modules/q/q.js:864:24) at /opt/iobroker/node_modules/q/q.js:890:30 at Promise.when (/opt/iobroker/node_modules/q/q.js:1142:31) at Promise.promise.promiseDispatch (/opt/iobroker/node_modules/q/q.js:808:41) at /opt/iobroker/node_modules/q/q.js:624:44 at runSingle (/opt/iobroker/node_modules/q/q.js:137:13) at flush (/opt/iobroker/node_modules/q/q.js:125:13) at processTicksAndRejections (node:internal/process/task_queues:78:11) loxone.0 | 2023-01-31 23:34:37.743 | error | unhandled promise rejection: Cannot read properties of undefined (reading '_setAuthenticating') loxone.0 | 2023-01-31 23:34:37.743 | error | Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). loxone.0 | 2023-01-31 23:34:37.738 | error | Couldn't open socket loxone.0 | 2023-01-31 23:34:37.618 | info | Trying to connect loxone.0 | 2023-01-31 23:34:37.541 | info | starting. Version 3.0.0 in /opt/iobroker/node_modules/iobroker.loxone, node: v16.19.0, js-controller: 4.0.24I suspect this will be solved with changed being made for #298.
I suspect this will be solved with changed being made for #298.
Sadly not. I was able to reproduce this even after #298 seems fixed by physically pulling the LAN cable during a reconnect. Hmmmmm...
Awaiting merge in upstream https://github.com/Loxone/lxcommunicator/pull/22
I recently had some nasty stuff going on with our Miniserver which caused the ioBroker Loxone adapter to crash and get stuck in a restart loop. As a result of this restart loop, IOB disabled the adapter and when the Miniserver was fixed our system as a whole still didn't fully recover due to the Loxone adapter being disabled.
Looking at the log, the crash & restart looks like this:
This exception needs catching and the connection attempt retried rather than letting the Loxone adapter die.