Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File context store with dir property not working and corrupting other storage #3975

Closed
TotallyInformation opened this issue Dec 6, 2022 · 1 comment

Comments

@TotallyInformation
Copy link

Current Behavior

Please see https://discourse.nodered.org/t/multiple-localfilesystems/71617/48

All details there.

Expected Behavior

No response

Steps To Reproduce

No response

Example flow

paste your flow here

Environment

  • Node-RED version: 3.0.2
  • Node.js version: 16.18.1
  • npm version:
  • Platform/OS: Windows 10/WSL2/Debian - Linux 5.15.74.2-microsoft-standard-WSL2 x64 LE
  • Browser: Edge 107.0.1418.62 (Official build) (64-bit)
@knolleary
Copy link
Member

Turns out I had given bad advice in that thread in how to properly configure multiple stores.

I failed to remember the store config needs to be nested under a config property - as described in the docs here.

So instead of

contextStorage: {
   default: "memoryOnly",
   memoryOnly: { module: 'memory' },
   file: { module: 'localfilesystem', dir: '/home/user/.node-red/context1' },
   file2: { module: 'localfilesystem', dir: '/home/user/.node-red/context2' },
   file3: { module: 'localfilesystem', dir: '/home/user/.node-red/context3' }
},

it should have been:

contextStorage: {
   default: "memoryOnly",
   memoryOnly: { module: 'memory' },
   file: {
      module: 'localfilesystem',
      config: {
         dir: '/home/user/.node-red/context1'
      }
   },
   file2: {
      module: 'localfilesystem',
      config: {
         dir: '/home/user/.node-red/context2'
      }
   }
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants