Node-Red Locks Up Consistently

I have 3 Ubuntu servers that are set up identically with node-red. Even the hardware is identical.

I use project control to replicate the exact same set of nodes across all 3 instances of node-red.

Two of the servers work great. On one of them, after installing the project and the node modules, node-red locks up. It always locks up at the same node-modules loading point. I have completely deleted nodejs, npm, node-red, and the project files and a reinstall does the same thing. There is nothing in the log.

I am planning on starting completely new with a fresh Ubuntu install but I thought someone might want to help me check out the root cause before I do that.

Joe

Just offering ideas... I'm not an expert.

On the bad machine, open a CLI/Terminal and stop Node-Red.
node-red-stop

Then, start it from the CLI/Terminal with
node-red
And watch what happens.

Or - thinking a bit more on suggestions:

node-red > log_file.txt

Then you can see what is happening and post it so people can see what is going on.

Thanks. Been there, done that. Nothing is showing up in the log. Node-red is actually locking up. But I am unable to tell exactly what is causing it.

Can you clarify this? Is it the editor loading in your browser that freezes? Or is it the node-red runtime (and how do you know)?

What browser are you using? Have you tried an alternative browser?

Have you looked in the browser's console log for errors?

You probably need to up the logging level and possibly turn on the audit log too. This is a LOT of data but should give you a better idea of when it is failing and what causes it.

Have you removed all the files in the userDir (including the hidden files)?

Also do you have a list of the extra nodes you have installed?

If it's in the scanning nodes phase of startup it will be walking all the installed nodes. A Binary chop of the extra nodes (only install half) might help to narrow down which node it's stalling on.

Sorry for any confusion. I am guessing it is node-red itself. As the browser is displaying loading the nodes, it stops mid-way through. I can access any menu option in the browser, but when I click on anything that seems as if it would communicate with node-red itself, there is no response.

I have tried multiple browsers to the same result.

The Chome console log gives me this:

Failed to load resource: the server responded with a status of 404 (Not Found)Understand this errorAI
hs1/:1 Refused to execute script from 'http://hs1:1880/index.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.Understand this errorAI
hs1/:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

I also got this in a browser error area:

Incorrect use of <label for=FORM_ELEMENT>
The label's for attribute doesn't match any element id. This might prevent the browser from correctly autofilling the form and accessibility tools from working correctly.

To fix this issue, make sure the label's for attribute references the correct id of a form field.

It shows 2 "violating nodes". Both are in the div class of "red-ui-settings-row" and they are "Name" and "Passphrase"

This is all foreign to me. So I hope this information helps?

edit: in doing a top command, node-red is utilizing about 7% CPU. This is typical for the other 2 servers.

I have tried this in a number of combinations. I have 22 additional nodes. I have yet to find a culprit. having said that, this exact combination of nodes works on 2 other supposedly identical servers.

OK, so this is not a node-red startup time, this is at load time of the editor in the browser.

That really helps narrow things down.

There isn't an index.js in the default Node-RED Editor so can you run the following command in the Node-RED userDir.

find . -name index.js

And report the output.

Thanks.

There is about 80 of them. Do you want the whole list?

Yeah, send them all, saves us having to ask again later.

Probably best to run the command again like:

find . -name index.js > file-list.txt

And attach the file to the post

file-list.txt (47.8 KB)

I can also start going through all of the nodes in more details. I deleted all of the contrib nodes and nodes that started with @, restarted NR, and the issue still exists.

I will keep going...

update: So I deleted all of the nodes in the node_modules dir. REstarted NR and the interface worked. I then installed a single contrib node and it locked up.

Looking at the node_modules dir, there are now many nodes existing. Does the fact that this is a project affect how nodes in node_modules are populated?

Whenever you run npm it will check that all the nodes defined in package.json are installed, so it will reinstall any nodes that you deleted from node_modules. If you want to uninstall nodes you should use npm.
It is possible to do it manually if you also update package.json, but it is easy to make a mistake and mess things up.

[Edit] If you do want to do it manually the best way is probably to delete the entries you want to get rid of from package.json (keep a copy of the original in case you mess up the syntax), delete the whole node_modules folder, then, in a command window go into your .node-red folder and run
npm install
which will re-install all the nodes that you left in node_modules. Then restart node-red.