NR + Docker: Installation of new module leads to crash (dbus error)

Hiho folks :slight_smile:
I use Node Red in Docker and ported it from Raspberry Pi to WSL Docker x86 for performance reasons.
Everything works fine since I try to install a new node module. I tried ui_etable and some other ping related nodes. At first I thought its just a problem with the nodes in combination with docker but then I checked that they work well on my old Raspi installation. So the nodes itself does work. And they do also work on docker until I rebuilding the container they then crash Node Red with similar error messages like so:

Error: connect ENOENT /host/run/dbus/system_bus_socket
raspi-nodered-1 | at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1247:16)

Since it only appears after I rebuild the containert, I think there may be a problem with missing volume settings. Who is familiär with docker knows that changes inside the container are only temporary and are gone after rebuilding the container. If I missed to link a path to outside the container by setting up the right volumes this could be the reason for my problems.

Here is my docker-compose.yml where the volumes set:

    build: ./docker/nodered
    restart: always
    - TZ=Europe/Berlin
    - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
    - 1880:1880
      - mosquitto
      - mariadb
    - ./data/nodered:/data
    - ./data/nodered/home:/home

and my Dockerfile:

FROM nodered/node-red:3.0.2-18
USER root
RUN apk add ffmpeg

Thanx in advance for your apprentice and help!

OK, I reply to myself or to anyone how knows about this issu:

When adding a node modul the dependencies will also be added to the .node-red/node_modules directory. In my case there is a dependency called "dbus-next" added to this folder. This seems to be the reason for my problem. If I delete this folder everything works fine again.

Someone has any idea why dbus-next is added and if its needed or why it causes problems ?

If one of the nodes you installed also installed the dbus node, then deleting that folder will not be enough. The next time you install any node npm will pull it in again. You can find what installed it by running, from the node red flows folder
npm list dbus-next

1 Like

Thanx for the hint.
In my case I crawlend the dependency files and found out that "node-red-contrib-ble" (a Bluetooth scanner) was the cause btw it pulled it as dep. But now I know the easy way to look for it. Thx!

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