question

jsladen avatar image
jsladen asked

[Solved] NodeRed settings-user.js not working

Hi,

I am using Node Red on several of my setups, and I am trying to enable the persistent file context to keep a few things over a reboot. For now I am testing on a Cerbo and a Pi, both running v3.30

I am creating the file /data/home/nodered/.node-red/settings-user.js as suggested, and have added the following which I believe is correct?

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

However this does not appear to work. I've tried restarting NodeRed via Remote Console, and rebooting the entire device, but no change.

On every boot I see the following in the log file, but I don't understand why it is not loading.

[info]: loading /data/home/nodered/.node-red/settings-user.js failed

The settings-user.js file is owned by nodered, as is the .node-red folder

Node-RED
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
dansonamission avatar image
dansonamission answered ·

Mine looks like this, it looks like you have too many commas.


module.exports = {
  uiHost: "",
  contextStorage: {
    default: "memoryOnly",
    memoryOnly: { module: 'memory' },
    file: { module: 'localfilesystem' }
  }
}
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jsladen avatar image
jsladen answered ·

I thought I tried with every combination of closing commas that might or might not work already, but apparently not!


Solved, Thank you

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

derrick thomas avatar image
derrick thomas answered ·

I have created a package just for this purpose that is installed via Kevin Windrem's setuphelper. This enables context storage and will reinstall after firmware updates.

Package name: ContextStorage

GitHub username: drtinaz

Branch/tag: main

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.