birkir / homebridge-plugin-eufy-security

Eufy security homebridge plugin
Apache License 2.0
85 stars 18 forks source link

Hard Crash - TypeError [ERR_INVALID_ARG_TYPE] #21

Open focher opened 3 years ago

focher commented 3 years ago

Describe The Bug:

To Reproduce:

  1. Install homebridge-plugin-eufy-security v0.1.6 from Homebridge UI.
  2. Restart server.
  3. Homebridge hard crashes and restarts from the error.

Expected behavior:

Startup occurs without error and Homebridge continues to run.

Logs:

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
    at Hash.update (internal/crypto/hash.js:84:11)
    at Object.generate (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/uuid.ts:9:11)
    at PushClient.callback (/homebridge/node_modules/homebridge-plugin-eufy-security/src/platform.ts:128:46)
    at PushClient.handleParsedMessage (/homebridge/node_modules/homebridge-plugin-eufy-security/node_modules/eufy-node-client/build/push/push-client.service.js:206:26)
    at PushClientParser.<anonymous> (/homebridge/node_modules/homebridge-plugin-eufy-security/node_modules/eufy-node-client/build/push/push-client.service.js:103:63)
    at PushClientParser.emit (events.js:315:20)
    at PushClientParser.onGotMessageBytes (/homebridge/node_modules/homebridge-plugin-eufy-security/node_modules/eufy-node-client/build/push/push-client-parser.service.js:150:14)
    at PushClientParser.handleFullMessage (/homebridge/node_modules/homebridge-plugin-eufy-security/node_modules/eufy-node-client/build/push/push-client-parser.service.js:79:22)
    at PushClientParser.waitForData (/homebridge/node_modules/homebridge-plugin-eufy-security/node_modules/eufy-node-client/build/push/push-client-parser.service.js:64:18)
    at PushClientParser.onGotMessageSize (/homebridge/node_modules/homebridge-plugin-eufy-security/node_modules/eufy-node-client/build/push/push-client-parser.service.js:124:18)
[12/25/20

Plugin Config:

        {
            "username": "-login-",
            "password": "-password-",
            "enablePush": true,
            "platform": "EufySecurityHomebridgePlugin"
        }

Screenshots:

Environment:

mariusstrom commented 3 years ago

I have the exact same issue on a build just installed yesterday, experiencing it under HOOBS 3.3.2.

Tscherno commented 3 years ago

Same here. Just installed it the first time. Any workaround?

ivangotti commented 3 years ago

Same issue here

PeterAlexander75 commented 3 years ago

Try the instructions in this post

https://github.com/birkir/homebridge-plugin-eufy-security/issues/45#issuecomment-843199774

You need to update eufy-node-client in the node_modules directory, which lies within the homebridge-plugin-eufy-security plugin. Note that note only does homebridge have a node_modules directory, but each plugin does, too.