iobroker-community-adapters / ioBroker.unifi

ioBroker.unifi is an ioBroker adapter for your UniFi network devices.
MIT License
74 stars 24 forks source link

Cannot read properties of undefined (reading 'captureException') #689

Open fliegema opened 1 year ago

fliegema commented 1 year ago

Hello, first of all thank you for providing the adapter. It has worked smoothly over the past months. However I get several error messages and the adapter stops.

To Reproduce
Restart instance, reinstalled adapter, reinstalled adapter until version 0.6.0, changed password on controller, used DNS instead of IP, deactivted snyc for Vouchers, Alarm, DPI und Gateway Traffic as per advise from iobroker forum

Expected behavior
A running adapater, however after latest 2mins the adpaters crashes with the below error message in the log which is always the same:

Screenshots & Logfiles
2023-07-13 10:16:56.686 - info: host.ioBroker instance system.adapter.unifi.0 started with pid 1902213 2023-07-13 10:16:57.527 - info: unifi.0 (1902213) Plugin sentry Sentry Plugin disabled for this process because sending of statistic data is disabled for the system 2023-07-13 10:16:57.638 - info: unifi.0 (1902213) starting. Version 0.6.6 in /opt/iobroker/node_modules/iobroker.unifi, node: v18.16.1, js-controller: 4.0.24 2023-07-13 10:16:57.653 - info: unifi.0 (1902213) UniFi adapter is ready 2023-07-13 10:17:03.239 - error: unifi.0 (1902213) [updateUnifiData-login site undefined] error: timeout of 5000ms exceeded, stack: AxiosError: timeout of 5000ms exceeded at RedirectableRequest.handleRequestTimeout (/opt/iobroker/node_modules/node-unifi/node_modules/axios/dist/node/axios.cjs:3047:16) at RedirectableRequest.emit (node:events:513:28) at Timeout.<anonymous> (/opt/iobroker/node_modules/follow-redirects/index.js:169:12) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7) 2023-07-13 10:17:03.239 - error: unifi.0 (1902213) 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-07-13 10:17:03.240 - error: unifi.0 (1902213) unhandled promise rejection: Cannot read properties of undefined (reading 'captureException') 2023-07-13 10:17:03.240 - error: unifi.0 (1902213) TypeError: Cannot read properties of undefined (reading 'captureException') at Unifi.handleError (/opt/iobroker/node_modules/iobroker.unifi/main.js:243:53) at Unifi.updateUnifiData (/opt/iobroker/node_modules/iobroker.unifi/main.js:268:22) 2023-07-13 10:17:03.240 - error: unifi.0 (1902213) Cannot read properties of undefined (reading 'captureException') 2023-07-13 10:17:03.244 - info: unifi.0 (1902213) cleaned everything up... 2023-07-13 10:17:03.244 - info: unifi.0 (1902213) terminating 2023-07-13 10:17:03.245 - warn: unifi.0 (1902213) Terminated (UNCAUGHT_EXCEPTION): Without reason 2023-07-13 10:17:03.827 - error: host.ioBroker instance system.adapter.unifi.0 terminated with code 6 (UNCAUGHT_EXCEPTION) 2023-07-13 10:17:03.827 - info: host.ioBroker Restart adapter system.adapter.unifi.0 because enabled

Versions:

/usr/bin/nodejs         v18.16.1
/usr/bin/node           v18.16.1
/usr/bin/npm            9.5.1
/usr/bin/npx            9.5.1
Architecture    : x86_64
Docker          : false
Virtualization  : lxc
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy
Core adapters versions
js-controller:  4.0.24
admin:          6.3.5
javascript:     7.0.3
Unifi     7.4.162

Additional context
Let me know, how I could assist. It seems like some has the same issue: iobroker forum

UDPATE

After upgrading the controller to the lastest stable release 7.5.174 the issue unfortunatly still persists: 2023-09-06 07:55:39.952 - info: unifi.0 (1761844) Plugin sentry Sentry Plugin disabled for this process because sending of statistic data is disabled for the system 2023-09-06 07:55:40.098 - info: unifi.0 (1761844) starting. Version 0.6.6 in /opt/iobroker/node_modules/iobroker.unifi, node: v18.17.1, js-controller: 4.0.24 2023-09-06 07:55:40.127 - info: unifi.0 (1761844) UniFi adapter is ready 2023-09-06 07:55:47.432 - error: unifi.0 (1761844) [updateUnifiData site wbjsllaj] error: timeout of 5000ms exceeded, stack: AxiosError: timeout of 5000ms exceeded at RedirectableRequest.handleRequestTimeout (/opt/iobroker/node_modules/node-unifi/node_modules/axios/dist/node/axios.cjs:3047:16) at RedirectableRequest.emit (node:events:514:28) at Timeout. (/opt/iobroker/node_modules/follow-redirects/index.js:169:12) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7) 2023-09-06 07:55:47.433 - error: unifi.0 (1761844) 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-09-06 07:55:47.434 - error: unifi.0 (1761844) unhandled promise rejection: Cannot read properties of undefined (reading 'captureException') 2023-09-06 07:55:47.434 - error: unifi.0 (1761844) TypeError: Cannot read properties of undefined (reading 'captureException') at Unifi.handleError (/opt/iobroker/node_modules/iobroker.unifi/main.js:243:53) at Unifi.updateUnifiData (/opt/iobroker/node_modules/iobroker.unifi/main.js:353:30) 2023-09-06 07:55:47.434 - error: unifi.0 (1761844) Cannot read properties of undefined (reading 'captureException') 2023-09-06 07:55:47.436 - info: unifi.0 (1761844) cleaned everything up... 2023-09-06 07:55:47.436 - info: unifi.0 (1761844) terminating 2023-09-06 07:55:47.436 - warn: unifi.0 (1761844) Terminated (UNCAUGHT_EXCEPTION): Without reason 2023-09-06 07:55:47.995 - error: host.ioBroker instance system.adapter.unifi.0 terminated with code 6 (UNCAUGHT_EXCEPTION) 2023-09-06 07:55:47.995 - info: host.ioBroker Restart adapter system.adapter.unifi.0 because enabled 2023-09-06 07:56:18.088 - info: host.ioBroker instance system.adapter.unifi.0 started with pid 1762138 2023-09-06 07:56:18.968 - info: unifi.0 (1762138) Plugin sentry Sentry Plugin disabled for this process because sending of statistic data is disabled for the system 2023-09-06 07:56:19.056 - info: unifi.0 (1762138) starting. Version 0.6.6 in /opt/iobroker/node_modules/iobroker.unifi, node: v18.17.1, js-controller: 4.0.24 2023-09-06 07:56:19.075 - info: unifi.0 (1762138) UniFi adapter is ready

Andr3asB commented 12 months ago

+1 for the exact same issue over here. [edit] some more details:

RP70DP commented 11 months ago

Same here:

2023-08-04 01:07:55.172 - error: unifi.0 (536) [updateUnifiData-login site undefined] error: timeout of 5000ms exceeded, stack: AxiosError: timeout of 5000ms exceeded at RedirectableRequest.handleRequestTimeout (/opt/iobroker/node_modules/node-unifi/node_modules/axios/dist/node/axios.cjs:3047:16) at RedirectableRequest.emit (node:events:513:28) at Timeout.<anonymous> (/opt/iobroker/node_modules/follow-redirects/index.js:169:12) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7) 2023-08-04 01:07:55.204 - error: unifi.0 (536) 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-04 01:07:55.205 - error: unifi.0 (536) unhandled promise rejection: Cannot read properties of undefined (reading 'captureException') 2023-08-04 01:07:55.206 - error: unifi.0 (536) TypeError: Cannot read properties of undefined (reading 'captureException') at Unifi.handleError (/opt/iobroker/node_modules/iobroker.unifi/main.js:243:53) at Unifi.updateUnifiData (/opt/iobroker/node_modules/iobroker.unifi/main.js:268:22) 2023-08-04 01:07:55.207 - error: unifi.0 (536) Cannot read properties of undefined (reading 'captureException') 2023-08-04 01:07:55.213 - info: unifi.0 (536) cleaned everything up... 2023-08-04 01:07:55.213 - info: unifi.0 (536) terminating 2023-08-04 01:07:55.215 - warn: unifi.0 (536) Terminated (UNCAUGHT_EXCEPTION): Without reason 2023-08-04 01:07:55.842 - error: host.iobroker instance system.adapter.unifi.0 terminated with code 6 (UNCAUGHT_EXCEPTION)

Unifi-Adapter: v0.6.6 JS-Controller: v4.0.24 System: Buanet-Docker

fliegema commented 2 months ago

Since there was an update to adapter today, thank you for the work. However the error perssists, here the latest debug log:

`Versions: Nodejs-Installation: /usr/bin/nodejs v18.17.1 /usr/bin/node v18.17.1 /usr/bin/npm 9.6.7 /usr/bin/npx 9.6.7 /usr/local/bin/corepack 0.17.0

Adapter "unifi" : 0.7.0 , installed 0.7.0`

iobroker debug unifi.0 Debugger listening on ws://127.0.0.1:9229/d1a094c0-ba47-4c83-ab23-d2cbb7d4012b For help, see: https://nodejs.org/en/docs/inspector 2024-04-30 14:19:30.673 - debug: unifi.0 (1215234) Redis Objects: Use Redis connection: 0.0.0.0:9001 2024-04-30 14:19:30.739 - debug: unifi.0 (1215234) Objects client ready ... initialize now 2024-04-30 14:19:30.785 - debug: unifi.0 (1215234) Objects create System PubSub Client 2024-04-30 14:19:30.786 - debug: unifi.0 (1215234) Objects create User PubSub Client 2024-04-30 14:19:30.913 - debug: unifi.0 (1215234) Objects client initialize lua scripts 2024-04-30 14:19:30.916 - debug: unifi.0 (1215234) Objects connected to redis: 0.0.0.0:9001 2024-04-30 14:19:30.989 - debug: unifi.0 (1215234) Redis States: Use Redis connection: 0.0.0.0:9000 2024-04-30 14:19:31.035 - debug: unifi.0 (1215234) States create System PubSub Client 2024-04-30 14:19:31.036 - debug: unifi.0 (1215234) States create User PubSub Client 2024-04-30 14:19:31.158 - debug: unifi.0 (1215234) States connected to redis: 0.0.0.0:9000 2024-04-30 14:19:31.225 - debug: unifi.0 (1215234) Plugin sentry Initialize Plugin (enabled=true) 2024-04-30 14:19:31.228 - info: unifi.0 (1215234) Plugin sentry Sentry Plugin disabled for this process because sending of statistic data is disabled for the system 2024-04-30 14:19:31.275 - error: unifi.0 (1215234) adapter disabled 2024-04-30 14:19:31.400 - info: unifi.0 (1215234) starting. Version 0.7.0 in /opt/iobroker/node_modules/iobroker.unifi, node: v18.17.1, js-controller: 5.0.19 2024-04-30 14:19:31.414 - info: unifi.0 (1215234) UniFi adapter is ready 2024-04-30 14:19:31.415 - debug: unifi.0 (1215234) controller = unifi.fliegel.my:8443 2024-04-30 14:19:31.415 - debug: unifi.0 (1215234) updateInterval = 60 2024-04-30 14:19:31.419 - debug: unifi.0 (1215234) Update started 2024-04-30 14:19:41.695 - error: unifi.0 (1215234) [updateUnifiData-login site undefined] error: timeout of 10000ms exceeded, stack: AxiosError: timeout of 10000ms exceeded at RedirectableRequest.handleRequestTimeout (/opt/iobroker/node_modules/axios/dist/node/axios.cjs:3120:16) at RedirectableRequest.emit (node:events:514:28) at Timeout.<anonymous> (/opt/iobroker/node_modules/follow-redirects/index.js:210:12) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7) 2024-04-30 14:19:41.696 - error: unifi.0 (1215234) 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(). 2024-04-30 14:19:41.696 - error: unifi.0 (1215234) unhandled promise rejection: Cannot read properties of undefined (reading 'captureException') 2024-04-30 14:19:41.697 - error: unifi.0 (1215234) TypeError: Cannot read properties of undefined (reading 'captureException') at Unifi.handleError (/opt/iobroker/node_modules/iobroker.unifi/main.js:243:53) at Unifi.updateUnifiData (/opt/iobroker/node_modules/iobroker.unifi/main.js:269:22) 2024-04-30 14:19:41.697 - error: unifi.0 (1215234) Cannot read properties of undefined (reading 'captureException') 2024-04-30 14:19:41.700 - info: unifi.0 (1215234) cleaned everything up... 2024-04-30 14:19:41.700 - info: unifi.0 (1215234) terminating 2024-04-30 14:19:41.701 - debug: unifi.0 (1215234) Plugin sentry destroyed 2024-04-30 14:19:41.701 - warn: unifi.0 (1215234) Terminated (UNCAUGHT_EXCEPTION): Without reason 2024-04-30 14:19:42.202 - info: unifi.0 (1215234) terminating

Let me know, in case further information is required.

Cheers

mcm1957 commented 2 months ago

Thanks for reporting details. But there is no indication at READMEmd that this issue has been fixed. And it isn't fixed yet.

Feuer-sturm commented 2 months ago

with current Unifi Network 8.1.127 and adapter version 0.7.0 the error in the look is like this if new vouchers a triggered

2024-05-23 00:06:07.799 - error: unifi.0 (1664) Error site default (data): {"meta":{"rc":"error","msg":"api.err.InvalidArgs"},"data":[]}
2024-05-23 00:06:07.812 - error: unifi.0 (1664) [createUnifiVouchers site default] error: Request failed with status code 400, stack: AxiosError: Request failed with status code 400
at settle (/opt/iobroker/node_modules/node-unifi/node_modules/axios/lib/core/settle.js:19:12)
at IncomingMessage.handleStreamEnd (/opt/iobroker/node_modules/node-unifi/node_modules/axios/lib/adapters/http.js:585:11)
at IncomingMessage.emit (node:events:529:35)
at IncomingMessage.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1400:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)