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 'productName') #19

Open
rooska opened this issue Jun 21, 2022 · 3 comments
Open

TypeError: Cannot read properties of null (reading 'productName') #19

rooska opened this issue Jun 21, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@rooska
Copy link

rooska commented Jun 21, 2022

Describe The Bug:

Plugin frequently errors, closes child bridge with TypeError: Cannot read properties of null (reading 'productName')
This seems to occurs quite frequently with the most recent update to 0.2.3 and appears occur less frequently after a downgrade to a previous version (0.2.2 or older).

To Reproduce:

Update to the 0.2.3 and wait. Usually within less than 5 minutes of starting up, the error will occur, it crashes the child bridge this plugin is on, and the child bridge restarts. This can occur once, or multiple times depending on how much the plugin is being used by HomeKit

Expected behavior:

The Lifx Plugin will not error and restart.

Logs:

[6/20/2022, 10:28:22 AM] [Lifx] Bulb  throughs error setHardwareInformationError: No LIFX response in time

/usr/local/lib/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/lib/lifx/light.js:279
      return callback(err, null);
             ^
TypeError: Cannot read properties of null (reading 'productName')
    at /usr/local/lib/node_modules/homebridge-lifx-plugin/src/bulb.ts:32:64
    at /usr/local/lib/node_modules/homebridge-lifx-plugin/src/bulb.ts:104:7
    at /usr/local/lib/node_modules/homebridge-lifx-plugin/src/bulb.ts:122:7
    at Client.<anonymous> (/usr/local/lib/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/lib/lifx/light.js:279:14)
    at Client.<anonymous> (/usr/local/lib/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/lib/lifx/client.js:466:24)
    at Array.forEach (<anonymous>)
    at Client.processMessageHandlers (/usr/local/lib/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/lib/lifx/client.js:438:24)
    at Client.<anonymous> (/usr/local/lib/node_modules/homebridge-lifx-plugin/node_modules/lifx-lan-client/lib/lifx/client.js:238:12)
    at Socket.emit (node:events:527:28)
    at UDP.onMessage (node:dgram:922:8)

Plugin Config:

        {
            "name": "Lifx",
            "duration": 0,
            "brightnessDuration": 300,
            "colorDuration": 300,
            "default": "0.0.0.0",
            "broadcast": "10.0.1.255",
            "lightOfflineTolerance": 3,
            "messageHandlerTimeout": 45000,
            "resendPacketDelay": 150,
            "resendMaxTimes": 3,
            "updates": true,
            "debug": false,
            "autoDiscover": true,
            "platform": "LifxPlugin",
            "_bridge": {
                "username": "XX:XX:XX:XX:XX:XX",
                "port": XXXXX
            }

Screenshots:

None

Environment:

  • Plugin Version:
    • 0.2.3
  • Homebridge Version:
    • 1.4.1
  • Node.js Version:
    • 16.15.1
  • NPM Version:
    • 8.11.0
  • Operating System:
    • MacOS 10.13.6
@rooska rooska added the bug Something isn't working label Jun 21, 2022
@calvarium
Copy link
Owner

Hi @rooska,

I'm trying to figure out what's happening in your network as I'm currently not having any of these explained issues working on the same configuration as you.
How many and what kind of bulbs do you have installed currently? What about the firmware of these bulbs? Can you assure that your network is not blocking any of these pulling activities from your bulbs as this function who is throwing these exception is so rudimental that this error should not occur normally.

Nevertheless, there will be a fix for this bug in the next version. However, this bug should also occur in the previous versions of the plugin

@rooska
Copy link
Author

rooska commented Jun 21, 2022

  • How many and what kind of bulbs do you have installed currently?

    • 28 bulbs total, and as a side note, I have accumulated this collection over many years, so even though all the night vision A19 bulbs look the same, and the night vision BR30 bulbs look the same, and the LIFX mini bulbs look the same, some have different model numbers in the app:
      • 15 LIFX Mini C bulbs
      • 2 LIFX NV BR30 1100 lm
      • 1 LIFX + (BR30) LCM3
      • 1 LIFX + (BR30)
      • 8 LIFX NV A19 1100 lm
      • 1 LIFX + (A19)
  • What about the firmware of these bulbs?

    • My LIFX app shows that all firmware is up to date for my bulbs.
      • 15 LIFX Mini C bulbs
        • v3.60
      • 2 LIFX NV BR30 1100 lm
        • v3.70
      • 1 LIFX + (BR30) LCM3
        • v3.60
      • 1 LIFX + (BR30)
        • v2.80
      • 8 LIFX NV A19 1100 lm
        • v3.70
      • 1 LIFX + (A19)
        • v2.80
  • Can you assure that your network is not blocking any of these pulling activities from your bulbs as this function who is throwing these exception is so rudimental that this error should not occur normally.

    • I've tweaked my ASUS router many times, but not recently, to help the bulbs maintain connectivity on the 2.4 GHz network. I'm not sure what else to troubleshoot here, but am open to suggestions if you have ones to share.
  • This bug should also occur in the previous versions of the plugin.

    • The fact that I seem to notice less occurrences of this error in previous versions could totally be in my head. My perception and likely the Mandela Effect.

@emroch
Copy link

emroch commented Jun 27, 2022

I was able to reliably reproduce this with a LIFX Z lightstrip on v0.2.3. I observe the plugin working fine with 2x LIFX Color 800lm A19 bulbs (FW v3.70), but as soon as I set up the LIFX Z (FW v3.80) it enters a reboot loop. I can resolve the loop by adding the lightstrip to the excludes in the plugin settings and it becomes stable. As soon as I remove the exclude and restart the plugin, it resumes crashing.

Here's a paste of the log with debug mode active (sorry if the communication logs are just noise). My order of operations was this:

  1. Start with debug off and lightstrip excluded. Restart plugin and truncate logs.
  2. Remove exclusion and enable debug, then save the config and restart the plugin (not Homebridge, to avoid other plugins from restarting)
  3. Observe crash
  4. Re-add exclusion and restart plugin again.
  5. Observe stable plugin

https://pastebin.com/bAfwuZxv

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

No branches or pull requests

3 participants