Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of null (reading 'get') #622

Closed
brainstorm opened this issue Aug 1, 2022 · 6 comments
Closed

TypeError: Cannot read properties of null (reading 'get') #622

brainstorm opened this issue Aug 1, 2022 · 6 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@brainstorm
Copy link

brainstorm commented Aug 1, 2022

Describe the bug

When re-starting homebridge, occasionally the following fatal error appears, making automatic homebridge-camera-ui auto-respawn harder to automate:

(...)
[7/31/2022, 6:06:59 PM] TypeError: Cannot read properties of null (reading 'get')
    at file:///data/data/com.termux/files/usr/lib/node_modules/homebridge-camera-ui/src/accessories/camera.js:280:57
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[7/31/2022, 6:06:59 PM] TypeError: Cannot read properties of null (reading 'get')
    at file:///data/data/com.termux/files/usr/lib/node_modules/homebridge-camera-ui/src/accessories/camera.js:280:57
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[7/31/2022, 6:06:59 PM] TypeError: Cannot read properties of null (reading 'get')
    at file:///data/data/com.termux/files/usr/lib/node_modules/homebridge-camera-ui/src/accessories/camera.js:280:57
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[7/31/2022, 6:06:59 PM] Got SIGTERM, shutting down Homebridge...
[7/31/2022, 6:07:04 PM] [CameraUI] Galaxy S4 Camera: Setting up camera, please be patient...
[7/31/2022, 6:07:04 PM] [CameraUI] Nexus 4 Camera: Setting up camera, please be patient...
[7/31/2022, 6:07:04 PM] [CameraUI] Homebridge Nexus 4 Camera: Setting up camera, please be patient...
[Nexus 4 Camera E819] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info.
[Homebridge Nexus 4 Camera 2B23] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info.
[Galaxy S4 Camera 3FF7] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info.

To Reproduce

Install LineageOS on a Nexus 4, install termux, nodejs, and npm install homebridge-camera-ui. Add three cameras and perhaps the error above manifests.

Expected behavior

I would expect that homebridge-camera-ui has a consistent state on each (re)start/stop of the service. Or at least that queues are either flushed/discarded upon start to or that .get(s) know how to deal with null or corrupted objects in the queue(s) without shutting down homebridge.

At first I thought that just removing the empty cachedAccessories solved the problem:

~ $ cat ~/.homebridge/accessories/cachedAccessories
[]
~ $ rm ~/.homebridge/accessories/cachedAccessories
~ $ homebridge -D
(...)

But the problem seems to be elsewhere, perhaps some corrupted database entry or queue object?

Environment

  • Node.js Version: v18.4.0
  • Homebridge Version: v1.5.0
  • Camera UI Version:
  $ npm list -g
/data/data/com.termux/files/usr/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
  • Operating System: Linux localhost 3.4.113-lineageos-ge3e5c40db2e SMP PREEMPT Fri Jun 17 03:59:18 MSK 2022 armv7l Android
@stale
Copy link

stale bot commented Sep 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 30, 2022
@stale stale bot closed this as completed Oct 8, 2022
@romeolazar
Copy link

I have this issue. how can I fix this? without reinstalling it from scratch!

@Olivierbkk
Copy link

same here, any fix?

@LemminatorGer
Copy link

Hi
i have the same issue:
Is there an fix anywehere ?
TypeError: Cannot read properties of null (reading 'get') at file:///var/lib/homebridge/node_modules/homebridge-camera-ui/src/accessories/camera.js:280:57 at processTicksAndRejections (node:internal/process/task_queues:95:5)

@brainstorm
Copy link
Author

#896 (comment) seems like a reasonable patch, have you tried it?

@Olivierbkk
Copy link

yes I tried and it seems to work, so far so good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants