That warning had been logged by some piece of node.js code. It has been written directly to stdout of the node process, bypassing the Node-RED logging framework. That is why it looks "different" to normal NR log output.
The fact it mentions postgres should be the biggest clue for where it is coming from. What postgres node have you got installed? The message won't be coming from the NR node, but from the underlying postgres library module it is using.
Thanks for your reply @TotallyInformation , unfortunately there is no timestamp for the error log
/home/nodered/.pm2/logs/node-red-error.log last 15 lines:
0|node-red | (node:25266) DeprecationWarning: PG.connect is deprecated - please see the upgrade guide at https://node-postgres.com/guides/upgrading
0|node-red | (node:21253) DeprecationWarning: PG.connect is deprecated - please see the upgrade guide at https://node-postgres.com/guides/upgrading
0|node-red | (node:9248) DeprecationWarning: PG.connect is deprecated - please see the upgrade guide at https://node-postgres.com/guides/upgrading
I only see it for the out log:
/home/nodered/.pm2/logs/node-red-out.log last 15 lines:
0|node-red | 18 Feb 10:22:55 - [metric] {"level":99,"nodeid":"6c78f7cb.7c424","event":"node.json.send","msgid":"791ef036.27395","timestamp":1582017775148}
Thank you for your reply. Do you mean that node-red error.log reports errors and warnings from node.js? And this happens via pm2 in my case, bypassing node-red?
The warning I reported was just an example, the really important error is the following:
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
Error: Connection refused: Not authorized
at MqttClient._handleConnack (/home/nodered/.node-red/node_modules/mqtt/lib/client.js:920:15)
at MqttClient._handlePacket (/home/nodered/.node-red/node_modules/mqtt/lib/client.js:350:12)
at work (/home/nodered/.node-red/node_modules/mqtt/lib/client.js:292:12)
at Writable.writable._write (/home/nodered/.node-red/node_modules/mqtt/lib/client.js:302:5)
at doWrite (/home/nodered/.node-red/node_modules/readable-stream/lib/_stream_writable.js:428:64)
at writeOrBuffer (/home/nodered/.node-red/node_modules/readable-stream/lib/_stream_writable.js:417:5)
at Writable.write (/home/nodered/.node-red/node_modules/readable-stream/lib/_stream_writable.js:334:11)
at Socket.ondata (_stream_readable.js:705:22)
at Socket.emit (events.js:193:13)
at Socket.EventEmitter.emit (domain.js:481:20)
(node:24363) UnhandledPromiseRejectionWarning: Error: Connection refused: Not authorized
at MqttClient._handleConnack (/home/nodered/.node-red/node_modules/mqtt/lib/client.js:920:15)
at MqttClient._handlePacket (/home/nodered/.node-red/node_modules/mqtt/lib/client.js:350:12)
at work (/home/nodered/.node-red/node_modules/mqtt/lib/client.js:292:12)
at Writable.writable._write (/home/nodered/.node-red/node_modules/mqtt/lib/client.js:302:5)
at doWrite (/home/nodered/.node-red/node_modules/readable-stream/lib/_stream_writable.js:428:64)
at writeOrBuffer (/home/nodered/.node-red/node_modules/readable-stream/lib/_stream_writable.js:417:5)
at Writable.write (/home/nodered/.node-red/node_modules/readable-stream/lib/_stream_writable.js:334:11)
at Socket.ondata (_stream_readable.js:705:22)
at Socket.emit (events.js:193:13)
at Socket.EventEmitter.emit (domain.js:481:20)