Failed to start server:

Hello, I am having this problem with node red after not using it for a longtime, how can I fix it? I am grateful that you answer my question!!

Welcome to Node-RED

8 Jan 16:43:30 - [info] Node-RED version: v3.0.2
8 Jan 16:43:30 - [info] Node.js version: v16.16.0
8 Jan 16:43:30 - [info] Windows_NT 10.0.14393 x64 LE
8 Jan 16:43:34 - [info] Loading palette nodes
8 Jan 16:43:42 - [info] Settings file : C:\Users\InfoLabor.node-red\settings.js
8 Jan 16:43:42 - [info] Context store : 'default' [module=localfilesystem]
8 Jan 16:43:43 - [error] Failed to start server:
8 Jan 16:43:43 - [error] Error: Error loading context store: Error: Invalid JSON in context file '\Users\InfoLabor.node-red\context\8142c27a2c12d042\flow.json'
at C:\Users\InfoLabor\AppData\Roaming\nvm\v16.16.0\node_modules\node-red\node_modules@node-red\runtime\lib\nodes\context\index.js:180:15

Welcome to the forum @CESLBM
That file is messed up. It holds the persistent context values for one of your flows. If the saved context values are not important then you can delete that file and it will be recreated when you use flow.context again. If the values are important then post the contents of that file in case it can be recovered.

As this is not about this forum, I've moved the Q to general.

Hi Colin,
thanks for you reply. If I understand it right, I should delete the flow.json. After I did it, it comes another error:
9 Jan 10:39:38 - [info] Node-RED version: v3.0.2
9 Jan 10:39:38 - [info] Node.js version: v16.16.0
9 Jan 10:39:38 - [info] Windows_NT 10.0.14393 x64 LE
9 Jan 10:39:43 - [info] Loading palette nodes
9 Jan 10:39:53 - [info] Settings file : C:\Users\InfoLabor.node-red\settings.js
9 Jan 10:39:53 - [info] Context store : 'default' [module=localfilesystem]
9 Jan 10:39:53 - [error] Failed to start server:
9 Jan 10:39:53 - [error] Error: Error loading context store: Error: Invalid JSON in context file '\Users\InfoLabor.node-red\context\global\global.json'
at C:\Users\InfoLabor\AppData\Roaming\nvm\v16.16.0\node_modules\node-red\node_modules@node-red\runtime\lib\nodes\context\index.js:180:15

And when I delete this global.json, came error after the node-red is started:
9 Jan 10:42:31 - [info] Starting flows
9 Jan 10:42:36 - [info] Started flows
09:42:41.753Z :client_session_impl :1507 [NODE-OPCUA-W21] Pending transactions: CreateMonitoredItemsRequest CreateMonitoredItemsRequest CreateMonitoredItemsRequest CreateMonitoredItemsRequest CreateMonitoredItemsRequest CreateMonitoredItemsRequest CreateMonitoredItemsRequest CreateMonitoredItemsRequest CreateMonitoredItemsRequest CreateMonitoredItemsRequest CreateMonitoredItemsRequest
09:42:41.763Z :client_session_impl :1512 [NODE-OPCUA-W22] Warning : your opcua client is sending multiple requests simultaneously to the server CreateMonitoredItemsRequest
... please fix your application code
9 Jan 10:42:42 - [red] Uncaught Exception:
9 Jan 10:42:42 - [error] Error: subscription must be active and not terminated
at assert (C:\Users\InfoLabor.node-red\node_modules\node-opcua-assert\source\index.ts:12:21)
at ClientSubscriptionImpl._add_monitored_item (C:\Users\InfoLabor.node-red\node_modules\node-opcua-client\source\private\client_subscription_impl.ts:660:15)
at ClientMonitoredItemImpl._before_create (C:\Users\InfoLabor.node-red\node_modules\node-opcua-client\source\private\client_monitored_item_impl.ts:334:22)
at Function._toolbox_monitor (C:\Users\InfoLabor.node-red\node_modules\node-opcua-client\source\client_monitored_item_toolbox.ts:61:27)
at C:\Users\InfoLabor.node-red\node_modules\node-opcua-client\source\private\client_subscription_impl.ts:1004:40
at Immediate.waitForSubscriptionAndMonitor (C:\Users\InfoLabor.node-red\node_modules\node-opcua-client\source\private\client_subscription_impl.ts:693:17)
at processImmediate (node:internal/timers:466:21)

Did I understand your response correctly? Could you pls give me some further advice? Thanks a lot

In short, a node-red contrib node should handle its own errors to prevent crashing node-red.

IMO, this is a bug in the OPCUA nodes & you should raise an issue on their github repository (include the above quoted info)

Hi Steve-Mcl
thanks a lot for the Information!

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