Corrupt context file causes Node-RED server to fail to start

It doesn't quite feel right that a corrupted context file should prevent Node-RED from starting - is that expected behaviour?

If so, could that error be better trapped with an error message and the server allowed to continue?

0|Node-RED  | 9 Oct 13:33:06 - [error] Failed to start server:
0|Node-RED  | 9 Oct 13:33:06 - [error] Error: Error loading context store: Error: Invalid JSON in context file 'D:\src\nr\data\context\ba86b64531fa3971\cb93e1c6dee6854a.json'
0|Node-RED  |     at D:\src\nr\node_modules\@node-red\runtime\lib\nodes\context\index.js:180:15

I think, I've seen GH issues (or Forum) about this before.

Would a setting to automatically delete the corrupted file and then regenerate it be a better option?

I would prefer not to be honest. I'm not sure what corrupted the file though I did have a Blue Screen crash today which might have been it - I don't believe that was related to Node-RED BTW.

I renamed the file because I wanted to check out what it contained but needed Node-RED to restart. That would be my preferred outcome I think because when it did start up, the file - with all valid data was re-created.

I've not had time to look to see if that was because I have a startup inject that creates it, it was test data after all so that may well be the case.

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