bropat / eufy-security-ws

Small server wrapper around eufy-security-client library to access it via a WebSocket.
MIT License
169 stars 24 forks source link

[Bug]: Add-On crashes #273

Closed superpower10 closed 9 months ago

superpower10 commented 9 months ago

Version

1.7.0

Node version

2023.11.1

Operating System type

Docker

Operating system version

Home Assistant

Describe the bug

Updated Home Assistant Eufy Add-On to 1.7.0.

Add-On crashes after starting it. Integration can’t be loaded.

To reproduce

Updated Home Assistant Eufy Add-On to 1.7.0.

Add-On crashes after starting it. Integration can’t be loaded.

Screenshots & Logfiles

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started 2023-11-04 17:48:38.572 INFO Eufy Security server listening on host 0.0.0.0, port 3000 2023-11-04 17:48:41.682 INFO Connected to station T8423N1021300F98 on host 10.200.68.215 and port 13601 node:internal/crypto/cipher:199 const ret = this[kHandle].final(); ^

Error: error:1C80006B:Provider routines::wrong final block length at Decipheriv.final (node:internal/crypto/cipher:199:29) at decryptP2PData (/usr/src/app/node_modules/eufy-security-client/build/p2p/utils.js:101:18) at P2PClientProtocol.handleData (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:1143:67) at P2PClientProtocol.parseDataMessage (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:1121:26) at P2PClientProtocol.handleMsg (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:957:26) at Socket. (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:113:56) at Socket.emit (node:events:517:28) at Socket.emit (node:domain:489:12) at UDP.onMessage [as onmessage] (node:dgram:942:8) { library: 'Provider routines', reason: 'wrong final block length', code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH' }

Node.js v18.18.2 s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

Additional context

None

fuatakgun commented 9 months ago

I would suggest you to remove the addon (not integration) and add it back

ejpenney commented 9 months ago

Also having this issue. Removing and re-adding did not help.

ScratMan commented 9 months ago

Same issue with Docker container.

2023-11-04 17:21:45.106  INFO  Eufy Security server listening on host 0.0.0.0, port 3002 
2023-11-04 17:21:45.286  ERROR Data decryption error, invalidating session data and reconnecting... 
{
  error: {
    cause: undefined,
    message: 'Error: error:1C800064:Provider routines::bad decrypt',
    context: undefined,
    stacktrace: 'Error: error:1C800064:Provider routines::bad decrypt\n' +
      '    at Decipheriv.final (node:internal/crypto/cipher:199:29)\n' +
      '    at decryptAPIData (/usr/src/app/node_modules/eufy-security-client/build/http/utils.js:185:16)\n' +
      '    at HTTPApi.decryptAPIData (/usr/src/app/node_modules/eufy-security-client/build/http/api.js:1077:60)\n' +
      '    at HTTPApi.getPassportProfile (/usr/src/app/node_modules/eufy-security-client/build/http/api.js:1288:46)\n' +
      '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
      '    at async HTTPApi.login (/usr/src/app/node_modules/eufy-security-client/build/http/api.js:377:33)\n' +
      '    at async EufySecurity.connect (/usr/src/app/node_modules/eufy-security-client/build/eufysecurity.js:740:9)\n' +
      '    at async EufySecurityServer.start (/usr/src/app/dist/lib/server.js:413:9)\n' +
      '    at async /usr/src/app/dist/bin/server.js:56:9'
  }
}
2023-11-04 17:21:49.958  INFO  Push notification connection successfully established 
2023-11-04 17:21:51.422  INFO  Connected to station T8134P1023202CFE on host 192.168.1.40 and port 22906 
2023-11-04 17:21:51.714  INFO  Connected to station T8134P102320191A on host 192.168.1.38 and port 14915 
node:internal/crypto/cipher:199
  const ret = this[kHandle].final();
                            ^
Error: error:1C80006B:Provider routines::wrong final block length
    at Decipheriv.final (node:internal/crypto/cipher:199:29)
    at decryptP2PData (/usr/src/app/node_modules/eufy-security-client/build/p2p/utils.js:101:18)
    at P2PClientProtocol.handleData (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:1143:67)
    at P2PClientProtocol.parseDataMessage (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:1121:26)
    at P2PClientProtocol.handleMsg (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:957:26)
    at Socket.<anonymous> (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:113:56)
    at Socket.emit (node:events:517:28)
    at Socket.emit (node:domain:489:12)
    at UDP.onMessage [as onmessage] (node:dgram:942:8) {
  library: 'Provider routines',
  reason: 'wrong final block length',
  code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH'
}
Node.js v18.18.2
2023-11-04 17:24:31.980  INFO  Eufy Security server listening on host 0.0.0.0, port 3002 
2023-11-04 17:24:36.165  INFO  Push notification connection successfully established 
2023-11-04 17:24:38.392  INFO  Connected to station T8134P1023202CFE on host 192.168.1.40 and port 26364 
2023-11-04 17:24:38.512  INFO  Connected to station T8134P102320191A on host 192.168.1.38 and port 13507 
node:internal/crypto/cipher:199
  const ret = this[kHandle].final();
                            ^
Error: error:1C80006B:Provider routines::wrong final block length
    at Decipheriv.final (node:internal/crypto/cipher:199:29)
    at decryptP2PData (/usr/src/app/node_modules/eufy-security-client/build/p2p/utils.js:101:18)
    at P2PClientProtocol.handleData (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:1143:67)
    at P2PClientProtocol.parseDataMessage (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:1121:26)
    at P2PClientProtocol.handleMsg (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:957:26)
    at Socket.<anonymous> (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:113:56)
    at Socket.emit (node:events:517:28)
    at Socket.emit (node:domain:489:12)
    at UDP.onMessage [as onmessage] (node:dgram:942:8) {
  library: 'Provider routines',
  reason: 'wrong final block length',
  code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH'
}
Node.js v18.18.2
fuatakgun commented 9 months ago

Yes i am also having the issue 🤠 had to downgrade as of now

superpower10 commented 9 months ago

@fuatakgun How did you do that (downgrade)?