NRCHKB / node-red-contrib-homekit-docker

Node-RED-homekit-docker is a Node-RED based project with support for homekit.
https://nrchkb.github.io
Apache License 2.0
40 stars 8 forks source link

[Setup Help]: Can't add bridge (no response) - docker setup #12

Closed P1Rebo closed 3 years ago

P1Rebo commented 3 years ago

First of all, thanks again for this great piece of software!! :-)

Maybe somebody has an idea..

Since 1-2 weeks I can't connect to the homekit objects. Maybe there have been some changes... Does anybody have an idea for me or has the same issues?

Problem description:

Setup Help Physical hardware device:

Apple Setup:

HomeKit setup:

Node-red container setup:

Shaquu commented 3 years ago

Hi, as you are using docker I will start with sharing link to our image:

https://github.com/NRCHKB/node-red-contrib-homekit-docker

You might find some useful stuff there.

Few questions:

Did you tried to restart all your network? Router, then pi. Also you could try to clear HomeKit cache used by our plugin (HomeKit-persist folder in ~/.node-red) and then start node-red. Make sure to unpair all bridges (these that are created via nrchkb) from Home.app first.

P1Rebo commented 3 years ago

Hi @Shaquu,

thanks for the fast reply and all the good hints!

I tried some steps but the error still remains. Details see below.

Let's start with your questions:

What I did, and unfortunately no improvement:

After that I thought it could be any pi setting so

It finds the bridge, but while trying to connect it fails after 2-3 minutes as always with

This is so strange because it used to work like a charm with > 250 nodes.

Thanks a lot in advance! Pedro

crxporter commented 3 years ago

A couple things that stand out to me:

Since 1-2 weeks I can't connect to the homekit objects

did it stop following iOS or tvOS update? Router update? ISP change?

used to work like a charm with > 250 nodes

Is this homekit device number on one bridge? Max should be 150 per bridge, maybe Apple is enforcing it now?

I don’t really have any pointers, sorry. Just noticed these things.

Shaquu commented 3 years ago

I have another idea. Try to install node-red and plugin on pi natively without docker. We need to find out if it is docker issue or not.

P1Rebo commented 3 years ago

Good ideas!

And finally it worked with the native approach. Is this maybe a port issue?

First answers to the questions of @crxporter.

Network / device software changes:

Bridges

Installation natively without docker @Shaquu

Install

I noticed it opened some new ports.

tcp 0 0 127.0.0.53:53 0.0.0.0: LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:
LISTEN
tcp 0 0 0.0.0.0:1880 0.0.0.0: LISTEN
tcp 0 0 0.0.0.0:5355 0.0.0.0:
LISTEN
tcp6 0 0 :::22 ::: LISTEN
tcp6 0 0 :::35449 :::
LISTEN
tcp6 0 0 :::38177 ::: LISTEN
tcp6 0 0 :::35553 :::
LISTEN
tcp6 0 0 :::9000 ::: LISTEN
tcp6 0 0 :::46443 :::
LISTEN
tcp6 0 0 :::5355 ::: LISTEN
tcp6 0 0 :::44909 :::
LISTEN
tcp6 0 0 :::45423 ::: LISTEN
udp 0 0 127.0.0.53:53 0.0.0.0:

udp 0 0 192.168.52.155:68 0.0.0.0:
udp 0 0 0.0.0.0:5353 0.0.0.0:

udp 0 0 0.0.0.0:5355 0.0.0.0:
udp6 0 0 fe80::dea6:32ff:fe4:546 :::

udp6 0 0 :::5355 :::*

Tried to open the mentioned UDP and TCP ports with docker and my container but this didn't work.

Shaquu commented 3 years ago

Now I am pretty sure it is port issue or networking in general. Except 5353 and 1880 there is also random port generated by Bridge. One place is port, other mdns custom configuration.

I am not docker pro but if you use host mode then I think you don't need to map all other ports, right? With correct setup you don't need to map any port.

It's my part of compose:

  node-red-homekit:
    image: nrchkb/node-red-homekit
    environment:
      TZ: Europe/Warsaw
    #  DEBUG: NRCHKB*,HAP-NodeJS*
    network_mode: host
    volumes:
      - './data/node-red-homekit:/data'
    container_name: node-red-homekit
    restart: always
    depends_on:
      - mosquitto
P1Rebo commented 3 years ago

That was also my guess, but I always configured only host mode.

Error remains without any port configuration with your docker image

Within the Docker documentation it says, that a port configuration in host mode will be ignored, so shame on my noob skills :-)

Shaquu commented 3 years ago
  1. Did you noticed commented DEBUG in my compose? It enables some additional logs. For docker compose you have my example. For native node-red DEBUG: NRCHKB*,HAP-NodeJS* node-red

So let's run node-red with debug and compare native vs docker output.

  1. One more thing, can you try to create new home in Home.app (to not use Apple TV) and try with docker in that setup? homebridge/HAP-NodeJS#862

  2. You can also try to use our dev branch npm i node-red-contrib-homekit-bridged@dev and see if that helps as it uses some improved networking handlers

P1Rebo commented 3 years ago

Ok, here we go.

  1. Did you noticed commented DEBUG in my compose? It enables some additional logs. For docker compose you have my example. For native node-red DEBUG: NRCHKB*,HAP-NodeJS* node-red

So let's run node-red with debug and compare native vs docker output.

Ok, I enabled DEBUG right now and getting some more information.

  1. One more thing, can you try to create new home in Home.app (to not use Apple TV) and try with docker in that setup? homebridge/HAP-NodeJS#862

I just deleted the current home and retried the setup. It's probably related to the issue you mentioned, seems so.

DEBUG Output (until it quits with the error)


Loading service file /etc/avahi/services/sftp-ssh.service.
,Loading service file /etc/avahi/services/ssh.service.
,Joining mDNS multicast group on interface br-7fd8e7633d2d.IPv4 with address 172.18.0.1.
,New relevant interface br-7fd8e7633d2d.IPv4 for mDNS.
,Joining mDNS multicast group on interface docker0.IPv4 with address 172.17.0.1.
,New relevant interface docker0.IPv4 for mDNS.
,Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.52.57.
,New relevant interface eth0.IPv4 for mDNS.
,Network interface enumeration completed.
,Registering new address record for fe80::8834:38ff:fe8f:a134 on veth48b6150.*.
,Registering new address record for fe80::acae:a7ff:fe10:2909 on veth2ccad1d.*.
,Registering new address record for fe80::502e:e9ff:feab:202f on veth07fa9f5.*.
,Registering new address record for 172.18.0.1 on br-7fd8e7633d2d.IPv4.
,Registering new address record for fe80::42:e5ff:fe4e:847c on docker0.*.
,Registering new address record for 172.17.0.1 on docker0.IPv4.
,Registering new address record for 2001:16b8:283c:5700:dea6:32ff:fe46:4f03 on eth0.*.
,Registering new address record for 192.168.52.57 on eth0.IPv4.
,Server startup complete. Host name is RPi4-SmartHome.local. Local service cookie is 1127611440.
,21 Dec 10:39:18 - [info] 
,
,Welcome to Node-RED
,===================
,
,21 Dec 10:39:18 - [info] Node-RED version: v1.2.6
,21 Dec 10:39:18 - [info] Node.js  version: v10.23.0
,21 Dec 10:39:18 - [info] Linux 5.4.83-1-ARCH arm LE
,21 Dec 10:39:18 - [info] Loading palette nodes
,  NRCHKB RED settings available +0ms
,  NRCHKB HAPStorage path set to  /data/homekit-persist +2ms
,  NRCHKB:api Initialize ServiceAPI +0ms
,  NRCHKB:api Initialize NRCHKBVersionAPI +124ms
,  NRCHKB:api Running version: 1.2.0 +0ms
,  NRCHKB:api Evaluated as: 1.2.0 +1ms
,  NRCHKB Registering homekit-bridge type +0ms
,  NRCHKB Registering homekit-service type +0ms
,21 Dec 10:39:20 - [info] Settings file  : /data/settings.js
,21 Dec 10:39:20 - [info] Context store  : 'default' [module=memory]
,21 Dec 10:39:20 - [info] User directory : /data
,21 Dec 10:39:20 - [warn] Projects disabled : editorTheme.projects.enabled=false
,21 Dec 10:39:20 - [info] Flows file     : /data/flows.json
,21 Dec 10:39:20 - [warn] 
,
,---------------------------------------------------------------------
,Your flow credentials file is encrypted using a system-generated key.
,
,If the system-generated key is lost for any reason, your credentials
,file will not be recoverable, you will have to delete it and re-enter
,your credentials.
,
,You should set your own key using the 'credentialSecret' option in
,your settings file. Node-RED will then re-encrypt your credentials
,file using your chosen key the next time you deploy a change.
,---------------------------------------------------------------------
,
,21 Dec 10:39:21 - [info] Server now running at http://127.0.0.1:1880/
,21 Dec 10:39:21 - [info] Starting flows
,21 Dec 10:39:21 - [info] Started flows
,21 Dec 10:39:58 - [info] Flows stoppen
,21 Dec 10:39:58 - [info] Flows gestoppt
,21 Dec 10:39:58 - [info] Flows starten
,  NRCHKB:HAPBridgeNode Setting name to TestBridge +0ms
,  NRCHKB:HAPBridgeNode Creating Bridge with name 'TestBridge' and UUID '8bf95342-315c-4392-ac0e-62ab30279f8b' +2ms
,21 Dec 10:39:58 - [info] Flows gestartet
,  NRCHKB:HAPServiceNode Starting Parent Service TestSwitch +0ms
,  NRCHKB:AccessoryUtils Looking for accessory with service subtype 'd288c86d-c937-42cd-82ba-30143cbb64dc'... +0ms
,  NRCHKB:AccessoryUtils ... didn't find it. Adding new accessory with name 'TestSwitch' and UUID 'ecafc18a-473b-41cb-85be-c500bf63584a' +0ms
,  HAP-NodeJS:Accessory [TestSwitch] Identification request +0ms
,  HAP-NodeJS:Accessory [TestSwitch] Identification request ignored; no listeners to 'identify' event +1ms
,  NRCHKB:AccessoryUtils Bridge now has 1 accessories. +8ms
,  NRCHKB:ServiceUtils Looking for service with UUID 'd288c86d-c937-42cd-82ba-30143cbb64dc'... +0ms
,  NRCHKB:ServiceUtils ... didn't find it. Adding new Switch service. +1ms
,  NRCHKB:HAPBridgeNode Publishing bridge with name 'TestBridge', pin code '111-11-111' and 1 accessories. +5s
,  HAP-NodeJS:Accessory [TestBridge] Creating new AccessoryInfo for our HAP server +5s
,  HAP-NodeJS:Accessory [TestBridge] Creating new IdentifierCache +104ms
,  NRCHKB:BridgeUtils Bridge 'TestBridge' [f84f6d1c.f2af48] published +0ms
,  HAP-NodeJS:EventedHTTPServer Server listening on port 46547 +0ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] New connection from client at interface eth0 +27s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server listening on port 41285 +2ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection error:  getaddrinfo EAI_AGAIN localhost undefined:41285 +5s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server was closed +2ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] Client connection closed +3ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] New connection from client at interface eth0 +22ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server listening on port 46191 +0ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection error:  getaddrinfo EAI_AGAIN localhost undefined:46191 +5s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection was closed +0ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] Client connection closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] New connection from client at interface eth0 +20s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server listening on port 37735 +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection error:  getaddrinfo EAI_AGAIN localhost undefined:37735 +5s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] Client connection closed +0ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] New connection from client at interface eth0 +57ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server listening on port 44521 +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection error:  getaddrinfo EAI_AGAIN localhost undefined:44521 +5s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] Client connection closed +0ms
,
  1. You can also try to use our dev branch npm i node-red-contrib-homekit-bridged@dev and see if that helps as it uses some improved networking handlers

Ok, I did this also using a clean Node-Red container. The error remains.


,> node-red-docker@1.2.6 start /usr/src/node-red
,> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
,
,21 Dec 10:48:46 - [info] 
,
,Welcome to Node-RED
,===================
,
,21 Dec 10:48:46 - [info] Node-RED version: v1.2.6
,21 Dec 10:48:46 - [info] Node.js  version: v10.23.0
,21 Dec 10:48:46 - [info] Linux 5.4.83-1-ARCH arm LE
,21 Dec 10:48:47 - [info] Loading palette nodes
,21 Dec 10:48:48 - [info] Settings file  : /data/settings.js
,21 Dec 10:48:48 - [info] Context store  : 'default' [module=memory]
,21 Dec 10:48:48 - [info] User directory : /data
,21 Dec 10:48:48 - [warn] Projects disabled : editorTheme.projects.enabled=false
,21 Dec 10:48:48 - [info] Flows file     : /data/flows.json
,21 Dec 10:48:48 - [warn] 
,
,---------------------------------------------------------------------
,Your flow credentials file is encrypted using a system-generated key.
,
,If the system-generated key is lost for any reason, your credentials
,file will not be recoverable, you will have to delete it and re-enter
,your credentials.
,
,You should set your own key using the 'credentialSecret' option in
,your settings file. Node-RED will then re-encrypt your credentials
,file using your chosen key the next time you deploy a change.
,---------------------------------------------------------------------
,
,21 Dec 10:48:48 - [info] Server now running at http://127.0.0.1:1880/
,21 Dec 10:48:48 - [info] Starting flows
,21 Dec 10:48:48 - [info] Started flows
,21 Dec 10:55:08 - [info] Flows stoppen
,21 Dec 10:55:08 - [info] Flows gestoppt
,
,> node-red-docker@1.2.6 start /usr/src/node-red
,> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
,
,21 Dec 10:55:11 - [info] 
,
,Welcome to Node-RED
,===================
,
,21 Dec 10:55:12 - [info] Node-RED version: v1.2.6
,21 Dec 10:55:12 - [info] Node.js  version: v10.23.0
,21 Dec 10:55:12 - [info] Linux 5.4.83-1-ARCH arm LE
,21 Dec 10:55:12 - [info] Loading palette nodes
,  NRCHKB Node.js version requirement met. Required 10.22.1. Installed v10.23.0 +0ms
,  NRCHKB RED settings available +5ms
,  NRCHKB HAPStorage path set to  /data/homekit-persist +1ms
,  NRCHKB:api Initialize ServiceAPI +0ms
,  NRCHKB:api Initialize NRCHKBVersionAPI +121ms
,  NRCHKB:api Running version: 1.3.0-dev.27 +0ms
,  NRCHKB:api Evaluated as: 0.130.27 +1ms
,  NRCHKB:api Initialize AccessoryAPI +0ms
,  NRCHKB Registering homekit-bridge type +0ms
,  NRCHKB Registering homekit-standalone type +0ms
,  NRCHKB Registering homekit-service type +0ms
,21 Dec 10:55:14 - [info] Settings file  : /data/settings.js
,21 Dec 10:55:14 - [info] Context store  : 'default' [module=memory]
,21 Dec 10:55:14 - [info] User directory : /data
,21 Dec 10:55:14 - [warn] Projects disabled : editorTheme.projects.enabled=false
,21 Dec 10:55:14 - [info] Flows file     : /data/flows.json
,21 Dec 10:55:14 - [warn] 
,
,---------------------------------------------------------------------
,Your flow credentials file is encrypted using a system-generated key.
,
,If the system-generated key is lost for any reason, your credentials
,file will not be recoverable, you will have to delete it and re-enter
,your credentials.
,
,You should set your own key using the 'credentialSecret' option in
,your settings file. Node-RED will then re-encrypt your credentials
,file using your chosen key the next time you deploy a change.
,---------------------------------------------------------------------
,
,21 Dec 10:55:14 - [info] Starting flows
,21 Dec 10:55:14 - [info] Started flows
,21 Dec 10:55:14 - [info] Server now running at http://127.0.0.1:1880/
,21 Dec 10:55:31 - [info] Stopping flows
,21 Dec 10:55:31 - [info] Stopped flows
,
,> node-red-docker@1.2.6 start /usr/src/node-red
,> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
,
,21 Dec 10:55:34 - [info] 
,
,Welcome to Node-RED
,===================
,
,21 Dec 10:55:34 - [info] Node-RED version: v1.2.6
,21 Dec 10:55:34 - [info] Node.js  version: v10.23.0
,21 Dec 10:55:34 - [info] Linux 5.4.83-1-ARCH arm LE
,21 Dec 10:55:35 - [info] Loading palette nodes
,  NRCHKB Node.js version requirement met. Required 10.22.1. Installed v10.23.0 +0ms
,  NRCHKB RED settings available +5ms
,  NRCHKB HAPStorage path set to  /data/homekit-persist +1ms
,  NRCHKB:api Initialize ServiceAPI +0ms
,  NRCHKB:api Initialize NRCHKBVersionAPI +122ms
,  NRCHKB:api Running version: 1.3.0-dev.27 +0ms
,  NRCHKB:api Evaluated as: 0.130.27 +1ms
,  NRCHKB:api Initialize AccessoryAPI +0ms
,  NRCHKB Registering homekit-bridge type +0ms
,  NRCHKB Registering homekit-standalone type +0ms
,  NRCHKB Registering homekit-service type +0ms
,21 Dec 10:55:37 - [info] Settings file  : /data/settings.js
,21 Dec 10:55:37 - [info] Context store  : 'default' [module=memory]
,21 Dec 10:55:37 - [info] User directory : /data
,21 Dec 10:55:37 - [warn] Projects disabled : editorTheme.projects.enabled=false
,21 Dec 10:55:37 - [info] Flows file     : /data/flows.json
,21 Dec 10:55:37 - [warn] 
,
,---------------------------------------------------------------------
,Your flow credentials file is encrypted using a system-generated key.
,
,If the system-generated key is lost for any reason, your credentials
,file will not be recoverable, you will have to delete it and re-enter
,your credentials.
,
,You should set your own key using the 'credentialSecret' option in
,your settings file. Node-RED will then re-encrypt your credentials
,file using your chosen key the next time you deploy a change.
,---------------------------------------------------------------------
,
,21 Dec 10:55:37 - [info] Starting flows
,21 Dec 10:55:37 - [info] Started flows
,21 Dec 10:55:37 - [info] Server now running at http://127.0.0.1:1880/
,21 Dec 10:56:06 - [info] Flows stoppen
,21 Dec 10:56:06 - [info] Flows gestoppt
,21 Dec 10:56:06 - [info] Flows starten
,  NRCHKB:HAPHostNode Setting name to TestBridge +0ms
,  NRCHKB:HAPHostNode Creating Bridge with name 'TestBridge' and UUID '1fcba2e0-b32f-4d43-bd86-5b96143d0792' +1ms
,21 Dec 10:56:06 - [info] Flows gestartet
,  NRCHKB:HAPServiceNode Starting Parent Service TestSwitch +0ms
,  NRCHKB:AccessoryUtils Looking for accessory with service subtype '94804fbb-f358-4e11-97fa-7c61add02974'... +0ms
,  NRCHKB:AccessoryUtils ... didn't find it. Adding new accessory with name 'TestSwitch' and UUID '1fa339c4-13d7-4b93-8f59-7f2ed81b7478' +0ms
,  HAP-NodeJS:Accessory [TestSwitch] Identification request +0ms
,  HAP-NodeJS:Accessory [TestSwitch] Identification request ignored; no listeners to 'identify' event +2ms
,  NRCHKB:AccessoryUtils Bridge now has 1 accessories. +8ms
,  NRCHKB:ServiceUtils Looking for service with UUID '94804fbb-f358-4e11-97fa-7c61add02974'... +0ms
,  NRCHKB:ServiceUtils ... didn't find it. Adding new Switch service. +0ms
,  NRCHKB:HAPHostNode Publishing Bridge with name 'TestBridge', pin code '111-11-111' and 1 accessories. +5s
,  HAP-NodeJS:Accessory [TestBridge 61F8] Creating new AccessoryInfo for our HAP server +5s
,  HAP-NodeJS:Accessory [TestBridge 61F8] Creating new IdentifierCache +106ms
,  NRCHKB:BridgeUtils Bridge 'TestBridge' [5637bdf7.49e37c] published +0ms
,  HAP-NodeJS:EventedHTTPServer Server listening on port 34123 +0ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] New connection from client at interface eth0 +10s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server listening on port 33295 +2ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection error:  getaddrinfo EAI_AGAIN localhost undefined:33295 +5s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server was closed +2ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] Client connection closed +2ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] New connection from client at interface eth0 +45ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server listening on port 41235 +0ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection error:  getaddrinfo EAI_AGAIN localhost undefined:41235 +5s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] Client connection closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] New connection from client at interface eth0 +21s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server listening on port 44321 +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection error:  getaddrinfo EAI_AGAIN localhost undefined:44321 +5s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection was closed +0ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] Client connection closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] New connection from client at interface eth0 +68ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server listening on port 38359 +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection error:  getaddrinfo EAI_AGAIN localhost undefined:38359 +5s
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP connection was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] HTTP server was closed +1ms
,  HAP-NodeJS:EventedHTTPServer [::ffff:192.168.52.141] Client connection closed +0ms
,
Shaquu commented 3 years ago

It looks like docker fails to resolve dns. moby/moby#32106

  1. Is it possible for you to share whole command you use to start node-red container?
  2. Also if you use compose you could attach it too (remember to hide vulnerable data). Possibly you use some custom network config? (In my compose I do not)
  3. Maybe this is the problem with ipv6, no idea yet
P1Rebo commented 3 years ago

Thanks for the indications! Have it working now!

I followed the link you posted and added the DNS info to the docker container and by creating a etc/docker/daemon.json as mentioned in the link:

Different error came up "getaddrinfo ENOTFOUND localhost undefined"

Everything works now. Even when I remove the DNS entries from the container...

If it makes sense I'll try it out from scratch by just using a clean RPi4 arch linux installation + docker with your node-red-contrib-homekit-docker later.

P1Rebo commented 3 years ago

I finally tested with a clean installation.

Indeed the localhost definition in necessary, and doesn't come up by default (removed 2017 from the standard arch linux image).

Reinstalled blankly

Added DNS to container

With localhost definition

@Shaquu, @crxporter - If you want we can close this issue. Thanks a lot for your help!

Shaquu commented 3 years ago

@P1Rebo I am happy we solved it! Everyone learned something.

If you want to chat with us about HomeKit or other home automations projects then join us on our Discord server.