Access synology NAS from node-red

I am new to linux Mint 20 and still learning.

I want to load a file from my Synology NAS. I get this error:

[{"id":"a2ebd710.f21f18","type":"inject","z":"12ca0c96.d3b703","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":320,"wires":[["e68c1f02.7765c"]]},{"id":"e68c1f02.7765c","type":"file in","z":"12ca0c96.d3b703","name":"NAS","filename":"afp://hannes@JU-NAS.local/share/Raspi/49-Monitor/aussentemp/02-2021-Aussentemp.txt","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":370,"y":320,"wires":[["7d97e21d.1d352c","6f705256.c0003c"]]},{"id":"6f705256.c0003c","type":"switch","z":"12ca0c96.d3b703","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":320,"wires":[["1caaef2b.912241"]]},{"id":"1caaef2b.912241","type":"json","z":"12ca0c96.d3b703","name":"","property":"payload","action":"","pretty":false,"x":690,"y":320,"wires":[["6a2d6c16.b675d4"]]},{"id":"7d97e21d.1d352c","type":"debug","z":"12ca0c96.d3b703","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":370,"y":260,"wires":[]},{"id":"6a2d6c16.b675d4","type":"debug","z":"12ca0c96.d3b703","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"filename","targetType":"msg","statusVal":"","statusType":"auto","x":710,"y":260,"wires":[]}]

"Error: ENOENT: no such file or directory, open 'afp://hannes@JU-NAS.local/share/Raspi/49-Monitor/aussentemp/02-2021-Aussentemp.txt'"

I used the path shown in my file properties.

the file has read and write access rights.

could this be a owner problem?

Outside of node-red, can linux mint box actually access afp://hannes@JU-NAS.local/share/Raspi/49-Monitor/aussentemp/02-2021-Aussentemp.txt ?

Maybe try without specifying the protocol?
//hannes@JU-NAS.local/share/Raspi/49-Monitor/aussentemp/02-2021-Aussentemp.txt

AFP is the Apple Filing Protocol (what was AppleTalk). So unless you have set that up on your Mint box, you won't be able to access the file.

Try setting up the NAS to use a less proprietary protocol or at least the more widely supported SMB.

1 Like

Thats why I asked if the OP could access the file in linux mint from outside node-red (for his voyage of discovery :slight_smile: )

Hi Steve,

  1. without the protocol same error.
  2. yes, I can access the file with my text editor, edit it and save.

I get the same error with an smb NAS on a Fritzbox Router.

"Error: ENOENT: no such file or directory, open 'smb://fritz-nas/fritz.nas/Samsung_T5/Node-Red/NR Local.txt'"

I also can open the file with my text editor

When you are reading/writing the file in mint desktop text editor, is that account the same account running node-red?

yes, it is all under my login.
I can read a file in my home directory with node red but not from the NAS

I thought I remembered that the file in node did not cope with samba and similar protocols, only local, and remote files mounted locally.

would mounting my NAS in fstab solve the problem?

When you use your text editor I think that the file manager is managing the protocol. Node-RED is a server and needs raw filing system access.

So yes, you need to mount the remote filing system for it to work unless you use a dedicated node that internally manages the remote protocol.

I think you're thinking of the Watch node that doesn't like non local files.

Quite possibly, so should the File node should handle smb:, sftp: etc? I have just tried it with sftp:// and it doesn't seem to work. The same sftp url works opening the file in an editor.

No - probably as we use the node.js file library - it says only file:/// or direct paths are supported. File system | Node.js v15.7.0 Documentation

Yes. Any locally mounted file should be accessible by the file node. Sftp is not a locally mounted file.

So my memory was correct, the file node won't cope with smb and similar protocols unless they are mounted locally.

The difference with the Watch node is that it doesn't like remote files even if mounted locally.

As I said some posts ago.

Yes, after I said I thought that was the case :slight_smile:
My post was in reply to Nick's as earlier he said I might be thinking of the Watch node.

mounting fritzbox and synology using smb did the trick.
Here what I have put into /etc/fstab:

//10.0.0.1/fritz.nas /mnt/fritzbox/ cifs username=xxxx,password=yyyy,vers=1.0,auto,users,defaults,_netdev 0 0

//10.0.0.9/share /mnt/synology/ cifs username=xxxx,password=yyyy,vers=1.0,auto,users,defaults,_netdev 0 0

[{"id":"a2ebd710.f21f18","type":"inject","z":"12ca0c96.d3b703","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":320,"wires":[["e68c1f02.7765c"]]},{"id":"e68c1f02.7765c","type":"file in","z":"12ca0c96.d3b703","name":"NAS","filename":"/mnt/synology/standard-temp.CSV","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":370,"y":320,"wires":[["6a2d6c16.b675d4"]]},{"id":"6a2d6c16.b675d4","type":"debug","z":"12ca0c96.d3b703","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":610,"y":320,"wires":[]},{"id":"b49358e.46b28a8","type":"file in","z":"12ca0c96.d3b703","name":"Fritz","filename":"/mnt/fritzbox/gaeste-temp.CSV","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":370,"y":440,"wires":[["28a61a3b.fa1fb6"]]},{"id":"670fd85.ca63a28","type":"inject","z":"12ca0c96.d3b703","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":440,"wires":[["b49358e.46b28a8"]]},{"id":"28a61a3b.fa1fb6","type":"debug","z":"12ca0c96.d3b703","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":440,"wires":[]}]
1 Like

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