Can't install any node running node-red in with docker compose

Hi. I just installed node-red with the following docker compose configuration:

version: '3'
      image: eclipse-mosquitto
      container_name: mosquitto
      restart: unless-stopped
        - ./mosquitto:/mosquitto/
        -  1885:1883 
        -  9005:9001
      image: nodered/node-red
      container_name: nodered
      restart: unless-stopped
        - ./nodered:/data
        - 1880:1880
      user: root:root

Afterwards I can't install any node from the pallet. With network_mode: host configured it works. But do I really have to use this? I can't change the ports with it.

How do I have to adjust the configuration to use an own network?

This is the message:

2023-12-17T20:34:45.883Z Installieren : node-red-contrib-cron-plus 2.1.0

2023-12-17T20:34:46.039Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-cron-plus@2.1.0
2023-12-17T20:34:47.643Z [err] npm
2023-12-17T20:34:47.645Z [err]  WARN
2023-12-17T20:34:47.645Z [err]  config production Use `--omit=dev` instead.
2023-12-17T20:36:14.161Z [err] npm 
2023-12-17T20:36:14.161Z [err] ERR!
2023-12-17T20:36:14.162Z [err]  code EAI_AGAIN
2023-12-17T20:36:14.163Z [err] npm ERR!
2023-12-17T20:36:14.163Z [err]  syscall getaddrinfo
2023-12-17T20:36:14.164Z [err] npm ERR!
2023-12-17T20:36:14.165Z [err]  errno EAI_AGAIN
2023-12-17T20:36:14.175Z [err] npm ERR!
2023-12-17T20:36:14.176Z [err]  request to failed, reason: getaddrinfo EAI_AGAIN
2023-12-17T20:36:14.183Z [err] 
2023-12-17T20:36:14.184Z [err] npm 
2023-12-17T20:36:14.185Z [err] ERR!
2023-12-17T20:36:14.186Z [err]  A complete log of this run can be found in:
2023-12-17T20:36:14.186Z [err] npm ERR!     /data/.npm/_logs/2023-12-17T20_34_47_510Z-debug-0.log
2023-12-17T20:36:14.200Z rc=1

And the log file:

1 info using npm@8.19.4
2 info using node@v16.20.2
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 8ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 3ms
6 timing config:load:builtin Completed in 4ms
7 warn config production Use `--omit=dev` instead.
8 timing config:load:cli Completed in 12ms
9 timing config:load:env Completed in 1ms
10 timing config:load:file:/data/.npmrc Completed in 1ms
11 timing config:load:project Completed in 21ms
12 timing config:load:file:/root/.npmrc Completed in 10ms
13 timing config:load:user Completed in 10ms
14 timing config:load:file:/usr/local/etc/npmrc Completed in 5ms
15 timing config:load:global Completed in 5ms
16 timing config:load:validate Completed in 1ms
17 timing config:load:credentials Completed in 5ms
18 timing config:load:setEnvs Completed in 5ms
19 timing config:load Completed in 79ms
20 timing npm:load:configload Completed in 80ms
21 timing npm:load:mkdirpcache Completed in 4ms
22 timing npm:load:mkdirplogs Completed in 1ms
23 verbose title npm install node-red-contrib-cron-plus@2.1.0
24 verbose argv "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix" "~" "--production" "--engine-strict" "node-red-contrib-cron-plus@2.1.0"
25 timing npm:load:setTitle Completed in 9ms
26 timing config:load:flatten Completed in 15ms
27 timing npm:load:display Completed in 25ms
28 verbose logfile logs-max:10 dir:/data/.npm/_logs
29 verbose logfile /data/.npm/_logs/2023-12-17T20_34_47_510Z-debug-0.log
30 timing npm:load:logFile Completed in 27ms
31 timing npm:load:timers Completed in 0ms
32 timing npm:load:configScope Completed in 1ms
33 timing npm:load Completed in 152ms
34 timing arborist:ctor Completed in 3ms
35 silly logfile start cleaning logs, removing 3 files
36 silly logfile done cleaning log files
37 timing idealTree:init Completed in 677ms
38 timing idealTree:userRequests Completed in 7ms
39 silly idealTree buildDeps
40 silly fetch manifest node-red-contrib-cron-plus@2.1.0
41 timing arborist:ctor Completed in 1ms
42 silly placeDep ROOT node-red-contrib-cron-plus@ OK for: node-red-project@0.0.1 want: 2.1.0
43 timing idealTree:#root Completed in 85335ms
44 timing idealTree:node_modules/node-red-contrib-cron-plus Completed in 0ms
45 timing idealTree:buildDeps Completed in 85342ms
46 timing idealTree:fixDepFlags Completed in 14ms
47 timing idealTree Completed in 86046ms
48 timing command:install Completed in 86077ms
49 verbose type system
50 verbose stack FetchError: request to failed, reason: getaddrinfo EAI_AGAIN
50 verbose stack     at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
50 verbose stack     at ClientRequest.emit (node:events:513:28)
50 verbose stack     at TLSSocket.socketErrorListener (node:_http_client:494:9)
50 verbose stack     at TLSSocket.emit (node:events:525:35)
50 verbose stack     at emitErrorNT (node:internal/streams/destroy:157:8)
50 verbose stack     at emitErrorCloseNT (node:internal/streams/destroy:122:3)
50 verbose stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
51 verbose cwd /data
52 verbose Linux 4.9.312-arm64
53 verbose node v16.20.2
54 verbose npm  v8.19.4
55 error code EAI_AGAIN
56 error syscall getaddrinfo
57 error errno EAI_AGAIN
58 error request to failed, reason: getaddrinfo EAI_AGAIN
59 verbose exit 1
60 timing npm Completed in 86666ms
61 verbose unfinished npm timer reify 1702845288083
62 verbose unfinished npm timer reify:loadTrees 1702845288101
63 verbose code 1
64 error A complete log of this run can be found in:
64 error     /data/.npm/_logs/2023-12-17T20_34_47_510Z-debug-0.log

Thanks a lot.

Hi there,

start your stack with your docker-compose.yml (no "network_mode: host").
Then enter your running nodered with

docker exec -it nodered /bin/bash

From there


Any response? Afterwards just exit with ... "exit" :smiley:

This fails too:

4183a1d25c8c:/usr/src/node-red# ping
ping: Try again

I am on an Odroid single board computer with dietpi-os and just updated docker. I disabled iptables in the docker config, as it seams to be not configured and I got errors on docker compose up that links can't be built.

Mh. Did you try to re-install docker? I never had the necessity to change anything after a new installation. I am not working with dietpi-os though :slight_smile:

I will try that. Maybe I will setup a new machine. I guessed, that it has sth. to do with the update on docker and docker compose, I made already. I rebooted the device several times also.

I reinstalled docker now:

dietpi@oc4-iob02:~/docker/smarthome$ sudo dietpi-software reinstall 162
[  OK  ] DietPi-Software | Initialised database
[  OK  ] DietPi-Software | Reading database

 Mode: Automated reinstall

[  OK  ] DietPi-Software | Reinstalling Docker: Build, ship, and run distributed applications
[  OK  ] DietPi-Software | DietPi-Userdata validation: /mnt/dietpi_userdata

 Step: Checking for conflicts and missing inputs

 Step: Checking for prerequisite software

[  OK  ] DietPi-Software | mkdir -p /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads /var/www /opt /usr/local/bin
[  OK  ] DietPi-Software | chown dietpi:dietpi /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[  OK  ] DietPi-Software | chmod 0775 /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[ SUB1 ] DietPi-Services > stop 
[  OK  ] DietPi-Services | stop : cron
[  OK  ] DietPi-Services | stop : docker
[  OK  ] DietPi-Services | stop : mosquitto
[  OK  ] DietPi-Services | stop : cups
[  OK  ] DietPi-Services | stop : avahi-daemon
[ INFO ] DietPi-Software | APT update, please wait...
Hit:1 buster InRelease
Hit:2 buster-updates InRelease
Hit:3 buster/updates InRelease
Hit:4 buster InRelease
Get:5 buster-backports InRelease [51.4 kB]
Hit:6 all InRelease
Hit:7 buster InRelease
Fetched 51.4 kB in 2s (22.6 kB/s)
Reading package lists...
[  OK  ] DietPi-Software | APT update

 Step: Installing Docker: Build, ship, and run distributed applications

[  OK  ] DietPi-Software | Checking URL:
[  OK  ] DietPi-Software | eval curl -sSfL '' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-docker.gpg --yes
[  OK  ] DietPi-Software | eval echo 'deb buster stable' > /etc/apt/sources.list.d/docker.list
[ INFO ] DietPi-Software | APT update, please wait...
Hit:1 buster InRelease
Hit:2 buster InRelease
Hit:3 buster-updates InRelease
Hit:4 buster/updates InRelease
Hit:5 buster-backports InRelease
Hit:6 all InRelease
Hit:7 buster InRelease
Reading package lists...
[  OK  ] DietPi-Software | APT update
[  OK  ] DietPi-Software | systemctl mask --now docker
[ INFO ] DietPi-Software | APT install docker-ce, please wait...
Reading package lists...
Building dependency tree...
Reading state information...
docker-ce is already the newest version (5:24.0.7-1~debian.10~buster).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[  OK  ] DietPi-Software | APT install docker-ce
[  OK  ] DietPi-Software | systemctl unmask docker
[  OK  ] DietPi-Software | systemctl start docker.socket
[  OK  ] DietPi-Software | mkdir -p /lib/systemd/system/docker.service.d
[  OK  ] DietPi-Software | eval echo -e '[Service]\nType=simple' > /lib/systemd/system/docker.service.d/dietpi-simple.conf
[  OK  ] DietPi-Software | mkdir -p /mnt/dietpi_userdata/docker-data
[  OK  ] DietPi-Software | Current setting in /etc/docker/daemon.json will be preserved:     "data-root": "/mnt/dietpi_userdata/docker-data",
[  OK  ] DietPi-Software | Current setting in /etc/docker/daemon.json will be preserved:     "log-driver": "journald",
[  OK  ] DietPi-Software | Current setting in /etc/docker/daemon.json will be preserved:     "log-level": "warn",
[  OK  ] DietPi-Software | Current setting in /etc/docker/daemon.json will be preserved:     "debug": false,
[  OK  ] DietPi-Software | Desired setting in /etc/containerd/config.toml was already set: [debug]
[  OK  ] DietPi-Software | Current setting in /etc/containerd/config.toml will be preserved:   level = "warn"
[  OK  ] DietPi-Software | update-alternatives --set iptables /usr/sbin/iptables-nft
[  OK  ] DietPi-Software | update-alternatives --set ip6tables /usr/sbin/ip6tables-nft

 Step: Finalising install

[ INFO ] DietPi-Software | Enabling installed services
[  OK  ] DietPi-Software | systemctl --no-reload enable docker
[  OK  ] DietPi-Software | systemctl daemon-reload
2023-12-17 22:49:30 [ INFO ] DietPi-RAMlog | Storing /var/log to /var/tmp/dietpi/logs/dietpi-ramlog_store...
2023-12-17 22:49:30 [  OK  ] DietPi-RAMlog | Stored /var/log to /var/tmp/dietpi/logs/dietpi-ramlog_store.

 Step: Install completed

[  OK  ] DietPi-Survey | Sending survey data
[ SUB1 ] DietPi-Services > restart 
[  OK  ] DietPi-Services | restart : avahi-daemon
[  OK  ] DietPi-Services | restart : cups
[  OK  ] DietPi-Services | restart : mosquitto
[  OK  ] DietPi-Services | restart : docker
[  OK  ] DietPi-Services | restart : cron

I removed everything I added from /etc/docker/daemon.json.

I rebooted the device.

Trying to run docker compose up with the configuration above leads to the following error:

dietpi@oc4-iob02:~/docker/smarthome$ docker compose up
[+] Running 1/1
 โœ˜ Network smarthome_default  Error                                                                          0.5s 
failed to create network smarthome_default: Error response from daemon: Failed to program FILTER chain: iptables failed: iptables --wait -I FORWARD -o br-6c2d1fd57731 -j DOCKER: iptables v1.8.2 (nf_tables):  RULE_INSERT failed (Invalid argument): rule in chain FORWARD
 (exit status 4)

Does the docker user have correct permissions to mess with iptables ?

I have never used iptables at all. Neither with docker. Does it have a special user? I don't think, that I completely understand, what iptable is doing generally. Was there a change on docker and how it works?

But I think it isn't setup at all. There is no /etc/iptables folder.

Well docker is trying and failing to set it soโ€ฆ.
There used to be a command you had to run to let a normal user run docker commands. But I thought most installers sorted that out for you these days.

Yes. The user is in the group of docker:

Maybe you need to install iptables ?
( now guessing as I donโ€™t run diet-pi. Let alone with docker on top)

I found an old issue on dietpi: Compose / Docker encounters error before installation completes - Rock 5B DietPi ยท Issue #6013 ยท MichaIng/DietPi ยท GitHub

Switching iptables back to legacy...

update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

... lets me start the docker compose group. But I can't install anything furthermore in nodered. The error there remains the same.

Somewhat old but similar Dietpi-sofware | Docker (Odroid XU4) | No internet in containers ยท Issue #3590 ยท MichaIng/DietPi ยท GitHub

iptables is installed already:

iptables/oldoldstable,now 1.8.2-4 arm64  [installiert]
  administration tools for packet filtering and NAT

It might be related to user rights:

  • Which user are you running with? If not root, then:


output f.e. "uid=1000(pi) gid=1000(pi) Gruppen=1000(pi),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),106(netdev),996(docker)"

  • add your user to docker group

sudo usermod -aG docker 'YOURUSERNAME'

f.e. sudo usermod -aG docker pi. Log out and log back in.

  • change this in your docker-compose.yml


f.e. user: 1000:1000

On which level do you mean? The host system? There I use the dietpi user. Docker in deamon mode has also root access, or not?

Despite that, the error is pointing on a syntax error: RULE_INSERT failed (Invalid argument): rule in chain FORWARD not permission error. I think with the updates something ist busted with iptables / nf_tables. I am an IT coordinator, but network topics are not on my strenghts. :smiley:

I ordered a new Odroid N2+ bord, so I can start from scratch. I can't blow up the actual board, because my home automation is partly running on it.

Thank you all for your support. I will give an update, as soo as the parts have arrived.

1 Like

Besides that the N2+ device from Odroid is a really nice piece of hardware and much faster than my old board, the installation from scratch on DietPi worked like a charm. No more issues.

Thanks again for your support. Everybody running into this issue I only can recommend to rebuilt the system.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.