iobroker-community-adapters / ioBroker.unifi-protect

Unifi Protect Adapter for ioBroker
MIT License
21 stars 9 forks source link

Adapter loop und Neustart #99

Open meanwhile28 opened 2 years ago

meanwhile28 commented 2 years ago

Adapter wird neugestartet und looped bei Erkennung von Bewegungen die erkannt werden.

To Reproduce
Bewegung auslösen

Expected behavior
Snapshot wird erstellt und gespeichert.

Logfiles
unifi-protect.0
2022-02-21 18:01:25.377 info 172.16.10.52: Connected to the UniFi realtime update events API.
unifi-protect.0 2022-02-21 18:01:25.344 info 172.16.10.52: Connected to the Protect controller API (address: 172.16.10.52 mac: 784558DECB59).
unifi-protect.0 2022-02-21 18:01:24.267 info starting. Version 0.0.12 in /opt/iobroker/node_modules/iobroker.unifi-protect, node: v12.22.8, js-controller: 3.3.22
host.e88d810f7b56 2022-02-21 18:01:22.203 info instance system.adapter.unifi-protect.0 started with pid 17052
host.e88d810f7b56 2022-02-21 18:00:52.148 info Restart adapter system.adapter.unifi-protect.0 because enabled
host.e88d810f7b56 2022-02-21 18:00:52.147 error instance system.adapter.unifi-protect.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
host.e88d810f7b56 2022-02-21 18:00:52.146 error Caught by controller[1]: at Receiver.getData (/opt/iobroker/node_modules/iobroker.unifi-protect/node_modules/ws/lib/receiver.js:446:17)
host.e88d810f7b56 2022-02-21 18:00:52.146 error Caught by controller[1]: at Receiver.dataMessage (/opt/iobroker/node_modules/iobroker.unifi-protect/node_modules/ws/lib/receiver.js:513:14)
host.e88d810f7b56 2022-02-21 18:00:52.145 error Caught by controller[1]: at Receiver.EventEmitter.emit (domain.js:483:12)
host.e88d810f7b56 2022-02-21 18:00:52.145 error Caught by controller[1]: at Receiver.emit (events.js:314:20)
host.e88d810f7b56 2022-02-21 18:00:52.144 error Caught by controller[1]: at Receiver.receiverOnMessage (/opt/iobroker/node_modules/iobroker.unifi-protect/node_modules/ws/lib/websocket.js:1137:20)
host.e88d810f7b56 2022-02-21 18:00:52.144 error Caught by controller[1]: at WebSocket.EventEmitter.emit (domain.js:483:12)
host.e88d810f7b56 2022-02-21 18:00:52.144 error Caught by controller[1]: at WebSocket.emit (events.js:326:22)
host.e88d810f7b56 2022-02-21 18:00:52.143 error Caught by controller[1]: at WebSocket. (/opt/iobroker/node_modules/iobroker.unifi-protect/protect_api/protect-update-events.js:309:12)
host.e88d810f7b56 2022-02-21 18:00:52.143 error Caught by controller[1]: at ProtectUpdateEvents.motionEventHandler (/opt/iobroker/node_modules/iobroker.unifi-protect/protect_api/protect-update-events.js:365:77)
host.e88d810f7b56 2022-02-21 18:00:52.142 error Caught by controller[1]: at ProtectApi.getFullNameById (/opt/iobroker/node_modules/iobroker.unifi-protect/protect_api/protect-api.js:424:31)
host.e88d810f7b56 2022-02-21 18:00:52.142 error Caught by controller[1]: TypeError: Cannot read property 'find' of null
host.e88d810f7b56 2022-02-21 18:00:52.141 error 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:
unifi-protect.0 2022-02-21 18:00:51.452 warn Terminated (UNCAUGHT_EXCEPTION): Without reason
unifi-protect.0 2022-02-21 18:00:51.448 info terminating
unifi-protect.0 2022-02-21 18:00:51.446 info cleaned everything up...
unifi-protect.0 2022-02-21 18:00:51.407 error Cannot read property 'find' of null
unifi-protect.0 2022-02-21 18:00:51.406 error TypeError: Cannot read property 'find' of null at ProtectApi.getFullNameById (/opt/iobroker/node_modules/iobroker.unifi-protect/protect_api/protect-api.js:424:31) at ProtectUpdateEvents.motionEventHandler (/opt/iobroker/node_modules/iobroker.unifi-protect/protect_api/protect-update-events.js:365:77) at WebSocket. (/opt/iobroker/node_modules/iobroker.unifi-protect/protect_api/protect-update-events.js:309:12) at WebSocket.emit (events.js:326:22) at WebSocket.EventEmitter.emit (domain.js:483:12) at Receiver.receiverOnMessage (/opt/iobroker/node_modules/iobroker.unifi-protect/node_modules/ws/lib/websocket.js:1137:20) at Receiver.emit (events.js:314:20) at Receiver.EventEmitter.emit (domain.js:483:12) at Receiver.dataMessage (/opt/iobroker/node_modules/iobroker.unifi-protect/node_modules/ws/lib/receiver.js:513:14) at Receiver.getData (/opt/iobroker/node_modules/iobroker.unifi-protect/node_modules/ws/lib/receiver.js:446:17)
unifi-protect.0 2022-02-21 18:00:51.389 error unhandled promise rejection: Cannot read property 'find' of null
unifi-protect.0 2022-02-21 18:00:51.387 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().

Versions:

fladdie commented 2 years ago

Ich habe das gleiche Problem

Xenon-s commented 2 years ago

@peterbaumert I have the same problem. The adapter is no longer usable and does not get past a restart loop.

Unifi protect version :1.21.3 JS Controller: 4.0.21 NodeJS : 14.19.1

UPDATE: After I updated the JS controller (4.0.21) and nodeJS (14.19.1) to the latest version and did the iob fix, the adapter is currently green again and works again

luxi-asphericon commented 1 year ago

Hi, muss mich leider anschließen. Hab mir nun extra ne Unifi Chime zugelegt da iobroker nun nicht mehr "klingelt" Ich nutze UniFi OS UDM Pro 2.5.17 Unifi Protect 2.2.11 Unifi Protect Adapter v0.0.13 Node.js: v16.19.0

peterbaumert commented 1 year ago

Will have a look those days, sorry didn't have much free time the past year.

luxi-asphericon commented 1 year ago

Bei mir habe ich das selbe Problem. Dazu kommt das ich alle Bewegungserkennungen der Kameras außer "Ring" deaktiviert habe, trotzdem werden Bewegungen laut Log permanent erfasst. Ich nutze derzeit 14 Kameras und eine Türklingel. `

host.iobroker | 2023-05-30 04:54:28.808 | warn | Do not restart adapter system.adapter.unifi-protect.0 because restart loop detected -- | -- | -- | -- host.iobroker | 2023-05-30 04:54:28.808 | info | Restart adapter system.adapter.unifi-protect.0 because enabled host.iobroker | 2023-05-30 04:54:28.808 | error | instance system.adapter.unifi-protect.0 terminated with code 6 (UNCAUGHT_EXCEPTION) host.iobroker | 2023-05-30 04:54:28.808 | error | Caught by controller[0]: at processTicksAndRejections (node:internal/process/task_queues:95:5) host.iobroker | 2023-05-30 04:54:28.808 | error | Caught by controller[0]: at ProtectApi.launchUpdatesListener (/opt/iobroker/node_modules/iobroker.unifi-protect/protect_api/protect-api.js:177:69) host.iobroker | 2023-05-30 04:54:28.808 | error | Caught by controller[0]: TypeError: Cannot read properties of null (reading 'lastUpdateId') host.iobroker | 2023-05-30 04:54:28.807 | error | 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: unifi-protect.0 | 2023-05-30 04:54:28.258 | warn | Terminated (UNCAUGHT_EXCEPTION): Without reason unifi-protect.0 | 2023-05-30 04:54:28.258 | debug | Plugin sentry destroyed unifi-protect.0 | 2023-05-30 04:54:28.258 | info | terminating unifi-protect.0 | 2023-05-30 04:54:28.258 | info | cleaned everything up... unifi-protect.0 | 2023-05-30 04:54:28.257 | debug | 192.168.1.1: Disconnecting websocket! unifi-protect.0 | 2023-05-30 04:54:28.257 | debug | 192.168.1.1: Clearing Login Credentials! unifi-protect.0 | 2023-05-30 04:54:28.253 | error | Cannot read properties of null (reading 'lastUpdateId') unifi-protect.0 | 2023-05-30 04:54:28.253 | error | TypeError: Cannot read properties of null (reading 'lastUpdateId') at ProtectApi.launchUpdatesListener (/opt/iobroker/node_modules/iobroker.unifi-protect/protect_api/protect-api.js:177:69) at processTicksAndRejections (node:internal/process/task_queues:95:5) unifi-protect.0 | 2023-05-30 04:54:28.252 | error | unhandled promise rejection: Cannot read properties of null (reading 'lastUpdateId') unifi-protect.0 | 2023-05-30 04:54:28.252 | 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(). unifi-protect.0 | 2023-05-30 04:54:28.251 | error | 192.168.1.1: Unable to parse response from UniFi Protect. Will retry again later. unifi-protect.0 | 2023-05-30 04:54:28.251 | error | 192.168.1.1: Controller API connection terminated because it was taking too long. This error can usually be safely ignored.

` @peterbaumert Prima Arbeit vielen Dank