Node red restarts after logging errors

Hello i am completely new with node red. I created 7 flows and deployed almost 400 nodes . I use node-red modbus node to extract several info from one UPS unit and one A/C unit via modbus tcp . Although flows are behaving as they supposed to do , i realised from chart graphs i use ,that node red restarts between periods . I then look to the ubuntu server logs and get several errors . In each flow i inject every node with the same inject node having an interval of 1 sec . Here are the errors i get

0|node-red | 2: 0x9db976 node::OnFatalError(char const*, char const*) [node-red ]
0|node-red | 3: 0xb39f1e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, ch ar const*, bool) [node-red]
0|node-red | 4: 0xb3a299 v8::internal::V8::FatalProcessOutOfMemory(v8::internal ::Isolate*, char const*, bool) [node-red]
0|node-red | 5: 0xce5635 [node-red]
0|node-red | 6: 0xce5cc6 v8::internal::Heap::RecomputeLimits(v8::internal::Garb ageCollector) [node-red]
0|node-red | 7: 0xcf1b5a v8::internal::Heap::PerformGarbageCollection(v8::inter nal::GarbageCollector, v8::GCCallbackFlags) [node-red]
0|node-red | 8: 0xcf2a65 v8::internal::Heap::CollectGarbage(v8::internal::Alloc ationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node-re d]
0|node-red | 9: 0xcf5478 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8 ::internal::AllocationType, v8::internal::AllocationAlignment) [node-red]
0|node-red | 10: 0xcbc118 v8::internal::factory::NewFixedArrayWithFiller(v8::int ernal::RootIndex, int, v8::internal::Object, v8::internal::AllocationType) [node -red]
0|node-red | 11: 0xcbc220 v8::internal::Handlev8::internal::FixedArray v8::int ernal::factory::NewFixedArrayWithMapv8::internal::FixedArray(v8::internal::Roo tIndex, int, v8::internal::AllocationType) [node-red]
0|node-red | 12: 0xee306e v8::internal::OrderedHashTable<v8::internal::OrderedHa shMap, 2>::Allocate(v8::internal::Isolate*, int, v8::internal::AllocationType) [ node-red]
0|node-red | 13: 0xee3225 v8::internal::OrderedHashTable<v8::internal::OrderedHa shMap, 2>::Rehash(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Ord eredHashMap>, int) [node-red]
0|node-red | 14: 0xee386b v8::internal::OrderedHashTable<v8::internal::OrderedHa shMap, 2>::EnsureGrowable(v8::internal::Isolate*, v8::internal::Handle<v8::inter nal::OrderedHashMap>) [node-red]
0|node-red | 15: 0xfd60f8 v8::internal::Runtime_MapGrow(int, unsigned long*, v8: :internal::Isolate*) [node-red]
0|node-red | 16: 0x1374fd9 [node-red]

Is there any chance i can deal with this mess? or i should immediatly leave the project. (Everything is working fine except the restarts i deal with) . Also is there any chance that flows i use to somehow damage ups network managment card? thanks a lot.

That is an OutOfMemory error. Something about your flows is either leaking memory or just requires more memory then your device had available.

What sort of device is this running on? How much memory doesn't have? What version of nodejs and Node-RED are you using?

Thank you very much for the quick response . This is running on an ubuntu vm . i can double the memmory of this server if this could help. Node-RED version: v1.0.3
0|node-red | 12 Jan 17:20:37 - [info] Node.js version: v12.14.0
0|node-red | 12 Jan 17:20:37 - [info] Linux 4.4.0-170-generic x64 LE

also when i want to deploy a flow . an info message appears and states that there are 45 nodes that are not configured well. But i cant map the problem with that nodes and everything seems to work just fine. i only use modbus flex getter nodes seperatly for every info i want from manufactures register map. and have set timeout to 6000 and reconect timeout to 2000 also i have ticked recconect on timeout and as i said i inject all of modbus flexgetter nodes from the same inject node with 1s interval.

What do you see when you start node-red in a terminal? Post the full startup log here if possible.
How much memory has it got at the moment?

Since you mentioned modbus, have you made sure to set all those modbus nodes to use the common configuration you created for the first one? In the flow editor, a red triangle will show at the top (middle?) of a node to show that it hasn't been configured correctly. Go through the editor and see which nodes that are and fix those nodes first, that might be related to your issue as well.

OK, so you have a lot of errors here and at least some of them are down to configuration. For example:

0|node-red | 12 Jan 17:42:58 - [error] [tls-config:3ec67889.eb1668] No certificate/key file provided

Did you copy the flow from another device? If not, it indicates that you've forged ahead full-steam without correcting things as you went along.

I would suggest initially that you

  1. Stop node red and correct any system issues
  2. Rename your flow file and start node-red making sure there are no errors.
  3. Stop node-red and put back the original flow file but disable most of the flow.
  4. Add back parts of the flow 1 piece at a time, doing a commit between changes and making sure you are checking the logs for errors as you go.
top - 17:05:21 up 9 days, 6:37, 5 users, load average: 0.12, 0.04, 0.01
Tasks: 163 total, 2 running, 161 sleeping, 0 stopped, 0 zombie
%Cpu(s): 30.2 us, 1.9 sy, 0.0 ni, 67.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 6101848 total, 3858616 free, 261264 used, 1981968 buff/cache
KiB Swap: 998396 total, 998396 free, 0 used. 5684716 avail Mem

This would seem to indicate that you have plenty of memory and you don't seem to have a CPU resource issue either. If you were running short of system memory, you would start to see swap file utilisation creep up.

Yes, because when you copied the flow, you copied to a device that doesn't have the same settings and possibly not the same OS configuration.

1 Like

What you mean by "for the first one". Also i am not observing any red triangle . Can you please describe how i can access the editor . The only way i can access editor is when after a deploy appears a message stating that "there have been some changes ----> reviw them "and everything there seems right

That doesn't make sense to me. The Deploy button is in the editor so you must be in the editor already in order to do the deploy.

1 Like

Sorry wrong terminology . By editor i meant the list with nodes . For example if server runs newer flows a message appears and you can review changes . I thought that list was the editor not the workplace you can create flows. in any case could it possible to find the wrong configured node inside the editor (workspace) and not from servers terminal?

I think you need to follow the advice @TotallyInformation gave earlier.

1 Like

:sigh: if only my wife were as wise as you Colin! :rofl:

1 Like

Totallyinformation first of all thanks for your time and help you provided. I didnt try to rename because the last time i got involved with servers terminal everything collapsed:) :slight_smile: . Since that can you please advise how to rename flow file?. I use this command to start node-red.( pm2 start /usr/bin/node-red). Also you said that i have many errors . do you count as an error modbus timeout and reconect logs? I m pretty sure you understood my ...experience so if you can describe as you talk to a 5 years old boy :slight_smile: Also i want to give a clue here . Everything is working just fine except from the fact that node-red restarts by itself every 10-15 hours

Are you using node-red-contrib-fs? You can look in the Manage Palette menu.

i saw that i have not installed node-red-contrib-fs

Assuming that you are logged into the server with the same userid that runs node-red and assuming you are using Linux.

cd ~/.node-red
mv flows_WHATEVERYOURSISCALLED.json xxflows_WHATEVERYOURSISCALLED.json

Yes.

You have multiple issues so it is virtually impossible for anyone to resolve everything. Like anything on a computer, you have to take things in simple steps, 1 at a time.

Particularly with a complex platform like Node-RED, you have to be sure you have the basics working correctly before bunging in a whole load of modbus nodes. Just looking through the forum indicates that modbus can be a pig (I don't use it so I'm only going by the forum).

In case you don't know the name of the flows file it is included in the node-red startup log.