After upgrade UI stops working

Hello,

I have recently upgraded node-red from v.0.19.5 to v.1.2.9. Now node-red works for the existing flows. However I cannot log into the UI anymore. The screen stops at the Message "loading flows". In the log file I can see, that it keeps crashing with Javascript Out of Memory error. Here is the stack trace:

Mar  8 09:59:31 server node-red[12185]: <--- JS stacktrace --->
Mar  8 09:59:31 server node-red[12185]: ==== JS stack trace =========================================
Mar  8 09:59:31 server node-red[12185]: Security context: 0x3f1002c98fe1 <JSObject>
Mar  8 09:59:31 server node-red[12185]:     1: fromString(aka fromString) [buffer.js:314] [bytecode=0x25afc8cf87a9 offset=164](this=0x3f1002c82241 <undefined>,string=0x16bbf27eb8d1 <Very long string[949467]>,encoding=0x3f1002cf01a9 <String[4]: utf8>)
Mar  8 09:59:31 server node-red[12185]:     2: from [buffer.js:177] [bytecode=0x25afc8cf82b1 offset=11](this=0x1090cb348b31 <JSFunction Buffer (sfi = 0x50fae4282d1)>,value=0x16bbf27eb8d1 <Very long string[949467]>,encodingOrOff...
Mar  8 09:59:31 server node-red[12185]: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Mar  8 09:59:31 server node-red[12185]:  1: node::Abort() [node-red]
Mar  8 09:59:31 server node-red[12185]:  2: 0x5555c0f25011 [node-red]
Mar  8 09:59:31 server node-red[12185]:  3: v8::Utils::ReportOOMFailure(char const*, bool) [node-red]
Mar  8 09:59:31 server node-red[12185]:  4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node-red]
Mar  8 09:59:31 server node-red[12185]:  5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node-red]
Mar  8 09:59:31 server node-red[12185]:  6: v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [node-red]
Mar  8 09:59:31 server node-red[12185]:  7: v8::String::WriteUtf8(char*, int, int*, int) const [node-red]
Mar  8 09:59:31 server node-red[12185]:  8: node::StringBytes::Write(v8::Isolate*, char*, unsigned long, v8::Local<v8::Value>, node::encoding, int*) [node-red]
Mar  8 09:59:31 server node-red[12185]:  9: node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) [node-red]
Mar  8 09:59:31 server node-red[12185]: 10: 0x5555c0f4ae46 [node-red]
Mar  8 09:59:31 server node-red[12185]: 11: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [node-red]
Mar  8 09:59:31 server node-red[12185]: 12: 0x5555c08a3b62 [node-red]
Mar  8 09:59:31 server node-red[12185]: 13: 0x5555c08a40af [node-red]
Mar  8 09:59:31 server node-red[12185]: 14: 0x6264e9840bd
Mar  8 09:59:31 server systemd[1]: node-red.service: Main process exited, code=dumped, status=6/ABRT
Mar  8 09:59:31 server systemd[1]: node-red.service: Failed with result 'core-dump'.
Mar  8 09:59:31 server systemd[1]: node-red.service: Service hold-off time over, scheduling restart.
Mar  8 09:59:31 server systemd[1]: node-red.service: Scheduled restart job, restart counter is at 34.

Is this most probably a plugin problem and should I remove all plugins? Or is this maybe a known problem that can be fixed otherwise? Any help is very welcome. Here are additional infos:

OS: Ubuntu 18.04.5 LTS
Installed and upgraded via : sudo npm install -g --unsafe-perm node-red

Thanks a lot!

I've recently had similar issues with node-red not starting after and upgrade. On both a Beaglebone Green and a PiZeroW.

Editing the settings.js file (I'd had logging turned off before) seemed to start it once I saved the edit.

Haven't be able to restart each system yet to see if its really fixed or not.

PiZeroW (1.2.9) was upgraded using the bash script, Beaglebone (1.2.9) was done via apt upgrade.

Can you show us the startup log from when you start node-red please, from the beginning to where it crashes.

Did you also upgrade nodejs or just node red?

Hello All,

Thank you very much for your answers! I was able to resolve it. Apparently the update script only updated the node-red core. It did not update the node.js. So I had an up to date node-red but a version 8 node.js. These did not work together well. Colin, you were correct.

I upgraded using this script:

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

It did kill my service settings, but it upgraded the node.js to Version 12. Now everything seems to be working fine.

I suspected it was the nodejs version, and using the script is exactly what I was going to suggest using.

Oh, for the first try I used this command for upgrading:

sudo npm install -g --unsafe-perm node-red

Which way (command or script) to use in which situation seems a bit unclear to me. Also I had to delete an old plugin ( node-red-contrib-ttn ) that did'nt seem to play well with the rest.

If you just want to upgrade node red then it is fine to use the npm update command and provided the new version doesn't need a later version of nodejs then that should be ok. If the new version of node-red requires a later version of node-red then the script will handle that for you.

The problem with the ttn node is probably that it is not compatible with nodejs 10.

My PiZeroW has:
pi@pizeroMC:~ npm --version 6.14.10 pi@pizeroMC:~ node -v
v12.20.1

My Beaglebone Green:
debian@alarmbone:~/alarmbone$ node -v
v10.24.0
debian@alarmbone:~/alarmbone$ npm --version
5.8.0

Both seem to work fine once they start, but I've had issues getting them to start as a service after a reboot. The Beaglebone is apparently setup wtih -g --unsafe-perm and runs as user node-red.

I'll start a new thread if I have issues after I reboot them and can see what if anything gets logged.

By that do you mean that it overwrote nodered.service? If so then that is expected. If you want to tweak the service parameters then rather than editing it you should add a override file, so that updates to node red will not destroy your changes. configuration - How do I override or configure systemd services? - Ask Ubuntu

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