bropat / ioBroker.eusec

This ioBroker adapter allows to control Eufy security devices by connecting to the Eufy cloud servers.
MIT License
132 stars 17 forks source link

Unable to Stay Authenticated #136

Closed ldimaggiott closed 3 years ago

ldimaggiott commented 3 years ago

Describe the bug
Unable to stay authenticated

To Reproduce
Steps to reproduce the behavior:

  1. Create a new instance in ioBroker
  2. Enter credentials
  3. Save and Close
  4. Review Logs

Expected behavior
Should be able to stay authenticated

Screenshots & Logfiles
Logs:

<!--StartFragment-->
host.f1c878cb-iobroker | 2021-05-24 16:17:11.215 | warn | Do not restart adapter system.adapter.eufy-security.0 because restart loop detected
-- | -- | -- | --
host.f1c878cb-iobroker | 2021-05-24 16:17:11.215 | info | Restart adapter system.adapter.eufy-security.0 because enabled
host.f1c878cb-iobroker | 2021-05-24 16:17:11.215 | error | instance system.adapter.eufy-security.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | (1106) DB closed
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at processTicksAndRejections (internal/process/task_queues.js:97:5)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at EufySecurity.setState (/data/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:6069:35)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at StateRedisClient.setState (/data/iobroker/node_modules/@iobroker/db-states-redis/lib/states/statesInRedisClient.js:477:40)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at Redis.get (/data/iobroker/node_modules/ioredis/built/commander.js:111:25)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at Redis.sendCommand (/data/iobroker/node_modules/ioredis/built/redis/index.js:607:24)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | (1106) Error: DB closed
eufy-security.0 | 2021-05-24 16:17:11.188 | error | (1106) unhandled promise rejection: DB closed
eufy-security.0 | 2021-05-24 16:17:11.188 | error | (1106) 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().
eufy-security.0 | 2021-05-24 16:17:11.187 | warn | (1106) get state error: Connection is closed.
eufy-security.0 | 2021-05-24 16:17:11.180 | info | (1106) Disconnected from station T8510Q**********
eufy-security.0 | 2021-05-24 16:17:11.084 | info | (1106) Disconnected from station T8410P**********
eufy-security.0 | 2021-05-24 16:17:10.686 | info | (1106) Disconnected from station T8401P**********
eufy-security.0 | 2021-05-24 16:17:10.548 | info | (1106) Disconnected from station T8010P**********
eufy-security.0 | 2021-05-24 16:17:10.029 | info | (1106) Disconnected from station T8010P**********
eufy-security.0 | 2021-05-24 16:17:09.927 | info | (1106) Disconnected from station T8010P**********
eufy-security.0 | 2021-05-24 16:17:09.799 | info | (1106) Disconnected from station T8010N**********
eufy-security.0 | 2021-05-24 16:17:09.751 | warn | (1106) Terminated (UNCAUGHT_EXCEPTION): Without reason
eufy-security.0 | 2021-05-24 16:17:09.750 | info | (1106) terminating
eufy-security.0 | 2021-05-24 16:17:09.750 | info | (1106) Disconnect from station T8510Q**********
eufy-security.0 | 2021-05-24 16:17:09.750 | info | (1106) Disconnect from station T8410P**********
eufy-security.0 | 2021-05-24 16:17:09.750 | info | (1106) Disconnect from station T8401P**********
eufy-security.0 | 2021-05-24 16:17:09.749 | info | (1106) Disconnect from station T8010P**********
eufy-security.0 | 2021-05-24 16:17:09.749 | info | (1106) Disconnect from station T8010P**********
eufy-security.0 | 2021-05-24 16:17:09.749 | info | (1106) Disconnect from station T8010P**********
eufy-security.0 | 2021-05-24 16:17:09.748 | info | (1106) Disconnect from station T8010N**********
eufy-security.0 | 2021-05-24 16:17:09.585 | error | (1106) Exception-Code: ERR_INVALID_ARG_TYPE: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at Socket.onListening (dgram.js:225:10)
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at Socket.&lt;anonymous&gt; (/data/iobroker/node_modules/eufy-security-client/build/p2p/session.js:228:26)
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at P2PClientProtocol.lookup (/data/iobroker/node_modules/eufy-security-client/build/p2p/session.js:154:29)
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at Array.map (&lt;anonymous&gt;)
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at /data/iobroker/node_modules/eufy-security-client/build/p2p/session.js:154:51
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at P2PClientProtocol.lookupByAddress (/data/iobroker/node_modules/eufy-security-client/build/p2p/session.js:169:33)
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at Object.buildLookupWithKeyPayload (/data/iobroker/node_modules/eufy-security-client/build/p2p/utils.js:35:26)
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at p2pDidToBuffer (/data/iobroker/node_modules/eufy-security-client/build/p2p/utils.js:31:18)
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at stringWithLength (/data/iobroker/node_modules/eufy-security-client/build/p2p/utils.js:22:35)
eufy-security.0 | 2021-05-24 16:17:09.585 | error | at Function.from (buffer.js:330:9)
eufy-security.0 | 2021-05-24 16:17:09.585 | error | (1106) TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
eufy-security.0 | 2021-05-24 16:17:09.585 | error | (1106) uncaught exception: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
eufy-security.0 | 2021-05-24 16:17:09.466 | error | (1106) Station T8510Q********** - Response code not ok [{"code":20028,"msg":"Failed to request."}]
eufy-security.0 | 2021-05-24 16:17:07.303 | info | (1106) Refresh data from cloud and schedule next refresh.
eufy-security.0 | 2021-05-24 16:17:07.210 | info | (1106) starting. Version 0.5.3 in /data/iobroker/node_modules/iobroker.eufy-security, node: v12.21.0, js-controller: 3.2.16
<!--EndFragment-->

Versions:

Additional context
I made sure to sign out of all other devices using the Eufy credentials. Not sure if this matters, but the Eufy credentials I am using are for an account that was granted access to only certain devices (as admin)

bropat commented 3 years ago

Hi @ldimaggiott,

this seems to be a problem with your ioBroker installation:

eufy-security.0 | 2021-05-24 16:17:11.189 | error | (1106) DB closed
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at processTicksAndRejections (internal/process/task_queues.js:97:5)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at EufySecurity.setState (/data/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:6069:35)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at StateRedisClient.setState (/data/iobroker/node_modules/@iobroker/db-states-redis/lib/states/statesInRedisClient.js:477:40)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at Redis.get (/data/iobroker/node_modules/ioredis/built/commander.js:111:25)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | at Redis.sendCommand (/data/iobroker/node_modules/ioredis/built/redis/index.js:607:24)
eufy-security.0 | 2021-05-24 16:17:11.189 | error | (1106) Error: DB closed
eufy-security.0 | 2021-05-24 16:17:11.188 | error | (1106) unhandled promise rejection: DB closed
eufy-security.0 | 2021-05-24 16:17:11.188 | error | (1106) 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().
eufy-security.0 | 2021-05-24 16:17:11.187 | warn | (1106) get state error: Connection is closed.
ldimaggiott commented 3 years ago

Roger that, thanks for pointing me in the right direction! I'll look into it.

ldimaggiott commented 3 years ago

Did a clean install of ioBroker, with a brand new storage mount via:

docker run -d --restart always --name=iobroker -p 8081:8081 -p 8082:8082 -p 8087:8087 -v iobrokerdata:/opt/iobroker buanet/iobroker:latest

As soon as I install and configure ioBroker.eufy-security with my credentials, the same errors return. Not sure how to proceed...

bropat commented 3 years ago

As mentioned above, this is a problem with your installation. Please seek help in the appropriate forum.