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

Homebridge failed to install using the Homebridge on Portainer guide #539

Closed guysbrown closed 5 months ago

guysbrown commented 7 months ago

Current Situation

I used the followed guide to install HomeBridge via Portainer however HomeBridge fails to be installed properly:

https://github.com/homebridge/docker-homebridge/wiki/Homebridge-on-Portainer

Please see the attached logs.

I am unsure how to fix it. Please help.

Docker Config

version: '3'
services:
  homebridge:
    image: homebridge/homebridge:ubuntu
    container_name: homebridge
    restart: always
    network_mode: host
    environment:
      - HOMEBRIDGE_CONFIG_UI_PORT=8581
    volumes:
      - homebridge:/homebridge
volumes:
  homebridge:

Logs

requireStack: [
    '/opt/homebridge/lib/node_modules/homebridge-config-ui-x/dist/bin/hb-service.js'
  ]
}
Node.js v18.18.2
Re-installing homebridge...
node:internal/fs/utils:350
    throw err;
    ^
Error: ENOENT: no such file or directory, open '/opt/homebridge/lib/cli.js'
    at Object.openSync (node:fs:603:3)
    at Object.readFileSync (node:fs:471:35)
    at Module._extensions..js (node:internal/modules/cjs/loader:1273:18)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/opt/homebridge/bin/npm:2:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) {

  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/opt/homebridge/lib/cli.js'
}
Node.js v18.18.2
node:internal/modules/cjs/loader:1080

  throw err;
  ^
Error: Cannot find module 'axios'
Require stack:
- /opt/homebridge/lib/node_modules/homebridge-config-ui-x/dist/bin/hb-service.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/opt/homebridge/lib/node_modules/homebridge-config-ui-x/dist/bin/hb-service.js:9:17)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/homebridge/lib/node_modules/homebridge-config-ui-x/dist/bin/hb-service.js'
  ]
}
Node.js v18.18.2
Re-installing homebridge...
node:internal/fs/utils:350
    throw err;
    ^
Error: ENOENT: no such file or directory, open '/opt/homebridge/lib/cli.js'
    at Object.openSync (node:fs:603:3)
    at Object.readFileSync (node:fs:471:35)
    at Module._extensions..js (node:internal/modules/cjs/loader:1273:18)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/opt/homebridge/bin/npm:2:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) {

  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/opt/homebridge/lib/cli.js'
}
Node.js v18.18.2
node:internal/modules/cjs/loader:1080

  throw err;
  ^
Error: Cannot find module 'axios'
Require stack:
- /opt/homebridge/lib/node_modules/homebridge-config-ui-x/dist/bin/hb-service.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/opt/homebridge/lib/node_modules/homebridge-config-ui-x/dist/bin/hb-service.js:9:17)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/homebridge/lib/node_modules/homebridge-config-ui-x/dist/bin/hb-service.js'
  ]
}
Node.js v18.18.2

Host Operating System

Other (specify in description)

Host Architecture

x86_64 / amd64

NorthernMan54 commented 7 months ago

I just ran thru the setup steps, and did not run into any issues. I did the test on a Ubuntu Jammy image. I'm wondering if you should just delete the image and start again

image

guysbrown commented 7 months ago

Hey,

Thanks for the response.

I have tried several times (deleting the stack/container/image/volume/etc) but still run into the same issue.

Do you use the same Docker config as per the help page - or was it somehow different?

Also, I am using Portainer and Docker installed on my Asustor Drivestor AS1102T NAS if that makes any difference.

Best Regards,

Guy

NorthernMan54 commented 7 months ago

I'm not familiar with Asustor Drivestor AS1102T NAS but I just followed the steps in the wiki to set it up on my ubuntu jammy test machine.

I'm not familiar with Portainer, but am wondering if there were errors or issues earlier during the deploy process that may be causing the problem. It looks like something is failing during deploy

guysbrown commented 7 months ago

Yes, it seems like Node is completely broken.

kikearciniegas commented 6 months ago

I'm facing the same error, although I'm trying to spin up the docker container in a Firewalla Gold, where I already have other docker containers running... on a fresh install with this docker-compose.yaml

version: '2'
services:
  homebridge:
    image: homebridge/homebridge:ubuntu
    container_name: homebridge
    restart: always
    network_mode: host
    environment:
      - PGID=1000
      - PUID=1000
      - HOMEBRIDGE_CONFIG_UI=1
      - HOMEBRIDGE_CONFIG_UI_PORT=8581
      - TZ=America/Panama
      - ENABLE_AVAHI=0
    volumes:
      - '/mnt/data/docker/homebridge/data:/homebridge'
    logging:
      driver: "json-file"
      options:
        max-size: "10m"

the container spins up but the application never runs, it loops with these internal errors

Re-installing homebridge...
node[261]: ../src/node_platform.cc:68:std::unique_ptr<long unsigned int> node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start(): Assertion `(0) == (uv_thread_create(t.get(), start_thread, this))' failed.
 1: 0xb85bc0 node::Abort() [node]
 2: 0xb85c3e  [node]
 3: 0xbf30fe  [node]
 4: 0xbf31e1 node::NodePlatform::NodePlatform(int, v8::TracingController*, v8::PageAllocator*) [node]
 5: 0xb438f3 node::InitializeOncePerProcess(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, node::ProcessFlags::Flags) [node]
 6: 0xb43f4b node::Start(int, char**) [node]
 7: 0x7f9889ce3d90  [/lib/x86_64-linux-gnu/libc.so.6]
 8: 0x7f9889ce3e40 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
 9: 0xac1f4e _start [node]
Aborted (core dumped)
/opt/homebridge/bin/node[258]: ../src/node_platform.cc:68:std::unique_ptr<long unsigned int> node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start(): Assertion `(0) == (uv_thread_create(t.get(), start_thread, this))' failed.
 1: 0xb85bc0 node::Abort() [/opt/homebridge/bin/node]
 2: 0xb85c3e  [/opt/homebridge/bin/node]
 3: 0xbf30fe  [/opt/homebridge/bin/node]
 4: 0xbf31e1 node::NodePlatform::NodePlatform(int, v8::TracingController*, v8::PageAllocator*) [/opt/homebridge/bin/node]
 5: 0xb438f3 node::InitializeOncePerProcess(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, node::ProcessFlags::Flags) [/opt/homebridge/bin/node]
 6: 0xb43f4b node::Start(int, char**) [/opt/homebridge/bin/node]
 7: 0x7ff7e996ad90  [/lib/x86_64-linux-gnu/libc.so.6]
 8: 0x7ff7e996ae40 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
 9: 0xac1f4e _start [/opt/homebridge/bin/node]

and in my data directory /config.json

{
    "mdns": {
    "interface": "192.168.99.1"
},
    "bridge": {
    "name": "Homebridge FWG",
    "username": "5V:20:6G:1A:1B:9C",
    "port": 52175,
    "pin": "822-72-948"
},
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        }
    ]
}

I have NPM, Unifi and Pi-Hole running flawlessly in my FWG... did you manage to make it work?

FWG Box Version 1.9770 Docker Version 19.03.6 Operating System: Ubuntu 18.04.3 LTS Architecture: x86_64

github-actions[bot] commented 5 months 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.

github-actions[bot] commented 5 months ago

This issue has been closed as no further activity has occurred.