Node-Red with Balena-Engine Files Directory Issue

Hello, I just wanted to ask about an issue I’ve been having writing files to the PLCnext from Node-Red while running it on Balena-engine. Essentially had the same problem as this page: https://www.plcnext-community.net/en/discussions-2-offcanvas/node-red-on-docker-with-balena-engine-need-mkdir-permission-on-plc-next.html mkdir node-red-user-data docker volume create --name node-red-user-data docker run -it … -v /opt/plcnext/node-red-user-data:/data … ^^^ The commands suggested to fix the issue. I’ve tried following the steps of making a directory and a volume, but the 3rd command was having the following error when I tried running it when I tried running. Am I getting the command wrong somewhere? Any advice would be much appreciated.

can you try: balena-engine run ----- -v node-red-user-data:/data … This will use the volume instead of the directory in /opt. I think the issue is in node-red. Maybe the container has no root user and so no rights to write to the filesystem directory. Maybe it helps to change the permission to everyone: chmod 777 /opt/plcnext/node-red-user-data G Jan

Thanks for the response. I tried this command: balena-engine run ----- -v node-red-user-data:/data … Unfortunately, I was still getting the same permission denied error in Node-Red. I tried using this command: chmod 777 /opt/plcnext/node-red-user-data and was, fortunately, able to run the 3rd command: docker run -it … -v /opt/plcnext/node-red-user-data:/data … without getting the previous ELIFECYCLE error as seen in the previous image I sent. Unfortunately, I was still getting the same permission denied error in Node-Red. I’m not sure if it might be a mistake from me on the Node-Red side. Did I specify the file path correctly? Might mess around with it a bit more. Any help at all would be much appreciated.

Volume Created as Folder in Host.PNG
Error Persists.PNG

As they say, sometimes i can’t see the wood for the trees? We are thinking the wrong way round. The path in your flow /opt/… is based in the host system but not in the container. The corresponding path in the container is /data. The data from /data is mapped to /opt/… You now try in your flow to change the path /opt/… in the container. But this is not possible because the path didnt exist and the user in the container has no rights to create this. Node-red is very strict here. You have to use the path /data from the container in your flow. For the backup, a volume is sufficient, i.e. a mapping like node-red:/data … Without a leading /, docker/balena creates its own volume here. If it is to be a folder like /opt/… in the host system, this needs user permissions for the node-red user. So either create the user and give him the folder or release the folder for everyone. G Jan