Inject nodes not started with node 16

When using node 16 inject nodes do not start anymore:

27 Nov 19:35:08 - [info] 
Welcome to Node-RED
===================
27 Nov 19:35:08 - [info] Node-RED version: v2.1.3-git
27 Nov 19:35:08 - [info] Node.js  version: v16.13.0
27 Nov 19:35:08 - [info] Linux 5.4.109+ x64 LE
27 Nov 19:35:08 - [info] Loading palette nodes
27 Nov 19:35:09 - [info] Dashboard version 3.1.2 started at /ui
27 Nov 19:35:09 - [info] Settings file  : /builds/platynum/certification-authority/flows/settings.js
27 Nov 19:35:09 - [info] Context store  : 'default' [module=memory]
27 Nov 19:35:09 - [info] User directory : /root/.node-red
27 Nov 19:35:09 - [warn] Projects disabled : editorTheme.projects.enabled=false
27 Nov 19:35:09 - [info] Flows file     : /builds/platynum/certification-authority/flows/flows.json
27 Nov 19:35:09 - [info] Server now running at http://127.0.0.1:1880/admin/
27 Nov 19:35:09 - [warn] 
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
27 Nov 19:35:09 - [info] Starting flows

Compared with node 14, you can see the start messages:

27 Nov 19:35:57 - [info] 
Welcome to Node-RED
===================
27 Nov 19:35:57 - [info] Node-RED version: v2.1.3-git
27 Nov 19:35:57 - [info] Node.js  version: v14.18.1
27 Nov 19:35:57 - [info] Linux 5.4.109+ x64 LE
27 Nov 19:35:58 - [info] Loading palette nodes
27 Nov 19:35:58 - [info] Dashboard version 3.1.2 started at /ui
27 Nov 19:35:58 - [info] Settings file  : /builds/platynum/certification-authority/flows/settings.js
27 Nov 19:35:58 - [info] Context store  : 'default' [module=memory]
27 Nov 19:35:58 - [info] User directory : /root/.node-red
27 Nov 19:35:58 - [warn] Projects disabled : editorTheme.projects.enabled=false
27 Nov 19:35:58 - [info] Flows file     : /builds/platynum/certification-authority/flows/flows.json
27 Nov 19:35:58 - [info] Server now running at http://127.0.0.1:1880/admin/
27 Nov 19:35:58 - [warn] 
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
27 Nov 19:35:58 - [info] Starting flows
27 Nov 19:35:58 - [info] [inject:Sub CRL renewal] repeat = 3600000
27 Nov 19:35:58 - [info] [inject:Root CRL renewal] repeat = 86400000
27 Nov 19:35:58 - [info] [inject:Admin CRL renewal] repeat = 3600000
27 Nov 19:35:58 - [info] [inject:OCSP certificate renewal] repeat = 86400000
27 Nov 19:35:58 - [info] [inject:https certificate renewal] repeat = 86400000
27 Nov 19:35:58 - [info] [inject:TSA certificate renewal] repeat = 432000000
27 Nov 19:35:58 - [info] [inject:Purge nonces] repeat = 3600000
27 Nov 19:35:58 - [info] [inject:Regular mailcheck] repeat = 60000
27 Nov 19:35:58 - [info] [inject:Renew S/MIME certificate] repeat = 86400000
27 Nov 19:35:58 - [info] Started flows

I think that is a symptom rather than a cause.

You can see the last line of the node 16 log is Starting flows - it isn't reaching the Started flows line. So something has got stuck, but it isn't necessarily the Inject nodes at fault.

If you edit your settings file and change your logging level to trace you'll get much more information about starting individual nodes. Use that to see if you can see where it's getting stuck.

I've missed to copy the Started flows line, after an upgrade to Node-RED 2.1.4 the problem persists:

Node 14:

2 Dec 16:57:31 - [info] 
Welcome to Node-RED
===================
2 Dec 16:57:31 - [info] Node-RED version: v2.1.4-git
2 Dec 16:57:31 - [info] Node.js  version: v14.18.2
2 Dec 16:57:31 - [info] Linux 5.4.109+ x64 LE
2 Dec 16:57:31 - [info] Loading palette nodes
2 Dec 16:57:32 - [info] Dashboard version 3.1.2 started at /ui
2 Dec 16:57:32 - [info] Settings file  : /builds/platynum/certification-authority/flows/settings.js
2 Dec 16:57:32 - [info] Context store  : 'default' [module=memory]
2 Dec 16:57:32 - [info] User directory : /root/.node-red
2 Dec 16:57:32 - [warn] Projects disabled : editorTheme.projects.enabled=false
2 Dec 16:57:32 - [info] Flows file     : /builds/platynum/certification-authority/flows/flows.json
2 Dec 16:57:32 - [info] Server now running at http://127.0.0.1:1880/admin/
2 Dec 16:57:32 - [warn] 
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
2 Dec 16:57:32 - [info] Starting flows
2 Dec 16:57:32 - [info] [inject:Sub CRL renewal] repeat = 3600000
2 Dec 16:57:32 - [info] [inject:Root CRL renewal] repeat = 86400000
2 Dec 16:57:32 - [info] [inject:Admin CRL renewal] repeat = 3600000
2 Dec 16:57:32 - [info] [inject:OCSP certificate renewal] repeat = 86400000
2 Dec 16:57:32 - [info] [inject:https certificate renewal] repeat = 86400000
2 Dec 16:57:32 - [info] [inject:TSA certificate renewal] repeat = 432000000
2 Dec 16:57:32 - [info] [inject:Purge nonces] repeat = 3600000
2 Dec 16:57:32 - [info] [inject:Regular mailcheck] repeat = 60000
2 Dec 16:57:32 - [info] [inject:Renew S/MIME certificate] repeat = 86400000
2 Dec 16:57:32 - [info] Started flows

Node 16:

2 Dec 16:56:45 - [info] 
Welcome to Node-RED
===================
2 Dec 16:56:45 - [info] Node-RED version: v2.1.4-git
2 Dec 16:56:45 - [info] Node.js  version: v16.13.1
2 Dec 16:56:45 - [info] Linux 5.4.109+ x64 LE
2 Dec 16:56:45 - [info] Loading palette nodes
2 Dec 16:56:46 - [info] Dashboard version 3.1.2 started at /ui
2 Dec 16:56:46 - [info] Settings file  : /builds/platynum/certification-authority/flows/settings.js
2 Dec 16:56:46 - [info] Context store  : 'default' [module=memory]
2 Dec 16:56:46 - [info] User directory : /root/.node-red
2 Dec 16:56:46 - [warn] Projects disabled : editorTheme.projects.enabled=false
2 Dec 16:56:46 - [info] Flows file     : /builds/platynum/certification-authority/flows/flows.json
2 Dec 16:56:46 - [info] Server now running at http://127.0.0.1:1880/admin/
2 Dec 16:56:46 - [warn] 
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
2 Dec 16:56:46 - [info] Starting flows
2 Dec 16:56:46 - [info] Started flows

Enabling trace logging did not show any error messages.

I didn't say you would get error messages, but you would be able to confirm all of the nodes were actually being started. For each node you should get a 'starting' message and a 'started' message. The next thing I would do is check that log to make sure the Inject nodes are being started.

How did you install node-red?

@knolleary The trace output does not differ between node 14 and 16, except the missing inject messages.

@colin: Good catch, it has the same issue, when using node-red 2.1.4 installed via npm(1):

4 Dec 16:01:35 - [info]

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

4 Dec 16:01:35 - [info] Node-RED version: v2.1.4
4 Dec 16:01:35 - [info] Node.js  version: v16.13.1
4 Dec 16:01:35 - [info] Linux 5.10.79 x64 LE
4 Dec 16:01:36 - [info] Loading palette nodes
4 Dec 16:01:37 - [info] Dashboard version 3.1.2 started at /ui
4 Dec 16:01:37 - [info] Settings file  : /data/settings.js
4 Dec 16:01:37 - [info] Context store  : 'default' [module=memory]
4 Dec 16:01:37 - [info] User directory : /data
4 Dec 16:01:37 - [warn] Projects disabled :
editorTheme.projects.enabled=false
4 Dec 16:01:37 - [info] Flows file     : /data/flows.json
4 Dec 16:01:37 - [info] Server now running at http://127.0.0.1:1880/admin/
4 Dec 16:01:37 - [warn]

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

4 Dec 16:01:37 - [info] Starting flows
4 Dec 16:01:37 - [info] Started flows

Those log messages are only displayed if Node-RED is started in verbose mode with the -v command-line flag.

Is it possible you are missing that flag when you run with Node 16?

I've just tested locally and have no issues with the Inject nodes in repeat mode for Node 16.

Yes, this explains this. Only node-red running on nodejs 14 was started with --verbose. What are the differences between using the verbose command line flag and the various console log levels?

For a small number of core nodes (typically the older ones), it just turns on some additional logging statements. The flag predates a lot of the logging infrastructure in Node-RED and, to be honest, we've not really gone back to revisited its role in the big scheme of things.

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