Write node on Synology NAS

Hi everyone,
I'm having my nodered instance running on a docker in my synology NAS.
All my nodered files are stored within this folder \docker\nodered

With the write node, I am creating a file within this folder \docker\nodered\test.txt
From nodered I can even read it and it works.

I can however not see that file in the NAS, is nodered storing that file somewhere else?
Using the search function in the NAS I can find the file nowhere...

Any idea how to resolve?
Many thanks

You need to work out what volumes are mounted into the container any where.

Best guess is that /docker/nodered is actually mounted as /data inside the container.

1 Like

Thanks hardilib,
This is already done, how should I access it from nodered then, via docker/nodered or via /data?

this is how i access a dedicated subfolder under data /data/moon .. same works with writing node

[
    {
        "id": "9de58351a99f00f9",
        "type": "file in",
        "z": "2706c23f37b98003",
        "g": "473e9bf8eb5b00bb",
        "name": "",
        "filename": "payload",
        "filenameType": "msg",
        "format": "",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 640,
        "y": 300,
        "wires": [
            [
                "6b3e649902af74ac",
                "c4f3e1635ab024ba"
            ]
        ]
    },
    {
        "id": "6b3e649902af74ac",
        "type": "base64",
        "z": "2706c23f37b98003",
        "g": "473e9bf8eb5b00bb",
        "name": "",
        "action": "str",
        "property": "payload",
        "x": 780,
        "y": 300,
        "wires": [
            [
                "b0db3ba4922f42bf"
            ]
        ]
    },
    {
        "id": "f60a037859080a66",
        "type": "template",
        "z": "2706c23f37b98003",
        "g": "473e9bf8eb5b00bb",
        "name": "",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "/data/moon/{{astro}}.jpg",
        "output": "str",
        "x": 480,
        "y": 300,
        "wires": [
            [
                "9de58351a99f00f9"
            ]
        ]
    }
]

Sorry xx_Nexus_xx I was not able to test this, tried to copy paste but got the 3 flows which was unknown on my instance

Just install this palette :wink:

hi @Tomtom, the base64 node was only required to process the image ... in your case you need

  1. have the /data folder mapped to your NAS drive (i think yopu done that already)
  2. use the ReadFile (as in this example) to read a file into a buffer
  3. use a WriteFile in the same way to write your bufer to file ... your can write fulle files or even append to existing files (see part of code below, this example is using another maped folder /backup)
[{"id":"c794ed735e3d2474","type":"template","z":"4a94dfcf.4b415","name":"csv","field":"filename","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"/backup/{{filename}}.csv","output":"str","x":2550,"y":2040,"wires":[["3b15d24fd60b70f8"]]},{"id":"3b15d24fd60b70f8","type":"file","z":"4a94dfcf.4b415","name":"","filename":"filename","filenameType":"msg","appendNewline":false,"createDir":true,"overwriteFile":"false","encoding":"none","x":2780,"y":2040,"wires":[["ede04ab6941e7084"]]},{"id":"ede04ab6941e7084","type":"debug","z":"4a94dfcf.4b415","name":"debug 108","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":2930,"y":2040,"wires":[]}]

have fun

Hi xx_Nexus_xx,
I run the node and it said "failed to create file: Error: EACCES: permission denied, mkdir '/backup'".
What am I doing wrong?

Hi @Tomtom ,

looks like you do not have the correct user priviliges to create files and folder. I understand that you are running docker on Synology, than you will need to setup the correct file and folder permission to your /data and /backup folder.

Sorry, I have no idea on how this works on ynology, but in QNAP I had to use the filemanager to create a /backup and add PUBLIC access with permission to create/change files and subfolders .. additionally I mad sure that all my reguistered QNAP-users have full-access to this folder.

The above will open-up your Node-Red file structure to everybody and you will have to close it down (limit user-access) as soon you have it working.

Ways to test the folder access:

  1. go into your docker console for Node-Red and manually create a file in the /data folder .. if this does not work you have to check your file/folder/user settings until it works
  2. do same as above and try to create the new /backup folder manually .. if it fails .. do same as above :wink:
  3. use your windows filemanager and log into your folder of the Node-Red /data or /backup folder .. try to create a file or subfolder

Your issue is not with Node-Red, but with the file/folder permission on Synology with docker. You need to get help from that direction.

I'm not using the docker-environment on my QNAP NAS anymore as there were too many device/environment specific elements to consider.

I'm now running a Ubuntu LINUX-Laptop with docker and mapping all my folders to the folders on my qnap qith a few simple steps

  1. Create the folder on your NAS with normal user-credentials
  2. Creat a folder map on your docker environment pointing to your NAS (mine is 192.168.2.240) and im using Webmin to do the mapping
  3. assign the folder to your NR-Docker image (I use portainer)
    image
  4. same can be done for as many folders you like :wink:

Thanks to all for your answers; I have not managed to make it working so far but will continue to digg-in within the Synology NAS !

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