hassio-addons/addon-node-red

502 Bad Gateway #341

willis7 posted onGitHub

Problem/Motivation

  • Fresh Hass.io install using install script
  • Centos 7
  • No other Add-ons
  • Install and Start steps looked fine. Clicking on Open Web UI resulted in 502 Bad Gateway.

Expected behavior

Node-red home screen

Actual behavior

502 Bad Gateway.

Similar to #335, however, I have added a password and I have disabled ssl. I have tried require_ssl as both true and false no change.

image

Add-on log

Log
[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... 

-----------------------------------------------------------
 Hass.io Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 4.2.1
 You are running the latest version of this add-on.
 System: CentOS Linux 7 (Core)  (amd64 / qemux86-64)
 Home Assistant version: 0.100.2
 Supervisor version: 189
-----------------------------------------------------------
 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... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing... 
patching file nodes/ui_base.html
Hunk #1 succeeded at 1243 (offset 712 lines).
up to date in 0.743s
found 0 vulnerabilities

[cont-init.d] node-red.sh: exited 0.
[cont-init.d] user.sh: executing... 
[cont-init.d] user.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:41:54] INFO: Starting Node-RED...

> hassio-addon-node-red@ start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"

15 Oct 19:41:56 - [info] 

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

15 Oct 19:41:56 - [info] Node-RED version: v0.20.8
15 Oct 19:41:56 - [info] Node.js  version: v10.16.3
15 Oct 19:41:56 - [info] Linux 3.10.0-1062.1.2.el7.x86_64 x64 LE
15 Oct 19:41:57 - [info] Loading palette nodes
15 Oct 19:42:00 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
15 Oct 19:42:01 - [info] Dashboard version 2.16.3 started at /endpoint/ui
15 Oct 19:42:01 - [info] Settings file  : /etc/node-red/config.js
15 Oct 19:42:01 - [info] Context store  : 'default' [module=memory]
15 Oct 19:42:01 - [info] User directory : /config/node-red/
15 Oct 19:42:01 - [warn] Projects disabled : editorTheme.projects.enabled=false
15 Oct 19:42:01 - [info] Flows file     : /config/node-red/flows.json
15 Oct 19:42:01 - [info] Starting flows
15 Oct 19:42:01 - [info] Started flows
15 Oct 19:42:01 - [info] Server now running at http://127.0.0.1:46836/
[19:42:02] INFO: Starting NGinx...
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
15 Oct 19:42:07 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant

Noteworthy

I notice from Portainer that the container appears to be setting network to host, but I guess I was expecting to see hassio.

Hope this helps


:wave: Thanks for opening your first issue here! If you're reporting a :bug: bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be usefull.

posted by addons-assistant[bot] over 5 years ago

There isn't anything in the logfile that shows an issue, Node Red runs on the host network. If this is the full log then the connections are not making it to the nginx service in the addon. Please check the hassio supervisor log for errors, and confirm you don't have any issues with host based firewalls.

posted by sinclairpaul over 5 years ago

Centos/Redhat/Fedora is known for blocking traffic on docker networks (in this case the Hassio network). Please check your firewalld config.

posted by frenck over 5 years ago

@frenck and @sinclairpaul - thank you both for the steer. As a crude validation, I disabled the firewall with sudo systemctl stop firewalld and I can now see the GUI.

I don't suppose you know what rules would be required to get this working securely? I will look in the meantime and feedback if/when I find something.

posted by willis7 over 5 years ago

FWIW, I found this useful piece of information:

When firewalld is started or restarted, it removes the DOCKER chain from iptables, preventing Docker from working properly. When using systemd, firewalld is started before Docker. If you start or restart firewalld after Docker, you need to restart the Docker daemon to enable the iptables rules again.

posted by willis7 over 5 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

posted by addons-assistant[bot] over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests