Node-red working directory?

I am having a difficult time with trying to figure out where the node-red working directory is.

I am running Home Assistant 2021.9.6, Node-red ver. 10.0.0. I am trying to figure out this node addon node-red-contrib-bigfile (node) - Node-RED and I have imported the example flow files example on that page. When I run the first one (First of all, generate a random file), it is supposed to spit a bunch of lines into a file called temp.demo.bigfile. It does that successfully, and when I run the subsequent flows (bigfile usage demo pre-configured), the data is there, and I get strings and lines in payload, so the example appears to be working.

I have scoured the file system (using both File editor, SSH & Web Terminal and Terminal & SSH) looking for where it writes this file and I can’t find it anywhere. When I look at Node-RED which runs in HASSIO as an addon, in the logs, it says

[info] User directory : /config/node-red/

which according to the Node-RED documentation is where it should be writing files unless otherwise specified. .

But under /config/node-red, I don’t see the file. I have a few other directories (nodes, lib, node_modules), but no file temp.demo.bigfile. Also when I try and upload a file to that location and use big file node to read it, it doesn’t read it, I get

ENOENT no such file or directory

Anyone know where or suggest where I can look where this file might get written? Thanks!

All the directories are mounted from the addon to different directories on the Host OS. This should be the mapping for them (from portainer addon). Yours might be different but you can try and install the portainer addon to double check and they will be listed there in the container details

Thanks for the response. I tried to install Portainer, which installs, but when I try and start it, it just stops after a bit. Not sure I’m using Docker, (I have Home Assistant installed on a Raspberry PI 4). Will troubleshoot that on a different thread, but if I can’t get the info from Portainer, is there another way to see this information?

Thanks again!

Just confirming you’re trying to install it from the addon store, not separate. Here’s additional documentation.

To get the portainer addon to work you have to go to the addon settings on the supervisor and disable “protected mode”.

Also in portainer itself, you have to unhide the “hidden” containers in the settings. Then go to containers, look at find the Node red addon, then it will she the mapped volumes.

Since the homeassistantos/addon system is fairly locked down, I’m not aware of another method to see the mapped directories.

Also, someone else recently found node red config files in usr/share/hassio/homeassistant

You are trying to write and read a file in nodered and you want the path? There are a few things to consider www is the only prefigured folder shared between containers and the internet.

When referencing it you change www to local. So www/myfolder/nodered/share.file is local/myfolder/nodered/share.file. Now anything stored in this folder is not protected by ha’s login.

You can enable context storage in nodered. This will create a folder called context located in config/nodered/context. This is a persistent storage and will survive reboots and reinstall/upgrade. This would only be available to nodered.

In the config/nodered folder you’ll find settings.js and will need to add

  contextStorage: {
    default: "file",
    memoryOnly: { module: 'memory' },
    file: { module: 'localfilesystem' }
  },

https://nodered.org/docs/user-guide/context#saving-context-data-to-the-file-system

1 Like

Thank you, just what I was looking for.