Hi, all. I'm using Node-Red (v2.2.2npm) in a Docker Container on a Synology NAS and it's set up for the purpose of automations with Home Assistant. I'm trying to enable https and can't get it working; was hoping this was the right place to get some help.
- I have found the proper settings.js file and I understand how to edit it (I successfully enabled the password protection).
- I am not clear, however, how to point the settings at the proper certificates.
- I attempted to follow the guide here: Securing Node-Red with SSL and Username Authentication and it seems to work in that the files get created (node-cert.pem, node-csr.pem, and node-key.pem)
- I then edited the settings.js to uncomment the required lines (I tried both options 1 and 2 on separate attempts... did not ever uncomment both 1 and 2 simultaneously)
However, when I restart the container, it crashes and restarts in a loop. If I re-comment the lines, it all works fine on http. I'm guessing I'm doing something wrong with the certs, either putting them in the wrong place or missing a step or something, but I can't figure it out. Anyone able to point me in the right direction?
As a new user, I can't upload the log files, but here's a paste of what I think might include the relevant crashes:
nodered-node-red
date,stream,content
2022-04-24 13:47:59,stdout,e[0m
2022-04-24 13:47:59,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m /data/.npm/_logs/2022-04-24T13_47_59_683Z-debug.log
2022-04-24 13:47:59,stdout,e[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m A complete log of this run can be found in:
2022-04-24 13:47:59,stdout,e[0m
2022-04-24 13:47:59,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m This is probably not a problem with npm. There is likely additional logging output above.
2022-04-24 13:47:59,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m Failed at the node-red-docker@2.2.2 start script.
2022-04-24 13:47:59,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m
2022-04-24 13:47:59,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m Exit status 1
2022-04-24 13:47:59,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m node-red-docker@2.2.2 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
2022-04-24 13:47:59,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0m e[0me[35merrnoe[0m 1
2022-04-24 13:47:59,stdout,e[37;40mnpme[0m e[0me[31;40mERR!e[0m e[0me[35mcodee[0m ELIFECYCLE
2022-04-24 13:47:59,stdout,}
2022-04-24 13:47:59,stdout, path: e[32m'privkey.pem'e[39m
2022-04-24 13:47:59,stdout," code: e[32m'ENOENT'e[39m,
"
2022-04-24 13:47:59,stdout," syscall: e[32m'open'e[39m,
"
2022-04-24 13:47:59,stdout," errno: e[33m-2e[39m,
"
2022-04-24 13:47:59,stdout,e[90m at internal/main/run_main_module.js:17:47e[39m {
2022-04-24 13:47:59,stdout,e[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)e[39m
2022-04-24 13:47:59,stdout,e[90m at Function.Module._load (internal/modules/cjs/loader.js:790:12)e[39m
2022-04-24 13:47:59,stdout,e[90m at Module.load (internal/modules/cjs/loader.js:950:32)e[39m
2022-04-24 13:47:59,stdout,e[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)e[39m
2022-04-24 13:47:59,stdout,e[90m at Module._compile (internal/modules/cjs/loader.js:1085:14)e[39m
2022-04-24 13:47:59,stdout, at Object.<anonymous> (/usr/src/node-red/node_modules/e[4mnode-rede[24m/red.js:218:20)
2022-04-24 13:47:59,stdout, at https (/data/settings.js:103:33)
2022-04-24 13:47:59,stdout,e[90m at Object.readFileSync (fs.js:393:35)e[39m
2022-04-24 13:47:59,stdout,e[90m at Object.openSync (fs.js:497:3)e[39m
2022-04-24 13:47:59,stdout,"Error: ENOENT: no such file or directory, open 'privkey.pem'
"
2022-04-24 13:47:59,stdout,
2022-04-24 13:47:59,stdout, ^
2022-04-24 13:47:59,stdout, throw err;
2022-04-24 13:47:59,stdout,internal/fs/utils.js:332
2022-04-24 13:47:58,stdout,
2022-04-24 13:47:58,stdout,> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
2022-04-24 13:47:58,stdout,> node-red-docker@2.2.2 start /usr/src/node-red
2022-04-24 13:47:58,stdout,
2022-04-24 13:47:53,stdout,e[0m
2022-04-24 13:47:53,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m /data/.npm/_logs/2022-04-24T13_47_53_684Z-debug.log
2022-04-24 13:47:53,stdout,e[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m A complete log of this run can be found in:
2022-04-24 13:47:53,stdout,e[0m
2022-04-24 13:47:53,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m This is probably not a problem with npm. There is likely additional logging output above.
2022-04-24 13:47:53,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m Failed at the node-red-docker@2.2.2 start script.
2022-04-24 13:47:53,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m
2022-04-24 13:47:53,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m Exit status 1
2022-04-24 13:47:53,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m node-red-docker@2.2.2 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
2022-04-24 13:47:53,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0m e[0me[35merrnoe[0m 1
2022-04-24 13:47:53,stdout,e[37;40mnpme[0m e[0me[31;40mERR!e[0m e[0me[35mcodee[0m ELIFECYCLE
2022-04-24 13:47:53,stdout,}
2022-04-24 13:47:53,stdout, path: e[32m'privkey.pem'e[39m
2022-04-24 13:47:53,stdout," code: e[32m'ENOENT'e[39m,
"
2022-04-24 13:47:53,stdout," syscall: e[32m'open'e[39m,
"
2022-04-24 13:47:53,stdout," errno: e[33m-2e[39m,
"
2022-04-24 13:47:53,stdout,e[90m at internal/main/run_main_module.js:17:47e[39m {
2022-04-24 13:47:53,stdout,e[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)e[39m
2022-04-24 13:47:53,stdout,e[90m at Function.Module._load (internal/modules/cjs/loader.js:790:12)e[39m
2022-04-24 13:47:53,stdout,e[90m at Module.load (internal/modules/cjs/loader.js:950:32)e[39m
2022-04-24 13:47:53,stdout,e[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)e[39m
2022-04-24 13:47:53,stdout,e[90m at Module._compile (internal/modules/cjs/loader.js:1085:14)e[39m
2022-04-24 13:47:53,stdout, at Object.<anonymous> (/usr/src/node-red/node_modules/e[4mnode-rede[24m/red.js:218:20)
2022-04-24 13:47:53,stdout, at https (/data/settings.js:103:33)
2022-04-24 13:47:53,stdout,e[90m at Object.readFileSync (fs.js:393:35)e[39m
2022-04-24 13:47:53,stdout,e[90m at Object.openSync (fs.js:497:3)e[39m
2022-04-24 13:47:53,stdout,"Error: ENOENT: no such file or directory, open 'privkey.pem'
"
2022-04-24 13:47:53,stdout,
2022-04-24 13:47:53,stdout, ^
2022-04-24 13:47:53,stdout, throw err;
2022-04-24 13:47:53,stdout,internal/fs/utils.js:332
2022-04-24 13:47:52,stdout,
2022-04-24 13:47:52,stdout,> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
2022-04-24 13:47:52,stdout,> node-red-docker@2.2.2 start /usr/src/node-red
2022-04-24 13:47:52,stdout,
2022-04-24 13:47:48,stdout,e[0m
2022-04-24 13:47:48,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m /data/.npm/_logs/2022-04-24T13_47_48_016Z-debug.log
2022-04-24 13:47:48,stdout,e[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m A complete log of this run can be found in:
2022-04-24 13:47:48,stdout,e[0m
2022-04-24 13:47:48,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m This is probably not a problem with npm. There is likely additional logging output above.
2022-04-24 13:47:48,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m Failed at the node-red-docker@2.2.2 start script.
2022-04-24 13:47:48,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m
2022-04-24 13:47:48,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m Exit status 1
2022-04-24 13:47:48,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m node-red-docker@2.2.2 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
2022-04-24 13:47:48,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0m e[0me[35merrnoe[0m 1
2022-04-24 13:47:48,stdout,e[37;40mnpme[0m e[0me[31;40mERR!e[0m e[0me[35mcodee[0m ELIFECYCLE
2022-04-24 13:47:48,stdout,}
2022-04-24 13:47:48,stdout, path: e[32m'privkey.pem'e[39m
2022-04-24 13:47:48,stdout," code: e[32m'ENOENT'e[39m,
"
2022-04-24 13:47:48,stdout," syscall: e[32m'open'e[39m,
"
2022-04-24 13:47:48,stdout," errno: e[33m-2e[39m,
"
2022-04-24 13:47:48,stdout,e[90m at internal/main/run_main_module.js:17:47e[39m {
2022-04-24 13:47:48,stdout,e[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)e[39m
2022-04-24 13:47:48,stdout,e[90m at Function.Module._load (internal/modules/cjs/loader.js:790:12)e[39m
2022-04-24 13:47:48,stdout,e[90m at Module.load (internal/modules/cjs/loader.js:950:32)e[39m
2022-04-24 13:47:48,stdout,e[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)e[39m
2022-04-24 13:47:48,stdout,e[90m at Module._compile (internal/modules/cjs/loader.js:1085:14)e[39m
2022-04-24 13:47:48,stdout, at Object.<anonymous> (/usr/src/node-red/node_modules/e[4mnode-rede[24m/red.js:218:20)
2022-04-24 13:47:48,stdout, at https (/data/settings.js:103:33)
2022-04-24 13:47:48,stdout,e[90m at Object.readFileSync (fs.js:393:35)e[39m
2022-04-24 13:47:48,stdout,e[90m at Object.openSync (fs.js:497:3)e[39m
2022-04-24 13:47:48,stdout,"Error: ENOENT: no such file or directory, open 'privkey.pem'
"
2022-04-24 13:47:48,stdout,
2022-04-24 13:47:48,stdout, ^
2022-04-24 13:47:48,stdout, throw err;
2022-04-24 13:47:47,stdout,internal/fs/utils.js:332
2022-04-24 13:47:47,stdout,
2022-04-24 13:47:47,stdout,> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
2022-04-24 13:47:47,stdout,> node-red-docker@2.2.2 start /usr/src/node-red
2022-04-24 13:47:47,stdout,
2022-04-24 13:47:41,stdout,e[0m
2022-04-24 13:47:41,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m /data/.npm/_logs/2022-04-24T13_47_40_974Z-debug.log
2022-04-24 13:47:41,stdout,e[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m A complete log of this run can be found in:
2022-04-24 13:47:41,stdout,e[0m
2022-04-24 13:47:40,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m This is probably not a problem with npm. There is likely additional logging output above.
2022-04-24 13:47:40,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m Failed at the node-red-docker@2.2.2 start script.
2022-04-24 13:47:40,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m
2022-04-24 13:47:40,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m Exit status 1
2022-04-24 13:47:40,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0me[35me[0m node-red-docker@2.2.2 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
2022-04-24 13:47:40,stdout,e[0me[37;40mnpme[0m e[0me[31;40mERR!e[0m e[0me[35merrnoe[0m 1
2022-04-24 13:47:40,stdout,e[37;40mnpme[0m e[0me[31;40mERR!e[0m e[0me[35mcodee[0m ELIFECYCLE
2022-04-24 13:47:40,stdout,}
2022-04-24 13:47:40,stdout, path: e[32m'privkey.pem'e[39m
2022-04-24 13:47:40,stdout," code: e[32m'ENOENT'e[39m,
"
2022-04-24 13:47:40,stdout," syscall: e[32m'open'e[39m,
"
2022-04-24 13:47:40,stdout," errno: e[33m-2e[39m,
"
2022-04-24 13:47:40,stdout,e[90m at internal/main/run_main_module.js:17:47e[39m {
2022-04-24 13:47:40,stdout,e[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)e[39m
2022-04-24 13:47:40,stdout,e[90m at Function.Module._load (internal/modules/cjs/loader.js:790:12)e[39m
2022-04-24 13:47:40,stdout,e[90m at Module.load (internal/modules/cjs/loader.js:950:32)e[39m
2022-04-24 13:47:40,stdout,e[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)e[39m
2022-04-24 13:47:40,stdout,e[90m at Module._compile (internal/modules/cjs/loader.js:1085:14)e[39m
2022-04-24 13:47:40,stdout, at Object.<anonymous> (/usr/src/node-red/node_modules/e[4mnode-rede[24m/red.js:218:20)
2022-04-24 13:47:40,stdout, at https (/data/settings.js:103:33)
2022-04-24 13:47:40,stdout,e[90m at Object.readFileSync (fs.js:393:35)e[39m
2022-04-24 13:47:40,stdout,e[90m at Object.openSync (fs.js:497:3)e[39m
2022-04-24 13:47:40,stdout,"Error: ENOENT: no such file or directory, open 'privkey.pem'
"
2022-04-24 13:47:40,stdout,
2022-04-24 13:47:40,stdout, ^
2022-04-24 13:47:40,stdout, throw err;
2022-04-24 13:47:40,stdout,internal/fs/utils.js:332
2022-04-24 13:47:39,stdout,
2022-04-24 13:47:39,stdout,> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
2022-04-24 13:47:39,stdout,> node-red-docker@2.2.2 start /usr/src/node-red
2022-04-24 13:47:39,stdout,
2022-04-24 13:47:34,stdout,24 Apr 09:47:34 - [info] Stopped flows
2022-04-24 13:47:34,stdout,24 Apr 09:47:34 - [info] [server:Home Assistant] Closing connection to http://192.168.1.211:8123
2022-04-24 13:47:34,stdout,24 Apr 09:47:34 - [info] Stopping flows