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

Set Context Storage to filesystem #40

Open
bobpecor opened this issue Apr 13, 2023 · 3 comments
Open

Set Context Storage to filesystem #40

bobpecor opened this issue Apr 13, 2023 · 3 comments

Comments

@bobpecor
Copy link

Hi,

I'm trying to configure the node red plugin to save context data to the file system.

In the plugin config, I set the Setting Name to:

contextStorage

and the Value to:

{"default":{"module":"localfilesystem"}}

The log contains the following message:

@signalk/signalk-node-red setting contextStorage to {"default":{"module":"localfilesystem"}}

However, the following error message is logged:

TypeError: Cannot read properties of undefined (reading 'forEach') at Object.addModule

@sbender9
Copy link
Member

Do you have the full stack trace of that error?

@bobpecor
Copy link
Author

Thanks for the quick reply.

I do:

TypeError: Cannot read properties of undefined (reading 'forEach')
at Object.addModule (c:\dev\signalk\signalkhome.signalk\node_modules@node-red\registry\lib\registry.js:195:27)
at c:\dev\signalk\signalkhome.signalk\node_modules@node-red\registry\lib\loader.js:153:34

I have, however, solved the issue.
After adding the config property/value (and receiving the error), I restarted Signal K and did not see the error again.
Instead, I saw the following in the log:

Context store : 'default' [module=localfilesystem]

@christywastaken
Copy link

@bobpecor Did context start storing persistently for you after this?

I have implemented it as you've described above and I'm not getting errors, however the storage isn't persistent.

My signalk-node-red.json looks like this:

{ "configuration": { "logging": "info", "requires": [ "mongodb" ], "settings": [ { "name": "contextStorage", "value": "{\"default\":{\"module\":\"localfilesystem\"}}" } ] }, "enabled": true, "enableLogging": false }

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

No branches or pull requests

3 participants