Node-RED does not start when the internet is blocked

Hi there,

I use Node-RED behind a firewall, which blocks all data traffic from and to the Internet. The block is only temporarily lifted for individual URLs if necessary, for example to install updates. The firewall simply terminates the connections to the Internet. No status and no response is sent back from the firewall. This behavior cannot be changed either.

Now I had to find out that Node-RED no longer starts if the URL https://registry.npmjs.org is blocked by the firewall during the start process.

I would have expected that Node-RED would carry out error handling at this point and skip the NPM registry check.

The start process stops in the log after the operating system version has been output. As soon as I deactivated the firewall and restart Node-RED, Node-RED starts successfully.

If I set the logging to Debug or Trace (settingsfile-> logging.console: trace), no error message is output.

The blocking of the Internet does not cause any problems during operation, because I have deactivated the public node catalog of node-red. The only major problem for me is the blocking of the Internet during the start-up process.

Is there a way to skip the npm registry check without changing the url in the npm configuration?

How exactly are you starting Node-RED?

Also please include the output of the startup log (so we can see the version information)

And just to help try and reproduce this, how exactly is the firewall closing the connection, is it just dropping packets or replying with a reject?

Node-RED has the version 1.2.9. An update to 2.1.4 is being planned.

I start Node-RED via a batch file that is registered as a Windows service. The batch file contains the following:

node-red --settings C:\node-red\settings.js -u C:\node-red\instance

The output looks like this:

C:\node-red>D:\node-red\node-red --settings C:\node-red\settings.js -u C:\node-red\instance 
3 Jan 09:05:56 - [info] 

Welcome to Node-RED
===================

3 Jan 09:05:56 - [info] Node-RED version: v1.2.9
3 Jan 09:05:56 - [info] Node.js  version: v14.17.2
3 Jan 09:05:56 - [info] Windows_NT 10.0.14393 x64 LE

The firewall terminates the connection without any response

When I try to call the named URL on the server using PowerShell, the following is displayed:

PS C:\> Invoke-WebRequest https://registry.npmjs.org
Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel.
At line:1 char:1
+ Invoke-WebRequest https://registry.npmjs.org
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

If you wait 3 minutes it will proceed.

Alternatively....

On December 29th, 2021 there was an unplanned restart. Node-RED had not continued the startup process until this morning.

I've seen that where the console (CMD) is paused & required a keyboard input. Not saying that is definitely what happened to you but that these things do happen.

In other words, the issue you see today looks more like the 3m delay issue & the issue you had in Dec may be a different issue?

Where your console output shows node-red loading & waiting on line
3 Jan 09:05:56 - [info] Windows_NT 10.0.14393 x64 LE is where updateNotifier.checkNpm() occurs.

So my point still stands, try it, it should solve your issue for this 3rd Jan start up issue

I was 90% sure we had fixed this, but looks like we might want to add an option to disable the update check when just asking npm for it's version.

3 Likes

@NetHans Can you please test with the NO_UPDATE_NOTIFIER=1 environment variable set as I'm struggling to reproduce here at the at moment.

Running SET NO_UPDATE_NOTIFIER=1 before node-red --settings C:\node-red\settings.js -u C:\node-red\instance should be what you need.

Also can you supply the output from npm -v so we know what version of npm you have installed.

Thanks,

Hello hardillb,

Thank you for the hint with the environment variable. Setting this worked fine.

The NPM version 6.14.13 is currently still installed on the system.

C:\>npm -v
6.14.13

Like I said it would :thinking: :joy::joy:

Did you read the info in the link I posted in post no 5 above?