Can not open Node Red UI

Hi,
I can’t open Node Red UI or a blank page will be open when I try to open the web UI.
All the other addons works fine.
I have the latest HA Supervisor and Node red addon installed.
My Node Red config looks llike this.

credential_secret: "secret"
theme: default
http_node:
  username: Fredda
  password: "secret"
http_static:
  username: Fredda
  password: "secret"
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem
system_packages: []
npm_packages: []
init_commands: []

Dose anybody know what the problem could be?

You seem to be using both ssl and http_node:

Note: In order to use the http_node you will need to expose Node-RED using a network port in addition to ingress. The HTTP nodes will also be presented under /endpoint/ as shown in the UI. If using the node-red-dashboard module this will also be hosted under this path and will use any credentials set here.

Maybe try it without these first, and also check if it maybe an issue with ssl by setting ssl: false

Anything in your logs? ha or nodered? Try your HA address with port 1880 instead of 8123

@AlmostSerious I tried to set ssl: false
But it dosen’t make any different :slightly_frowning_face:

@Mikefila this is how the logger looks like.
I can’t see anything wrong

(29/55) Installing lame (3.100-r0)
(30/55) Installing opus (1.3.1-r1)
(31/55) Installing libgomp (10.3.1_git20210424-r2)
(32/55) Installing soxr (0.1.3-r2)
(33/55) Installing libsrt (1.4.2-r0)
(34/55) Installing libssh (0.9.6-r0)
(35/55) Installing libogg (1.3.5-r0)
(36/55) Installing libtheora (1.1.1-r16)
(37/55) Installing libjpeg-turbo (2.1.0-r0)
(38/55) Installing v4l-utils-libs (1.20.0-r0)
(39/55) Installing libxext (1.3.4-r0)
(40/55) Installing libxfixes (6.0.0-r0)
(41/55) Installing libpciaccess (0.16-r0)
(42/55) Installing libdrm (2.4.106-r0)
(43/55) Installing wayland-libs-client (1.19.0-r0)
(44/55) Installing libva (2.11.0-r0)
(45/55) Installing libvdpau (1.4-r0)
(46/55) Installing vidstab (1.1.0-r1)
(47/55) Installing libvorbis (1.3.7-r0)
(48/55) Installing libvpx (1.10.0-r0)
(49/55) Installing vulkan-loader (1.2.170-r1)
(50/55) Installing libwebp (1.2.0-r2)
(51/55) Installing x264-libs (20210211-r0)
(52/55) Installing x265-libs (3.4-r0)
(53/55) Installing xvidcore (1.3.7-r1)
(54/55) Installing ffmpeg-libs (4.4.1-r0)
(55/55) Installing ffmpeg (4.4.1-r0)
Executing busybox-1.33.1-r3.trigger
OK: 192 MiB in 103 packages
[07:30:44] INFO: Starting installation of custom NPM/Node-RED packages...
added 1 package, changed 1 package, and audited 657 packages in 3s
64 packages are looking for funding
  run `npm fund` for details
10 vulnerabilities (2 moderate, 7 high, 1 critical)
To address issues that do not require attention, run:
  npm audit fix
To address all issues possible (including breaking changes), run:
  npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
[cont-init.d] customizations.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing... 
patching file nodes/ui_base.html
Hunk #1 succeeded at 1162 (offset 631 lines).
up to date, audited 162 packages in 3s
20 vulnerabilities (10 moderate, 7 high, 3 critical)
To address issues that do not require attention, run:
  npm audit fix
To address all issues (including breaking changes), run:
  npm audit fix --force
Run `npm audit` for details.
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[07:30:51] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
6 Nov 07:30:53 - [info] 
Welcome to Node-RED
===================
6 Nov 07:30:53 - [info] Node-RED version: v2.0.6
6 Nov 07:30:53 - [info] Node.js  version: v14.17.6
6 Nov 07:30:53 - [info] Linux 5.10.0-9-amd64 x64 LE
6 Nov 07:30:53 - [info] Loading palette nodes
6 Nov 07:30:55 - [info] Dashboard version 3.0.4 started at /endpoint/ui
/bin/sh: /opt/node_modules/node-red-node-pi-gpio/testgpio.py: not found
6 Nov 07:30:56 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
6 Nov 07:30:56 - [info] Settings file  : /etc/node-red/config.js
6 Nov 07:30:56 - [info] Context store  : 'memoryOnly' [module=memory]
6 Nov 07:30:56 - [info] Context store  : 'file' [module=localfilesystem]
6 Nov 07:30:56 - [info] User directory : /config/node-red/
6 Nov 07:30:56 - [warn] Projects disabled : editorTheme.projects.enabled=false
6 Nov 07:30:56 - [info] Flows file     : /config/node-red/flows.json
6 Nov 07:30:56 - [info] Server now running at http://127.0.0.1:46836/
6 Nov 07:30:56 - [info] Starting flows
6 Nov 07:30:56 - [info] Started flows
[07:30:56] INFO: Starting NGinx...
(node:503) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
6 Nov 07:31:01 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant

Did you also try http_node & http_static blank?
Otherwise just deinstall and reinstall. I had that happen sometimes with other addons that suddenly work correctly after reinstallation.

There is quite a few nodes that need updates. Try to see if it starts in safe mode. Add --safe to the init commands on the addon configuration page.

If it does, start page by page, double click on a page tab, the bottom left of the dialog box will have a disable button.

@Mikefila what do you mean a few nodes need to be updated?

I just restarted my instance of nodered and I also have

20 vulnerabilities (10 moderate, 7 high, 3 critical)
To address issues that do not require attention, run:
  npm audit fix
To address all issues (including breaking changes), run:
  npm audit fix --force

It’s been a while since I looked at my logs and assumed that was from additional nodes, it seems it’s “normal”.

Is this your first install or has it run before?

Why’s the server running on port 46836? Shouldn’t it run on 1880?

If you go to the IP address with port 46836 can you get to the editor that way?

Update- After checking the release notes it appears the addon version of Node Red is supposed to run on port 46836 and then use ingress to access Home Assistant, so not sure what could be going wrong here. There was some posts about people having issues accessing the editor on the Node Red Add On thread starting here after that change was made -

No, this is not the first install of the Node Red addon.
I have been reinstall my host computer and restored a backup/snapshot where I hade Node Red installed.
Node Red have been working before.
I tried to uninstall and reinstall the Node Red addon. But no different.
I also tried different configuration of http_node & http_static. But no different.

@mwav3 that is strange?
I run my HA supervised on a computer with ip-address 10.0.1.3 and logg in to HA with 10.0.1.3:8123.
I can try http://127.0.0.1:46836.
But of course would I like to change to port 1880 and the ip-address

Have you tried another browser or computer? If the problem is still the same you could try a full remove and reinstall

Export all of your flows to a file. Then remove nodered. Then inside you config folder rename the nodered folder. This contains all the configuration information for node red and it persists over un installs

127.0.0.1 is the “loopback” address, and just points back to the machine you’re currently on. It might work if you were on the actual machine home assistant is installed on, but wouldn’t from a different one. With ingress, Node Red shold show up as an option on the side menu and you should be able to pull the editor up from anywhere you see your home assistant page

If you have 1880 listed in the addon configuration settings in the supervisor tab, it should put the editor on port 1880 as well. The log would still say 46836 but home assistant would put up the page on 1880 in the background. So if ip is 10.0.1.3 it should pull up the editor at 10.0.1.3:1880

That should all happen seamlessly to the user without them having to do anything else besides set the config properly in the addon settings on the supervisor tab. If something went wrong, best to follow the advice from mikefila above to export flows, rename folder, and reinstall.

@Mikefila
How do I export flows to file if I don’t have access to the NodeRed UI?
Remove NodeRed do you mean uninstall the addon ?

If you can’t get access to the editor the flows are stored in a flows.json file and can be restored from there. That file is in the config/node-red directory.

What I would do first is uninstall the add-on. Then rename the old node red directory to something like node-redold. Reinstall the addon- at that point you should have a clean slate.

Then in the editor, go to import. You can use the file editor to navigate to node-redold and open the flows.json file. Copy the entire contents of the flows.json file and then paste it into the clipboard part of the import menu in your empty new node red instance.

You’ll probably have to reinstall any palettes and setup your credentials again for any flows.

I’m assuming based on your logs and issue there must have been some corruption in the old config, or it wasn’t compatible with your new install. Maybe you went from an rpi to another system with a different architecture and its creating a conflict. The more you try and copy over from the old config, the more likely you’ll carry the problem over. Hopefully importing the flows doesn’t just keep crashing the editor.

Okay @mwav3 I have tried to reinstall the NodeRed addon and renamed the NodeRed folder and reinstall the addon again.
But with the same result :slightly_frowning_face:
Only a blank page when I try to open the NodeRed UI with a Bad Gateway error!

This is how my NodeRed logger looks like after the addon has been reinstalled.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 10.1.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (amd64 / qemux86-64)
 Home Assistant Core: 2021.11.3
 Home Assistant Supervisor: 2021.10.8
-----------------------------------------------------------
 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] customizations.sh: executing... 
[cont-init.d] customizations.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing... 
patching file nodes/ui_base.html
Hunk #1 succeeded at 1162 (offset 631 lines).
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[20:26:44] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
15 Nov 20:26:46 - [info] 
Welcome to Node-RED
===================
15 Nov 20:26:46 - [info] Node-RED version: v2.1.3
15 Nov 20:26:46 - [info] Node.js  version: v14.18.1
15 Nov 20:26:46 - [info] Linux 5.10.0-9-amd64 x64 LE
15 Nov 20:26:46 - [info] Loading palette nodes
15 Nov 20:26:48 - [info] Dashboard version 3.1.1 started at /endpoint/ui
/bin/sh: /opt/node_modules/node-red-node-pi-gpio/testgpio.py: not found
15 Nov 20:26:49 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
15 Nov 20:26:49 - [info] Settings file  : /etc/node-red/config.js
15 Nov 20:26:49 - [info] Context store  : 'default' [module=memory]
15 Nov 20:26:49 - [info] User directory : /config/node-red/
15 Nov 20:26:49 - [warn] Projects disabled : editorTheme.projects.enabled=false
15 Nov 20:26:49 - [info] Flows file     : /config/node-red/flows.json
15 Nov 20:26:49 - [info] Server now running at http://127.0.0.1:46836/
15 Nov 20:26:49 - [info] Starting flows
15 Nov 20:26:49 - [info] Started flows
[20:26:49] INFO: Starting NGinx...
15 Nov 20:26:54 - [info] [server:Home Assistant] Connecting to undefined
15 Nov 20:26:54 - [info] [server:Home Assistant] Connected to undefined

Try disabling ssl in your config, see this post

Also try clearing your browser cache

@mwav3 this is how my configuration looks like.
The “ssl: false” don’t seem to have any impacted!
Do the order of the lines matter?
image

Tried to clean the browers cache, no different :disappointed_relieved:

Maybe the “502 Bad Gateway” error I receives after awhile when I try to open the UI is something ?

I don’t know why I haven’t checked the logger before!
But when I try to open NodeRed UI I receive following error

ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:64305 ssl:default [Connect call failed ('172.30.32.1', 64305)]

Anybody that know something about that?