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 241 forks source link

Permission Denied Listening on Port 443 #446

Closed patricegautier closed 2 years ago

patricegautier commented 2 years ago

Describe The Bug

Hi -

As of this latest update (EDIT: 2022-06-02), I am getting the following error restarting the home bridge server, and it's stuck in the restart loop, see the logs below.. I don't know if this come from the container packaging or an underlying change in home bridge..

Docker Config

version: '3'

networks:
  99_user_lan:
    external:
      name: 99_user_lan

services:

  homebridge:
    image: oznu/homebridge:${homebridge_TAG}
    container_name: "homebridge"
    restart: always
    volumes:
      - /var/services/homes/patrice/Deployment/homebridge/homebridge:/homebridge
      - ${HOME}/Developer/utils/sites/resolv${HE_SITE}.conf:/etc/resolv.conf:ro

    restart: unless-stopped
    labels:
      houseElf.containerReference: "https://github.com/oznu/docker-homebridge"
      houseElf.releaseNotes: "https://github.com/homebridge/homebridge/releases"
      houseElf.tagConstraint: "${HE_HOMEBRIDGE_VERSION_CONSTRAINTS}"

    environment:
      - TZ=America/Los_Angeles

    networks:
      99_user_lan:
        ipv4_address: 192.168.211.9

Logs

[6/2/2022, 12:00:36 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
[6/2/2022, 12:00:36 PM] [HB Supervisor] Started Homebridge v1.4.1 with PID: 1277
[6/2/2022, 12:00:36 PM] Loaded config.json with 1 accessories and 9 platforms.
[6/2/2022, 12:00:36 PM] Loaded 55 cached accessories from cachedAccessories.
[6/2/2022, 12:00:37 PM] ---
[6/2/2022, 12:00:37 PM] Loaded plugin: homebridge-airmega@3.1.9
[6/2/2022, 12:00:37 PM] Registering platform 'homebridge-airmega.Airmega'
[6/2/2022, 12:00:37 PM] ---
[6/2/2022, 12:00:39 PM] Loaded plugin: homebridge-broadlink-rm-pro@4.4.10
[6/2/2022, 12:00:39 PM] Registering platform 'homebridge-broadlink-rm-pro.BroadlinkRM'
[6/2/2022, 12:00:39 PM] ---
[6/2/2022, 12:00:39 PM] Loaded plugin: homebridge-config-ui-x@4.46.0
[6/2/2022, 12:00:39 PM] Registering platform 'homebridge-config-ui-x.config'
[6/2/2022, 12:00:39 PM] ---
[6/2/2022, 12:00:40 PM] Loaded plugin: homebridge-myq@2.7.4
[6/2/2022, 12:00:40 PM] Registering platform 'homebridge-myq.myQ'
[6/2/2022, 12:00:40 PM] ---
[6/2/2022, 12:00:40 PM] Loaded plugin: homebridge-nest@4.6.9
[6/2/2022, 12:00:40 PM] Registering platform 'homebridge-nest.Nest'
[6/2/2022, 12:00:40 PM] ---
[6/2/2022, 12:00:40 PM] Disabled plugin: homebridge-purpleair-sensor@1.6.2
[6/2/2022, 12:00:40 PM] ---
[6/2/2022, 12:00:40 PM] Loaded plugin: homebridge-screenlogic@2.2.1
[6/2/2022, 12:00:40 PM] Registering platform 'homebridge-screenlogic.ScreenLogic'
[6/2/2022, 12:00:40 PM] ---
[6/2/2022, 12:00:42 PM] [HB Supervisor] OS: Linux 4.4.180+ x64
[6/2/2022, 12:00:42 PM] [HB Supervisor] Node.js v16.15.1 /opt/homebridge/bin/node
[6/2/2022, 12:00:42 PM] [HB Supervisor] Homebridge Path: /var/lib/homebridge/node_modules/homebridge/bin/homebridge
[6/2/2022, 12:00:42 PM] [HB Supervisor] UI Path: /var/lib/homebridge/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[6/2/2022, 12:00:45 PM] [Homebridge UI] Homebridge Config UI X v4.46.0 is listening on :: port 443
[6/2/2022, 12:00:46 PM] [HB Supervisor] ERROR: The user interface threw an unhandled error
Error: listen EACCES: permission denied :::443
    at Server.setupListenHandle [as _listen2] (node:net:1355:21)
    at listenInCluster (node:net:1420:12)
    at doListen (node:net:1559:7)
    at processTicksAndRejections (node:internal/process/task_queues:84:21) {
  code: 'EACCES',
  errno: -13,
  syscall: 'listen',
  address: '::',
  port: 443
}

Host Operating System

Ubuntu / Debian (or a variant)

Host Architecture

x86_64 / amd64

patricegautier commented 2 years ago

Moving to a different port worked around the issue, for what it's worth this config has been untouched for a long while..

oznu commented 2 years ago

https://github.com/oznu/docker-homebridge/releases/tag/2022-06-02

The UI no longer runs as root so can't bind to ports below 1024. The solution would be to set the PUID and PGID to 0 to make the service run as root - but this won't work on the current tag; wait for the next release.

patricegautier commented 2 years ago

Understood - thanks for the info.

oznu commented 2 years ago

This is fixed in the latest release.