Problems setting up node-red

  • Hi there.


    I am trying to set up Node Red in docker but am getting a constant error.


    I am using this for the docker code:



    but keep getting this error when I try to get the container up:



    Any advice, on what the issue is, would be much appreciated.


    I have a number of other dockers that I have deployed without any issue but this is the first one that has caused me any issues.

  • Here is the docker log:


  • First thing, I am not certain but I don't think the service name should have a space. Change it to the following and try to pull/start the container again.


    Also as you are using local storage for persistent data, you don't need the volume section at the end.


    Start with the most simple setup possible - like this.... It will create a default bridge network automagically.


    If this still does not work, I think it will be a permissions issue on your node-red local appdata folder.


    Code
    service:
      node-red:  # note I have replaced the space with -
        image: nodered/node-red:latest
        environment:
          - TZ=Europe/London
        ports:
          - 1880:1880
        volumes:
          - /srv/dev-disk-by-uuid-85c4513d-cfd9-4134-ad11-5d6552e81a81/appdata/node-red/data:/data

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • here is a slightly updated version that will help you solve permissions issue if you have any.


    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • Thanks so much for the input.


    I have tried with that last code that posted and the appsuer is indeed 1001:100.


    Unfortunately, I am still getting the following:


  • Damn - spoke too soon.


    Still having this error and the docker keeps stopping:


  • Finally figured it out.


    In case it helps anyone else, the docker container defaults to assuming that the owner of the data folder is 1000 (which it is not in my case).


    To get round this, I had to add "appuser" to my ssh group, ssh in and then create the data folder.

  • Yep. I don't use node-red so can't help too much. This is what I would do.


    1. remove the user info from the compose file so that nodered is using the standard 1000:1000 user/group

    2. ssh to console and chown the data folder (sudo chown -R 1000:1000 path/to/your/node-red/data)

    3. start container


    post any error after doing this and I will see if I can help further.


    if you are a windows person, I suggest you install winSCP on your PC as it's quite helpful for checking/updating permissions etc.

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • I couldn't help myself and have setup node-red in docker. Working fine. This is what I did. Exactly...


    1. created data folder in appdata and set permissions to appdata:users (using winSCP)



    2. created compose file like this



    3. pulled and then started the container


    4. checked docker logs


    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • This worked for me ,,, thank you

  • all good Ghazzawi


    It is quite unusual for such a mature container to not have environment variables for PUID and PGID.


    In my test, I have got nodered working using my usual appuser account permissions. This is probably a cleaner way of doing it as you do not need to play around with setting chown permissions.


    Have fun with nodered! I have linked it with my home assistant setup but i'm too scared to use it properly. haha

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • Thank you soooooooo much, Jata1.


    I finally got it working, thanks to you.


    I ended up adding


    user: 1001:100


    to compose but then the trick was to change the data file to


    (sudo chown -R 1001:100 path/to/your/node-red/data)


    Working perfectly, now.


    Node-Red with HA is brilliant - I find it much easier to set up complicated automations, when I can visually see everything happening.


    Thanks again!

  • Good that it worked for you but...


    You really need to change 1000:100 to the GUID and GPID of your normal docker user account. You should try to use a dedicated account for all your containers (where possible). For security and reasons mainly. But it is up to you.


    When you create or view users in the OMV GUI, you can add the columns to the view in the dashboard to see the IDs - see below.


    Then you just make sure that your appdata directory/folder is also setup so that your 'docker' user account has read/write access.



    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • I have to admit, I still find permissions in Linux quite confusing.


    I followed the Docker section in the OMV7 guide, exactly, and I set up a dedicated user called "appuser", which had a UID of 1001 and a GID 100.


    I cannot quite work out why I needed


    user: 1001:100


    because I thought that all containers would automatically use the appuser ID automatically.

  • Well this explains why it is working using 1001:100 as this is a real account on your system probably with permission to read/write.


    And nope - containers do not automatically use the appuser account. Most containers have environment variables that need to be configured.


    There is not much more you really need to do but if you have issues with read/write permissions on the folders that you are creating for docker volumes (e.g. /appdata/node-red) you might just need to update the permissions (folder/file level) using chown.


    Note: Use chown -R with caution as it will change ownership all files and directories recursively. It won't delete anything but can cause bug issues (e.g. if you change the owner of OS files)


    You can actually use the GUI to chown - from the shared folder page of the GUI - It is known as ACL (access control list) - but don't use this unless you really need to. It's safe to have a look (but don't save changes) as you can get a better idea of the folder/file level permissions in your /appdata folder.


    Good luck.

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • No probs. Plenty of folks here have helped me so nice help someone else for a change. 😂

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!