Grizzelbee/ioBroker.robonect

Adapter will not start

Closed this issue · 7 comments

Describe the bug
The adapter crashes immediately after startup.
Adapter version 0.1.4 was working fine.
I did an upgrade and a fresh installation with the same result.
I tried JS 4 and 5 with the same result.

To Reproduce
Start adapter

Expected behavior
Adapter will start

Screenshots & Logfiles

Log:

2023-08-18 14:13:47.910 - info: host.iobdev instance system.adapter.robonect.0 started with pid 7628
2023-08-18 14:13:50.054 - info: robonect.0 (7628) starting. Version 1.0.2 in /opt/iobroker/node_modules/iobroker.robonect, node: v16.20.2, js-controller: 5.0.11
2023-08-18 14:13:50.092 - info: robonect.0 (7628) Rest period 1 not configured. Period will be ignored.
2023-08-18 14:13:50.093 - info: robonect.0 (7628) Rest period 2 not configured. Period will be ignored.
2023-08-18 14:13:52.193 - error: robonect.0 (7628) Axios says: AxiosError: Request failed with status code 401
2023-08-18 14:13:52.195 - error: robonect.0 (7628) updateRobonectData: AxiosError: Request failed with status code 401
2023-08-18 14:13:52.819 - error: robonect.0 (7628) Axios says: AxiosError: Request failed with status code 401
2023-08-18 14:13:52.821 - error: robonect.0 (7628) 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().
2023-08-18 14:13:52.822 - error: robonect.0 (7628) unhandled promise rejection: Request failed with status code 401
2023-08-18 14:13:53.000 - error: robonect.0 (7628) AxiosError: Request failed with status code 401
at settle (/opt/iobroker/node_modules/iobroker.robonect/node_modules/axios/lib/core/settle.js:19:12)
at IncomingMessage.handleStreamEnd (/opt/iobroker/node_modules/iobroker.robonect/node_modules/axios/lib/adapters/http.js:570:11)
at IncomingMessage.emit (node:events:525:35)
at IncomingMessage.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
2023-08-18 14:13:53.001 - error: robonect.0 (7628) Exception-Code: ERR_BAD_REQUEST: Request failed with status code 401
2023-08-18 14:13:53.054 - info: robonect.0 (7628) cleaned everything up...
2023-08-18 14:13:53.055 - info: robonect.0 (7628) terminating
2023-08-18 14:13:53.057 - warn: robonect.0 (7628) Terminated (UNCAUGHT_EXCEPTION): Without reason
2023-08-18 14:13:53.560 - info: robonect.0 (7628) terminating
2023-08-18 14:13:53.611 - error: host.iobdev Caught by controller[0]: 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:
2023-08-18 14:13:53.612 - error: host.iobdev Caught by controller[1]: AxiosError: Request failed with status code 401
2023-08-18 14:13:53.612 - error: host.iobdev Caught by controller[1]: at settle (/opt/iobroker/node_modules/iobroker.robonect/node_modules/axios/lib/core/settle.js:19:12)
2023-08-18 14:13:53.612 - error: host.iobdev Caught by controller[1]: at IncomingMessage.handleStreamEnd (/opt/iobroker/node_modules/iobroker.robonect/node_modules/axios/lib/adapters/http.js:570:11)
2023-08-18 14:13:53.612 - error: host.iobdev Caught by controller[1]: at IncomingMessage.emit (node:events:525:35)
2023-08-18 14:13:53.613 - error: host.iobdev Caught by controller[1]: at IncomingMessage.emit (node:domain:489:12)
2023-08-18 14:13:53.613 - error: host.iobdev Caught by controller[1]: at endReadableNT (node:internal/streams/readable:1358:12)
2023-08-18 14:13:53.613 - error: host.iobdev Caught by controller[1]: at processTicksAndRejections (node:internal/process/task_queues:83:21)
2023-08-18 14:13:53.613 - error: host.iobdev instance system.adapter.robonect.0 terminated with code 6 (UNCAUGHT_EXCEPTION)

Configuration:

{
  "statusInterval": "60",
  "infoInterval": "900",
  "restPeriod1Start": "",
  "restPeriod1End": "",
  "restPeriod2Start": "",
  "restPeriod2End": "",
  "batteryPollType": "Info",
  "doorPollType": "NoPoll",
  "errorsPollType": "NoPoll",
  "extensionPollType": "NoPoll",
  "gpsPollType": "NoPoll",
  "hoursPollType": "NoPoll",
  "motorPollType": "NoPoll",
  "portalPollType": "NoPoll",
  "pushPollType": "NoPoll",
  "timerPollType": "NoPoll",
  "versionPollType": "Info",
  "weatherPollType": "NoPoll",
  "wlanPollType": "NoPoll",
  "robonectIp": "192.168.171.67",
  "username": "chantalle",
  "password": "xxxxxxx",
  "pushService": false,
  "pushServiceIp": "192.168.x.x",
  "pushServicePort": 55443
}

Versions:

  • 1.0.2
  • JS-Controller version: 5.0.11
  • Node version: v16.20.2
  • Linux

Additional context
Add any other context about the problem here.

The adapter crashed at startup only if polling of door or portal data is active:

Door

2023-08-19 13:47:50.399  - info: robonect.0 (117850) starting. Version 1.0.2 in /opt/iobroker/node_modules/iobroker.robonect, node: v18.17.1, js-controller: 5.0.12
2023-08-19 13:47:50.421  - info: robonect.0 (117850) Rest period 1 not configured. Period will be ignored.
2023-08-19 13:47:50.422  - info: robonect.0 (117850) Rest period 2 not configured. Period will be ignored.
2023-08-19 13:47:51.152  - info: robonect.0 (117850) Server for Robonect push-service is listening on http://0.0.0.0:55443
2023-08-19 13:47:51.335  - error: robonect.0 (117850) Axios says: Error: Something went wrong
2023-08-19 13:47:51.336  - error: robonect.0 (117850) 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().
2023-08-19 13:47:51.336  - error: robonect.0 (117850) unhandled promise rejection: Something went wrong
2023-08-19 13:47:51.338  - error: robonect.0 (117850) Error: Something went wrong
    at /opt/iobroker/node_modules/iobroker.robonect/main.js:409:35
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-08-19 13:47:51.339  - error: robonect.0 (117850) Something went wrong
2023-08-19 13:47:51.350  - info: robonect.0 (117850) cleaned everything up...
2023-08-19 13:47:51.350  - info: robonect.0 (117850) terminating
2023-08-19 13:47:51.351  - warn: robonect.0 (117850) Terminated (UNCAUGHT_EXCEPTION): Without reason
2023-08-19 13:47:51.852  - info: robonect.0 (117850) terminating
2023-08-19 13:47:51.957  - error: host.pve-ct-iobroker Caught by controller[0]: 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:
2023-08-19 13:47:51.958  - error: host.pve-ct-iobroker Caught by controller[1]: Error: Something went wrong
2023-08-19 13:47:51.958  - error: host.pve-ct-iobroker Caught by controller[1]:     at /opt/iobroker/node_modules/iobroker.robonect/main.js:409:35
2023-08-19 13:47:51.958  - error: host.pve-ct-iobroker Caught by controller[1]:     at processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-08-19 13:47:51.958  - error: host.pve-ct-iobroker instance system.adapter.robonect.0 terminated with code 6 (UNCAUGHT_EXCEPTION)

Portal

2023-08-19 13:56:48.312  - info: robonect.0 (121490) starting. Version 1.0.2 in /opt/iobroker/node_modules/iobroker.robonect, node: v18.17.1, js-controller: 5.0.12
2023-08-19 13:56:48.331  - info: robonect.0 (121490) Rest period 1 not configured. Period will be ignored.
2023-08-19 13:56:48.331  - info: robonect.0 (121490) Rest period 2 not configured. Period will be ignored.
2023-08-19 13:56:48.950  - info: robonect.0 (121490) Server for Robonect push-service is listening on http://0.0.0.0:55443
2023-08-19 13:56:51.548  - error: robonect.0 (121490) Axios says: Error: Something went wrong
2023-08-19 13:56:51.549  - error: robonect.0 (121490) 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().
2023-08-19 13:56:51.550  - error: robonect.0 (121490) unhandled promise rejection: Something went wrong
2023-08-19 13:56:51.554  - error: robonect.0 (121490) Error: Something went wrong
    at /opt/iobroker/node_modules/iobroker.robonect/main.js:409:35
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-08-19 13:56:51.554  - error: robonect.0 (121490) Something went wrong
2023-08-19 13:56:51.564  - info: robonect.0 (121490) cleaned everything up...
2023-08-19 13:56:51.564  - info: robonect.0 (121490) terminating
2023-08-19 13:56:51.565  - warn: robonect.0 (121490) Terminated (UNCAUGHT_EXCEPTION): Without reason
2023-08-19 13:56:52.065  - info: robonect.0 (121490) terminating
2023-08-19 13:56:52.182  - error: host.pve-ct-iobroker Caught by controller[0]: 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:
2023-08-19 13:56:52.183  - error: host.pve-ct-iobroker Caught by controller[1]: Error: Something went wrong
2023-08-19 13:56:52.183  - error: host.pve-ct-iobroker Caught by controller[1]:     at /opt/iobroker/node_modules/iobroker.robonect/main.js:409:35
2023-08-19 13:56:52.183  - error: host.pve-ct-iobroker Caught by controller[1]:     at processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-08-19 13:56:52.183  - error: host.pve-ct-iobroker instance system.adapter.robonect.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
2023-08-19 13:56:56.207  - info: kecontact.0 (80680) minimum regard time of 60sec not reached, continuing charging session

I cannot confirm this: please see my configuration above - door and portal polling is off.

ok lets compare:

Adapter version: 1.0.2
JS-Controller version: 5.0.12
Node version: v18.17.1
NPM version: 9.6.7
Linux

My standard config, only battery, erros and weather are polled - adapter starts without any error:
{ "statusInterval": "60", "infoInterval": "900", "restPeriod1Start": "", "restPeriod1End": "", "restPeriod2Start": "", "restPeriod2End": "", "batteryPollType": "Status", "errorsPollType": "Status", "extensionPollType": "NoPoll", "gpsPollType": "NoPoll", "hoursPollType": "NoPoll", "motorPollType": "NoPoll", "portalPollType": "NoPoll", "pushPollType": "NoPoll", "timerPollType": "NoPoll", "versionPollType": "NoPoll", "weatherPollType": "Status", "wlanPollType": "NoPoll", "robonectIp": "10.3.1.14", "username": "", "password": "", "doorPollType": "NoPoll", "pushService": true, "pushServiceIp": "0.0.0.0", "pushServicePort": 55443 }

Your configuration doesn't contain username/password - because I have robonect firmware 1.3b it is necessary to specify it for security reason. This behaviour is pointing to my error http 403 error, which is access denied.
Could you try your configuration with username, because my robonect version doesn't allow blank username?

@fritz47110815
I am also using FW 1.3b with username and password and it's working fine - as long as I keep the password in 7-byte ASCII code. Means: only smal and capital letters and numbers. Spechial characters like / # ... are forbitten. Maybe this is your issue. Please try to use a password like this.

@darkiop
I just released a the version 1.0.3 with better error handling.
Please give it a try; maybe - if nessecary - in debug mode to get better log results.
Please install directly from github.

@both:
I think you are facing diffrent issues.

Your configuration doesn't contain username/password - because I have robonect firmware 1.3b it is necessary to specify it for security reason. This behaviour is pointing to my error http 403 error, which is access denied.
Could you try your configuration with username, because my robonect version doesn't allow blank username?

I removed user and password before posting the answer ;)

Firmware on robonect is also 1.3.

Where's the hole I can hide in? Copying 10 times the wrong password doesn't make it better.
@Grizzelbee Maybe you could add the used connect string into the catch section of the axios.get operation?