Docker node-red breaks after installing package

I'm running the std node-red:3.0.2 from dockerhub(tried all version and tags availble versions and tag but it did not seem to make a difference),

compose_file as follows

node-red:
    image: nodered/node-red:latest-18-minimal
    environment:
      - TZ=Europe/Amsterdam
      - NODE_RED_CREDENTIAL_SECRET=secret
    user: "1000:1000"
    ports:
      - 1880:1880
    volumes:
      - /share/Container/container-station-data/application/node-red_backup:/data
    dns:
      - 8.8.8.8

What seems to happen is:

I start node-red and deploy a simple flow with only a debug node to test if it is working.

Once i install something to the palette node-red seems to become completely broken and irresponsive which is assumed was lying in broken packages but it's basically every package.

i tried installing them inside the container from the command line using npm however this did not work either.

Logs do not show a lot either already discussed and tried that in: Unable to deploy new flows, nothing visible in logging - #20 by tve

attach to the container and watch stdout

not really something interesting to see there, otherwise it would've been a lot easier to figure it out what the issue is.

Apparently it's not related to the packages either, as when i do a clean start of node-red i can deploy once and after that it's just not doing anything

home_node-red.1.trn4vqgfremz@worker-pi    | 12 Apr 21:02:19 - [warn] Encrypted credentials not found
home_node-red.1.trn4vqgfremz@worker-pi    | 12 Apr 21:02:19 - [info] Server now running at http://127.0.0.1:1880/
home_node-red.1.trn4vqgfremz@worker-pi    | 12 Apr 21:02:19 - [info] Starting flows
home_node-red.1.trn4vqgfremz@worker-pi    | 12 Apr 21:02:19 - [info] Started flows
home_node-red.1.trn4vqgfremz@worker-pi    | 12 Apr 21:03:16 - [info] Stopping flows
home_node-red.1.trn4vqgfremz@worker-pi    | 12 Apr 21:03:16 - [info] Stopped flows
home_node-red.1.trn4vqgfremz@worker-pi    | 12 Apr 21:03:16 - [info] Updated flows
home_node-red.1.trn4vqgfremz@worker-pi    | 12 Apr 21:03:16 - [info] Starting flows
home_node-red.1.trn4vqgfremz@worker-pi    | 12 Apr 21:03:16 - [info] Started flows

this is all that give after just adding a debug node and then trying for a second attempt

permission from the host are good as well as from inside the container:

-rw-r--r--    1 node-red node-red       540 Apr 12 21:03 flows.json
drwxr-xr-x    3 node-red node-red      4096 Apr 12 21:02 lib
drwxr-xr-x    2 node-red node-red      4096 Apr 12 21:02 node_modules
-rw-r--r--    1 node-red node-red       120 Apr 12 21:02 package.json
-rw-r--r--    1 node-red node-red     22614 Apr 12 21:02 settings.js

Tried it on all nodes in my swarm to make sure it's not host/os related but no luck either.

Followed all steps in: Running under Docker : Node-RED to make sure i wasn't missing anything, but nothing really seemed to change anything.

At this point i am really out of ideas where the issue could lie, tried a whole lot of settings in the settings.js

set debugging to trace but it just shows:

home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [debug] red/nodes/flows.start : starting flow : global
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [debug] red/nodes/flows.start : starting flow : 1f420d58faaba97f
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [trace] [flow:global] start flow [global]
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [trace] [flow:1f420d58faaba97f] start flow [1f420d58faaba97f]
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [trace] [flow:1f420d58faaba97f] ------------------|--------------|-----------------
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [trace] [flow:1f420d58faaba97f]  id               | type         | alias
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [trace] [flow:1f420d58faaba97f] ------------------|--------------|-----------------
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [trace] [flow:1f420d58faaba97f]  a12bf4685f4a2389 | debug        |
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [trace] [flow:1f420d58faaba97f] ------------------|--------------|-----------------
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [trace] runtime event: {"id":"runtime-state","payload":{"state":"start"},"retain":true}
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:19 - [info] Started flows
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:48 - [trace] comms.open QPC8kOhMincQDoWck/8y1E4Xpcd5A/0FGB346daKBfI=
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:19:49 - [trace] comms.open R0Nt8iIQZmy8ik2A/pFhJ8pTTgkLohD/H5bZwNF7Jjc=
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:20:12 - [trace] comms.close QPC8kOhMincQDoWck/8y1E4Xpcd5A/0FGB346daKBfI=
home_node-red.1.vf6oxh7p3ife@worker-pi    | 12 Apr 21:20:13 - [trace] comms.open 5vFqYMEA4gOfwG7wVZ7/y93R00GZRtWNz8qZxNacwRg=

And switching away from docker is not really an option for me since it's not really scalable and i'd lose the high availability my current setup offers, as well as not having to expose anything outside or the bridge network it's in except for my mqtt broker

Looking at the stdout, I can see node-red continues to run. But you said...

So is it the browser where you are seeing issues?

The issue is in trying to deploy anything new to the flow after the first deploy, it just hangs, tried different browser and devices.

After i press deploy it's just not doing anything and remains as is.

So it does keep running but i can not change anything anymore which is the issue here.

What happens if you refresh the browser, is it responsive again?

What browsers have you tried? (And the versions)

Have you checked the browsers console for errors (have the console open and watch it as you press deploy)?

Are you doing full deploy? Flow deploy or node deploy?

Which contrib nodes do you have installed?

Does this happen on a clean node red install without contrib nodes?

Also, when it goes unresponsive, if you open a different browser is it responsive in that browser while it is still hung in the other?

I notice that in your docker-compose file you have not set a file version ?
From the Node-red documentation on Running under Docker
version: "3.7" is used .. something worth testing

Reading a bit on the importance of defining a version from the Docker official docs

Compose files that do not declare a version are considered “version 1”.

Several things differ depending on which version you use:
The structure and permitted configuration keys
The minimum Docker Engine version you must be running
Compose’s behaviour with regards to networking

Another thing you can check is whether the
/share/Container/container-station-data/application/node-red_backup
directory exists before starting the container.
im not a docker expert but from what i understand that folder structure must exist under the same folder where your docker compose .yml file is ?

tried firefox(latest), Chrome(latest), Safari(latest) for both mac and IOS.

refreshing does not make it responsive again, the console does not show anything

the issue persists without any contrib nodes installed, which means the title of my issue is wrong(sorry).

Tried all deploy modes to see if there was any issue, but that doesn't seem to make a difference either.

Opening it in another browser whilst it stuck does not alter or affect the behaviour of the other browser, and trying to proceed from there results in the page loading normal but deploying from there has just the same result.

sorry for unclarity the snippet is from a larger compose file:

version: "3.0"
services:
  grafana:
    image: grafana/grafana:9.2.4-ubuntu
    ports:
      - 3000:3000
    volumes:
      - /share/Container/container-station-data/application/grafana/etc:/etc
      - /share/Container/container-station-data/application/grafana/lib:/var/lib
    user: "1001:1001"

  influxdb:
    image: influxdb:1.8
    volumes:
      # Mount for influxdb data directory and configuration
      - /share/Container/container-station-data/application/influxdb/lib/influxdb:/var/lib/influxdb
      - /share/Container/container-station-data/application/influxdb/etc/backup:/home/backup
      - /share/Container/container-station-data/application/influxdb/etc/influxdb:/etc/influxdb

  mosquitto:
    image: eclipse-mosquitto:latest
    ports:
      - 9001:9001
      - 1883:1883
    volumes:
      - /share/Container/container-station-data/application/mosquitto/config:/mosquitto/config
      - /share/Container/container-station-data/application/mosquitto/log:/mosquitto/log
      - /share/Container/container-station-data/application/mosquitto/data:/mosquitto/data

  openhab:
    image: "openhab/openhab:3.4.1"
    ports:
      - 6969:6969
      - 7443:7443
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
      - "/share/Container/container-station-data/application/openhab/addons:/openhab/addons"
      - "/share/Container/container-station-data/application/openhab/conf:/openhab/conf"
      - "/share/Container/container-station-data/application/openhab/userdata:/openhab/userdata"
    environment:
      CRYPTO_POLICY: "unlimited"
      EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"
      OPENHAB_HTTP_PORT: "6969"
      OPENHAB_HTTPS_PORT: "7443"
      USER_ID: "1012"
      GROUP_ID: "1012"

  wireguard:
    image: lscr.io/linuxserver/wireguard:latest
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - PUID=1010
      - PGID=1010
      - TZ=Europe/Amsterdam
      - PEERS=fabianiphone,fabianmacbookprivate,ipadangeline,iphoneangeline,fabianmacbookwork
      - PEERDNS=auto
      - SERVERURL="<insert_url_here>"
    volumes:
      - /share/Container/container-station-data/application/wireguard/config:/config
      - /share/Container/container-station-data/application/wireguard/lib/modules:/lib/modules
    ports:
      - 51820:51820/udp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    dns:
      - 8.8.8.8
  tuya-mqtt:
    image: ghcr.io/mwinters-stuff/tuya-mqtt-docker:v3.0.0
    volumes:
      - /share/Container/container-station-data/application/tuya:/config

  node-red:
    image: nodered/node-red:latest-18-minimal
    environment:
      - TZ=Europe/Amsterdam
      - NODE_RED_CREDENTIAL_SECRET=<credential_secret>
    user: "1000:1000"
    ports:
      - 1880:1880
    volumes:
      - /share/Container/container-station-data/application/node-red_backup:/data
    dns:
      - 8.8.8.8

  telegraf:
    image: telegraf:1.4.0
    hostname: "{{.Node.Hostname}}"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /share/Container/container-station-data/application/telegraf/config/telegraf.conf:/etc/telegraf/telegraf.conf
    deploy:
      mode: global

All other apps in this compose file work with the directories as they are mounted exactly the same on each node for persistence, i did although forgot to mention that they are mounted through NFS-V4 on each of the nodes, this could be the culprit, but node-red always has been able to write to this location fine from the flows(i send pictures through a http post node and safe them on this location too.

Also attached from the shell into the container and did tried to write a random text file and that seems to work just fine.

OK, that confirms that the problem is to do with the browser access, as node-red is still able to accept another connection and work normally (till attempting a deploy).

possibly .. can you do a quick check by using a local test folder for volumes instead of the mounted one ?

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