matijse / eufy-ha-mqtt-bridge

Receive Eufy alerts and thumbnails in Home Assistant via MQTT
124 stars 25 forks source link

EHOSTUNREACH on 20 seconds after initialise #64

Closed Aspyryan closed 3 years ago

Aspyryan commented 3 years ago

Whenever I docker run the image, the container shows up for a couple of seconds (about 20) and after it disappears. These are my error files:

combined.log:

{"message":"Migrating the database...","level":"info","timestamp":"2021-04-21T17:56:36.876Z"}
{"message":"---- EUFY INITIALIZE START ----","level":"debug","timestamp":"2021-04-21T17:56:36.896Z"}
{"message":"----  Created classes...","level":"debug","timestamp":"2021-04-21T17:56:36.897Z"}
{"message":"Refreshing devices...","level":"debug","timestamp":"2021-04-21T17:56:36.898Z"}
{"name":"RequestError","code":"EHOSTUNREACH","timings":{"start":1619027796958,"socket":1619027796965,"lookup":1619027802014,"error":1619027805150,"phases":{"wait":7,"dns":5049,"total":8192}},"level":"error","message":"Error -- httpService.listDevices connect EHOSTUNREACH 52.15.142.90:443","stack":"RequestError: connect EHOSTUNREACH 52.15.142.90:443\n    at ClientRequest.<anonymous> (/app/node_modules/got/dist/source/core/index.js:956:111)\n    at Object.onceWrapper (events.js:422:26)\n    at ClientRequest.emit (events.js:327:22)\n    at ClientRequest.origin.emit (/app/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)\n    at TLSSocket.socketErrorListener (_http_client.js:469:9)\n    at TLSSocket.emit (events.js:315:20)\n    at emitErrorNT (internal/streams/destroy.js:106:8)\n    at emitErrorCloseNT (internal/streams/destroy.js:74:3)\n    at processTicksAndRejections (internal/process/task_queues.js:80:21)\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)","timestamp":"2021-04-21T17:56:45.162Z"}
{"message":"----  Refreshed devices","level":"debug","timestamp":"2021-04-21T17:56:45.168Z"}
{"message":"----  Set up MQTT handler","level":"debug","timestamp":"2021-04-21T17:56:45.168Z"}
{"message":"Subscribed to homeassistant/status","level":"debug","timestamp":"2021-04-21T17:56:45.302Z"}
{"message":"----  Connected to MQTT","level":"debug","timestamp":"2021-04-21T17:56:45.303Z"}
{"message":"----  Set up auto discovery","level":"debug","timestamp":"2021-04-21T17:56:50.319Z"}
{"message":"No credentials found -> register new...","level":"info","timestamp":"2021-04-21T17:56:50.321Z"}

error.log:

{"name":"RequestError","code":"EHOSTUNREACH","timings":{"start":1619027796958,"socket":1619027796965,"lookup":1619027802014,"error":1619027805150,"phases":{"wait":7,"dns":5049,"total":8192}},"level":"error","message":"Error -- httpService.listDevices connect EHOSTUNREACH 52.15.142.90:443","stack":"RequestError: connect EHOSTUNREACH 52.15.142.90:443\n    at ClientRequest.<anonymous> (/app/node_modules/got/dist/source/core/index.js:956:111)\n    at Object.onceWrapper (events.js:422:26)\n    at ClientRequest.emit (events.js:327:22)\n    at ClientRequest.origin.emit (/app/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)\n    at TLSSocket.socketErrorListener (_http_client.js:469:9)\n    at TLSSocket.emit (events.js:315:20)\n    at emitErrorNT (internal/streams/destroy.js:106:8)\n    at emitErrorCloseNT (internal/streams/destroy.js:74:3)\n    at processTicksAndRejections (internal/process/task_queues.js:80:21)\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)","timestamp":"2021-04-21T17:56:45.162Z"}

I guess this has to do with the connection to eufy, because the doorbell shows up in HA, but is unavailable.

This is my config file, I have tried with dockerhost and the actual ip

eufy:
  username: "EMAIL"
  password: "PASS"
mqtt:
  url: "mqtt://192.168.1.74:1883"
  username: "mqtt"
  password: "PASS"
  keepalive: 60
home_assistant:
  off_delay: 5
Aspyryan commented 3 years ago

I have found the problem that caused the crashes, when I created the docker host, my rpi was not able to reach any host outside my LAN. This command resolved it:

sudo service network-manager restart

(To the devs, maybe include this in the documentation?)