homebridge / docker-homebridge

Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
https://hub.docker.com/r/homebridge/homebridge/
GNU General Public License v3.0
2.58k stars 241 forks source link

Docker crashing Raspberry Pi #226

Closed garygoodger closed 5 years ago

garygoodger commented 5 years ago

Describe Your Problem: I'm experiencing an issue with docker homebridge crashing a raspberry pi requiring a hard reboot to bring it back to life. One of my homebridge plugins has a memory leak, so I moved over to docker in hope that when homebridge crashed, the container would restart itself. However, it's now worse as I lose all access to the pi as it requires a full hard reboot, whereas previously homebridge would crash, I'd just log in to the pi and start it up again.

I'm not sure if the error at the end of the log is the error thrown before the Pi crashes. However, it's clear to see TuyaAccessory is causing issues when connections get closed (bulb disconnects from the WiFi and spams the logs). I've tried posting on the tuya-lan repo to no avail.

Has anyone experienced this and could help? I'm unclear if the memory leak is something that can be resolved, or if there is a better way to handle this with docker so the container restarts if the logs start spamming with closed connections?

Logs:

(node:423) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 timeout listeners added. Use emitter.setMaxListeners() to increase limit
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Middle
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
[TuyaAccessory] Closed connection with Kitchen Sink
(node:423) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 timeout listeners added. Use emitter.setMaxListeners() to increase limit
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[TuyaAccessory] Closed connection with Kitchen Door
[8/27/2019, 5:12:48 AM] SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_interface_addresses returned Unknown system error 23 (Unknown system error 23)
    at Object.networkInterfaces (os.js:198:30)
    at allInterfaces (/usr/local/lib/node_modules/homebridge/node_modules/multicast-dns/index.js:164:21)
    at Timeout.that.update [as _onTimeout] (/usr/local/lib/node_modules/homebridge/node_modules/multicast-dns/index.js:124:63)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

Docker Start Command: docker-compose up -d

version: '2' services: homebridge: image: oznu/homebridge:latest restart: always network_mode: host volumes:

Alci09 commented 5 years ago

I have the same issue but with a other Plugin: Logitech Harmony. If it failes to connect it trys again and again many times. After this, the Pi is dead. Homebridge is runing here on a Pi 3

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.