HASS.IO addons: Node-Red configuration

Hi,
I have loaded the related node-red addon in hass.io. when I check the log I have these errors and node-ren does not start.

Add-on version: 3.1.4
You are running the latest version of this add-on.
System: HassOS 2.12 (armv7 / raspberrypi3)
Home Assistant version: 0.94.4
Supervisor version: 166

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] nginx.sh: executing…
[13:49:36] FATAL:
[13:49:36] FATAL: SSL has been enabled using the ‘ssl’ option,
[13:49:36] FATAL: this requires a SSL certificate file which is
[13:49:36] FATAL: configured using the ‘certfile’ option in the
[13:49:36] FATAL: add-on configuration.
[13:49:36] FATAL:
[13:49:36] FATAL: Unfortunately, the file specified in the
[13:49:36] FATAL: ‘certfile’ option does not exists.
[13:49:36] FATAL:
[13:49:36] FATAL: Please ensure the certificate file exists and
[13:49:36] FATAL: is placed in the Hass.io ‘/ssl/’ directory.
[13:49:36] FATAL:
[13:49:36] FATAL: In case you don’t have SSL yet, consider getting
[13:49:36] FATAL: a SSL certificate or setting the ‘ssl’ option
[13:49:37] FATAL: to ‘false’ in case you are not planning on using
[13:49:37] FATAL: SSL with this add-on.
[13:49:37] FATAL:
[13:49:37] FATAL: Check the add-on manual for more information.
[13:49:37] FATAL:
[cont-init.d] nginx.sh: exited 1.
[cont-finish.d] executing container finish scripts…
[cont-finish.d] 99-message.sh: executing…

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.

[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Not sure if you solved this yet since there were no replies. I just had the same error. What I had to do is go into my hassio/ssl installation folder, for me was /usr/share/hassio/ssl, and use openssl to create a key. It asked for info for the key to be created and it created 2 files. certificate.pem and privkey.pem

openssl req -sha256 -newkey rsa:4096 -nodes -keyout privkey.pem -x509 -days 730 -out certificate.pem

I then updated the node red config to match:

{
  "credential_secret": "SetToPassKeyYouWant",
  "dark_mode": false,
  "http_node": {
    "username": "",
    "password": ""
  },
  "http_static": {
    "username": "",
    "password": ""
  },
  "ssl": true,
  "certfile": "certificate.pem",
  "keyfile": "privkey.pem",
  "require_ssl": true,
  "system_packages": [],
  "npm_packages": [],
  "init_commands": []
}

After this, I restarted the addon and checked the log. No errors and it was working. Cheers.

2 Likes

Or just change the setting to false…

1 Like

Literally tells you in the error…

1 Like

Never said that was the only fix. Only that was what I did to fix mine and was sharing it here. Besides, I kinda like the extra encryption.

I tried red node because i want to integrate Jablotron alarm

Too bad i can not remove ssl option, how to do that?
set ssl to false does not work error bad gateway

1 Like

You can tell it NOT to use SSL. The configuration options are literally in front of you.

require_ssl": true,
"ssl": true,

Those need to be false…

2 Likes

Nope, i dit it earlier, when i set it to false you can not save it

I tried it on the pc Laptop from a Neighbour, now its working. I have a Mac.

Hi everyone, sry for opening back this topic. I’m a beginner with hass.io and i have the same issue, you told to gbroca that he could setup his ssl configuration (keys or simpley disable the ssl option), in thejson file, but i don’t find this file, i installed hass.io by following the readme on the github.
Can you tell me, where i can find this json file ?
Thanks

Hi,
I have the same issue as others here. I too am on MacOS in Chrome and I am able to save the Node-Red config file but a restart does not make the “500: bad gateway” error disappear.
What did you do differently on the neighbor’s PC?
Thank you

OMG RTFM! Sorry - complete dip$hit not reading the most basic instructions…
Step 2: create a credential secret
SMH in shame. Sorry guys.

1 Like

Its works on the following setting: -

credential_secret: RaspberryPiNodeRed
dark_mode: false
http_node:
  username: ''
  password: ''
http_static:
  username: ''
  password: ''
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
require_ssl: false
system_packages: []
npm_packages: []
init_commands: []
Note: ssl and required_ssl in false state

ty for the instructions, I always have to fiddle with openssl to get a cert that works. Worked flawlessly… I’d much rather leave encryption on :slight_smile:

This works for me :smiley:
certfile: fullchain.pem
credential_secret: secret
http_node:
password: “”
username: “”
http_static:
password: “”
username: “”
init_commands: []
keyfile: privkey.pem
npm_packages: []
ssl: false
system_packages: []
theme: default
leave_front_door_open: true
dark_mode: false
require_ssl: false

I created an account for the whole purpose of describing the steps on how to properly set the Node-RED using SSL on your Home Assistant, after wasting a couple of hours researching for the right documentation. Like other post was mentioning already, the steps make sense for an experienced user who knows where to look, however, for a person who has just started playing with Linux, Home Assistant, Docker etc it’s been quite challenging to figure it out.

Using Home Assistant Supervised on a stand-alone Debian 11 linux machine:

  1. In Home Assistant “Settings” click on “Addons”

  2. Search for the “Node-RED” addon

  3. Install the “Node-RED” addon. - Do not start it yet!

  4. SSH into your Linux machine

  5. Navigate to location (in my case was) /usr/share/hassio/homeassistant ( run cli command ls -lrt to display a list of files and folders in the homeassistant directory). There should be a folder named node-red . cd to the node-red directory

  6. Within the node-red directory, create the SSL cert and key: Run the below command:

    openssl req -sha256 -newkey rsa:4096 -nodes -keyout privkey.pem -x509 -days 730 -out certificate.pem

    Once the command has run, and followed the on-screen prompts, you should have the certificate.pem and privkey.pem in the Node-RED directory

  7. Return to Home Assistant WebUI, go to Configuration tab and fill in the blanks (certfile with certificate.pem, credential_secret, keyfile with privkey.pem

  8. Enable the ssl option

  9. Click Save

  10. Go to Info tab and click Start followed by Open Web UI

  11. Now you should have Node-RED working!

1 Like