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.57k stars 240 forks source link

Container continually falls over with little load #405

Closed cgmckeever closed 2 years ago

cgmckeever commented 2 years ago

Describe Your Problem:

Container will run properly for a while and the fall over/restart multiple times in the day. No identifiable amount of time between restarts. docker ps -a shows the restart [up 1 min], Homebridge UI shows a longer uptime [up 12 hours] (screenshots below).

Im going to turn off the auto-restart and see if there are any more logs that are persisted.

This is running on a RASP-PI 2 (B?) -- The load seems insignificant (screenshot) - but I wonder if when a update refresh request comes in it just gets knocked over?

Logs:

docker logs CONTAINER-ID

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
GID/UID
-------------------------------------
User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-set-timezone: executing...
Set system timezone to America/Chicago.
[cont-init.d] 20-set-timezone: exited 0.
[cont-init.d] 30-packages: executing...
[cont-init.d] 30-packages: exited 0.
[cont-init.d] 40-dbus-avahi: executing...
[cont-init.d] 40-dbus-avahi: exited 0.
[cont-init.d] 45-user-data: executing...
[cont-init.d] 45-user-data: exited 0.
[cont-init.d] 50-plugins: executing...

    Thank you for using the oznu/homebridge docker image!

  If you find this project useful please STAR it on GitHub:

         https://github.com/oznu/docker-homebridge

                Or donate to the project:

            https://github.com/sponsors/oznu
                  https://paypal.me/oznu

Homebridge: Installing plugins...

up to date in 5s

up to date in 5s
[cont-init.d] 50-plugins: exited 0.
[cont-init.d] 55-config-ui: executing...
Enabling homebridge-config-ui-x...
[cont-init.d] 55-config-ui: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting cron

  If you find this project useful please STAR it on GitHub:

         https://github.com/oznu/docker-homebridge

                Or donate to the project:

            https://github.com/sponsors/oznu
                  https://paypal.me/oznu

[services.d] done.
[12/28/2021, 8:05:18 AM] [HB Supervisor] Homebridge Storage Path: /homebridge
[12/28/2021, 8:05:18 AM] [HB Supervisor] Homebridge Config Path: /homebridge/config.json
[12/28/2021, 8:05:18 AM] [HB Supervisor] Logging to /homebridge/homebridge.log
[12/28/2021, 8:05:18 AM] [HB Supervisor] OS: Linux 5.10.63-v7+ arm
[12/28/2021, 8:05:18 AM] [HB Supervisor] Node.js v16.13.1 /usr/local/bin/node
[12/28/2021, 8:05:18 AM] [HB Supervisor] Homebridge Path: /usr/local/lib/node_modules/homebridge/bin/homebridge
[12/28/2021, 8:05:18 AM] [HB Supervisor] UI Path: /usr/local/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[12/28/2021, 8:05:36 AM] [Homebridge UI] Homebridge Config UI X v4.41.5 is listening on :: port 8581
[12/28/2021, 8:05:38 AM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules
[12/28/2021, 8:05:38 AM] [HB Supervisor] Started Homebridge v1.3.8 with PID: 402
[12/28/2021, 8:05:41 AM] Loaded config.json with 0 accessories and 2 platforms.
[12/28/2021, 8:05:42 AM] Loaded 19 cached accessories from cachedAccessories.
[12/28/2021, 8:05:42 AM] ---
[12/28/2021, 8:05:46 AM] Loaded plugin: homebridge-dummy@0.5.0
[12/28/2021, 8:05:46 AM] Registering accessory 'homebridge-dummy.DummySwitch'
[12/28/2021, 8:05:46 AM] ---
[12/28/2021, 8:05:47 AM] Loaded plugin: homebridge-hubitat-makerapi@0.4.15
Homebridge Version: 2.7
Plugin Version: 0.4.15
[12/28/2021, 8:05:47 AM] Registering platform 'homebridge-hubitat-makerapi.Hubitat-MakerAPI'
[12/28/2021, 8:05:47 AM] ---
[12/28/2021, 8:05:48 AM] Loaded plugin: homebridge-config-ui-x@4.41.5
[12/28/2021, 8:05:48 AM] Registering platform 'homebridge-config-ui-x.config'
[12/28/2021, 8:05:48 AM] ---
[12/28/2021, 8:05:48 AM] Loading 2 platforms...
[12/28/2021, 8:05:48 AM] [Config] Initializing config platform...
[12/28/2021, 8:05:48 AM] [Config] Running in Service Mode
[12/28/2021, 8:05:48 AM] [Hubitat MakerAPI] Initializing Hubitat-MakerAPI platform...
[12/28/2021, 8:05:49 AM] [Hubitat MakerAPI hhm:0.4.15] Configuration of cached accessories not 

[12/28/2021, 8:05:49 AM] Homebridge v1.3.8 (HAP v0.9.7) (Homebridge 83D6) is running on port 51854.
[12/28/2021, 8:05:49 AM] [Hubitat MakerAPI hhm:0.4.15] latest version on npmjs is 0.4.15
[12/28/2021, 8:05:49 AM] [Hubitat MakerAPI hhm:0.4.15] your version of the plugin is up2date
[12/28/2021, 8:05:49 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Perimeter Monitor Switch, ID 53
[12/28/2021, 8:05:49 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name All Light Switch, ID 38
[12/28/2021, 8:05:49 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Garage Outlet Spotlight, ID 64
[12/28/2021, 8:05:49 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Garage Overhead Button, ID 102
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Wetbar Beverage Center Moisture Sensor, ID 104
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Garage Monitor Notification Switch, ID 111
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Kitchen Beverage Center Outlet, ID 132
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Garage Overhead Sensor Right, ID 100
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Kitchen Beverage Center Moisture Sensor, ID 103
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Lounge Lights, ID 49
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Wetbar Beverage Center Outlet, ID 135
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Basement Lights, ID 30
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Wetbar Beverage Center MultiSensor, ID 136
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Garage Siren Switch, ID 50
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Garage Overhead Lock, ID 98
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Garage Overhear Sensor Left, ID 99
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Back Stair Lights, ID 36
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Kitchen Beverage Center MultiSensor, ID 4
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Device Added (Cache) - Name Internet Reboot Button, ID 131
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Fetching Hubitat-MakerAPI devices. This can take a while depending on the number of devices configured!
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Refreshing All Device Data
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Received All Device Data
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Starting receiver
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Set communcation_broken to false
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] Setting MakerAPI post URL to http://192.168.2.25:20010/event at http://LOCAL.IP/apps/api/235
[12/28/2021, 8:05:50 AM] [Hubitat MakerAPI hhm:0.4.15] homebridge-hubitat-makerapi server listening on 20010
[12/28/2021, 8:05:51 AM] [Hubitat MakerAPI hhm:0.4.15] MakerAPI postURL successfully activated

Docker Start Command:

systemd

ExecStartPre=/home/pi/homebridge.sh
ExecStart=/usr/bin/docker start -a homebridge

homebridge.sh

docker run \
  --net=host \
  --name=homebridge \
  -v /home/pi/homebridge:/homebridge \
  oznu/homebridge:latest

Homebridge Config:

{
    "bridge": {
        "name": "Homebridge 83D6",
        "username": "USERNAME",
        "port": 51854,
        "pin": "PIN"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "platform": "Hubitat-MakerAPI",
            "name": "Hubitat MakerAPI",
            "app_url": "http://HUBITAT.IP/apps/api/235",
            "access_token": "TOKEN",
            "local_ip": "HOMEBRIDGE.IP",
            "local_port": 20010,
            "mode_switches": false,
            "hsm": false,
            "debug": false,
            "logFile": {
                "enabled": true,
                "path": "",
                "file": "",
                "compress": true,
                "keep": 5,
                "size": "10m"
            }
        }
    ]
}

Screenshots:

Screen Shot 2021-12-28 at 8 06 58 AM Screen Shot 2021-12-28 at 8 07 09 AM

Environment:

Server: Docker Engine - Community Engine: Version: 20.10.12 API version: 1.41 (minimum version 1.12) Go version: go1.16.12 Git commit: 459d0df Built: Mon Dec 13 11:43:45 2021 OS/Arch: linux/arm Experimental: false containerd: Version: 1.4.12 GitCommit: 7b11cfaabd73bb80907dd23182b9347b4245eb5d runc: Version: 1.0.2 GitCommit: v1.0.2-0-g52b36a2 docker-init: Version: 0.19.0 GitCommit: de40ad0



* **Image Tag / Type**: `latest` pulled 2 days ago

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
cgmckeever commented 2 years ago

I think its this Homebridge Error (DEBUG MODE enabled) that is bouncing it .. still parsing the error itself

https://github.com/homebridge/homebridge/wiki/Characteristic-Warnings#this-plugin-threw-an-error-from-the-characteristic

[12/29/2021, 8:38:40 AM] [homebridge-hubitat-makerapi] This plugin threw an error from the characteristic 'Brightness': Unhandled error thrown inside read handler for characteristic: Characteristic is not defined. See https://git.io/JtMGR for more info.
[12/29/2021, 8:38:40 AM] [homebridge-hubitat-makerapi] ReferenceError: Characteristic is not defined
    at validateValue (/homebridge/node_modules/homebridge-hubitat-makerapi/lib/validate.js:178:35)
    at Brightness.<anonymous> (/homebridge/node_modules/homebridge-hubitat-makerapi/accessories/he_st_accessories.js:650:40)
    at Brightness.emit (node:events:390:28)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1544:14
    at new Promise (<anonymous>)
    at Brightness.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1542:12)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
    at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:113:16)
    at Brightness.Characteristic.handleGetRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:656:38)
    at Brightness.Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1252:10)
    at HE_ST_Accessory.loadData (/homebridge/node_modules/homebridge-hubitat-makerapi/accessories/he_st_accessories.js:1614:63)
    at /homebridge/node_modules/homebridge-hubitat-makerapi/index.js:218:47
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
cgmckeever commented 2 years ago

Possible issue with MakerAPI and lighting that are offline, working it there and will update here if there is anything relevant directly to dockerizing

https://github.com/danTapps/homebridge-hubitat-makerapi/issues/23

cgmckeever commented 2 years ago

closing. Its been up for 30+ hours now. I think it had to do with that cranky makerapi call