hassio-addons/addon-node-red

502 error bad gateway reported when web ui selected #268

Bazmundi posted onGitHub

Problem

First time install of hassio 64bit rpi 3b+. Installed node-red addon. After starting, got a 502 error bad gateway reported when web ui selected

Expected behavior

Node red editor should have been displayed.

Actual behavior

As per problem statement .


: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] almost 6 years ago

Please provide logs.

posted by frenck almost 6 years ago
19-07-14 12:16:52 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.hostname1 - /org/freedesktop/hostname1
19-07-14 12:16:52 INFO (MainThread) [hassio.utils.gdbus] Introspect de.pengutronix.rauc on /
19-07-14 12:16:52 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: de.pengutronix.rauc - /
19-07-14 12:16:52 INFO (MainThread) [hassio.host.info] Update local host information
19-07-14 12:16:52 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/hostname1
19-07-14 12:16:52 INFO (MainThread) [hassio.host.services] Update service information
19-07-14 12:16:52 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ListUnits on /org/freedesktop/systemd1
19-07-14 12:16:52 INFO (MainThread) [hassio.host.apparmor] Load AppArmor Profiles: {'hassio-supervisor'}
19-07-14 12:16:52 INFO (MainThread) [hassio.host.services] Reload local service hassos-apparmor.service
19-07-14 12:16:52 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ReloadOrRestartUnit on /org/freedesktop/systemd1
19-07-14 12:16:52 INFO (SyncWorker_1) [hassio.docker.interface] Attach to homeassistant/raspberrypi3-64-homeassistant with version landingpage
19-07-14 12:16:53 INFO (MainThread) [hassio.hassos] Detect HassOS 2.12 on host system
19-07-14 12:16:53 INFO (SyncWorker_0) [hassio.docker.hassos_cli] Found HassOS CLI homeassistant/aarch64-hassio-cli with version 11
19-07-14 12:16:53 INFO (MainThread) [hassio.store.git] Load add-on /data/addons/core repository
19-07-14 12:16:53 INFO (MainThread) [hassio.store.git] Load add-on /data/addons/git/a0d7b954 repository
19-07-14 12:16:54 INFO (MainThread) [hassio.store] Load add-ons from store: 59 all - 59 new - 0 remove
19-07-14 12:16:54 INFO (MainThread) [hassio.addons] Found 0 installed add-ons
19-07-14 12:16:54 INFO (MainThread) [hassio.updater] Fetch update data from https://s3.amazonaws.com/hassio-version/stable.json
19-07-14 12:16:55 INFO (MainThread) [hassio.snapshots] Found 0 snapshot files
19-07-14 12:16:55 INFO (MainThread) [hassio.discovery] Load 0 messages
19-07-14 12:16:55 INFO (MainThread) [hassio.ingress] Load 0 ingress session
19-07-14 12:16:55 INFO (MainThread) [__main__] Run Hass.io
19-07-14 12:16:55 INFO (MainThread) [hassio.misc.dns] Start DNS port forwarding for host add-ons
19-07-14 12:16:55 INFO (MainThread) [hassio.api] Start API on 172.30.32.2
19-07-14 12:16:55 INFO (MainThread) [hassio.addons] Phase 'initialize' start 0 add-ons
19-07-14 12:16:55 INFO (MainThread) [hassio.addons] Phase 'system' start 0 add-ons
19-07-14 12:16:55 INFO (MainThread) [hassio.addons] Phase 'services' start 0 add-ons
19-07-14 12:16:55 INFO (SyncWorker_5) [hassio.docker.interface] Restart homeassistant/raspberrypi3-64-homeassistant
19-07-14 12:17:01 INFO (MainThread) [hassio.homeassistant] Detect a running Home Assistant instance
19-07-14 12:17:01 INFO (MainThread) [hassio.addons] Phase 'application' start 0 add-ons
19-07-14 12:17:01 INFO (MainThread) [hassio.tasks] All core tasks are scheduled
19-07-14 12:17:01 INFO (MainThread) [hassio.core] Hass.io is up and running
19-07-14 12:17:01 INFO (MainThread) [hassio.homeassistant] Setup Home Assistant
19-07-14 12:17:01 INFO (SyncWorker_4) [hassio.docker.interface] Pull image homeassistant/raspberrypi3-64-homeassistant tag 0.95.4.
19-07-14 12:22:54 INFO (SyncWorker_4) [hassio.docker.interface] Tag image homeassistant/raspberrypi3-64-homeassistant with version 0.95.4 as latest
19-07-14 12:22:54 INFO (MainThread) [hassio.homeassistant] Home Assistant docker now installed
19-07-14 12:22:54 INFO (MainThread) [hassio.homeassistant] Start Home Assistant
19-07-14 12:22:54 INFO (SyncWorker_17) [hassio.docker.interface] Stop homeassistant application
19-07-14 12:23:00 INFO (SyncWorker_17) [hassio.docker.interface] Clean homeassistant application
19-07-14 12:23:01 INFO (SyncWorker_17) [hassio.docker.homeassistant] Start homeassistant homeassistant/raspberrypi3-64-homeassistant with version 0.95.4
19-07-14 12:23:42 INFO (MainThread) [hassio.homeassistant] Detect a running Home Assistant instance
19-07-14 12:23:42 INFO (SyncWorker_17) [hassio.docker.interface] Cleanup images: ['homeassistant/raspberrypi3-64-homeassistant:landingpage']
19-07-14 12:47:46 INFO (MainThread) [hassio.addons] Create Home Assistant add-on data folder /data/addons/data/core_configurator
19-07-14 12:47:46 INFO (SyncWorker_11) [hassio.docker.interface] Pull image homeassistant/aarch64-addon-configurator tag 3.4.
19-07-14 12:49:01 INFO (SyncWorker_11) [hassio.docker.interface] Tag image homeassistant/aarch64-addon-configurator with version 3.4 as latest
19-07-14 12:56:53 INFO (SyncWorker_12) [hassio.docker.addon] Start Docker add-on homeassistant/aarch64-addon-configurator with version 3.4
19-07-14 12:56:58 INFO (MainThread) [hassio.homeassistant] Updated Home Assistant API token
19-07-14 13:01:03 INFO (MainThread) [hassio.addons] Create Home Assistant add-on data folder /data/addons/data/core_mosquitto
19-07-14 13:01:03 INFO (SyncWorker_4) [hassio.docker.interface] Pull image homeassistant/aarch64-addon-mosquitto tag 5.0.
19-07-14 13:01:20 INFO (SyncWorker_4) [hassio.docker.interface] Tag image homeassistant/aarch64-addon-mosquitto with version 5.0 as latest
19-07-14 13:01:48 INFO (SyncWorker_10) [hassio.docker.addon] Start Docker add-on homeassistant/aarch64-addon-mosquitto with version 5.0
19-07-14 13:01:54 INFO (MainThread) [hassio.services.modules.mqtt] Set core_mosquitto as service provider for mqtt
19-07-14 13:01:54 INFO (MainThread) [hassio.discovery] Send discovery to Home Assistant mqtt from core_mosquitto
19-07-14 13:01:55 INFO (MainThread) [hassio.discovery] Discovery e99f6f7fd3e94be2950962e7c7a14c01 message send
19-07-14 13:01:56 INFO (SyncWorker_6) [hassio.docker.interface] Stop addon_core_mosquitto application
19-07-14 13:01:58 INFO (SyncWorker_6) [hassio.docker.interface] Clean addon_core_mosquitto application
19-07-14 13:02:01 INFO (SyncWorker_16) [hassio.docker.interface] Remove image homeassistant/aarch64-addon-mosquitto with latest and 5.0
19-07-14 13:02:02 INFO (MainThread) [hassio.addons.addon] Remove add-on data folder /data/addons/data/core_mosquitto
19-07-14 13:02:02 INFO (MainThread) [hassio.discovery] Delete discovery to Home Assistant mqtt from core_mosquitto
19-07-14 13:02:02 INFO (MainThread) [hassio.discovery] Discovery e99f6f7fd3e94be2950962e7c7a14c01 message send
19-07-14 13:07:54 INFO (MainThread) [hassio.addons] Create Home Assistant add-on data folder /data/addons/data/a0d7b954_nodered
19-07-14 13:07:54 INFO (SyncWorker_14) [hassio.docker.interface] Pull image hassioaddons/node-red-aarch64 tag 4.0.2.
19-07-14 13:08:00 INFO (SyncWorker_7) [hassio.docker.interface] Pull image hassioaddons/node-red-aarch64 tag 4.0.2.
19-07-14 13:09:25 INFO (SyncWorker_14) [hassio.docker.interface] Tag image hassioaddons/node-red-aarch64 with version 4.0.2 as latest
19-07-14 13:09:25 INFO (SyncWorker_7) [hassio.docker.interface] Tag image hassioaddons/node-red-aarch64 with version 4.0.2 as latest
19-07-14 13:11:58 INFO (SyncWorker_13) [hassio.docker.addon] Start Docker add-on hassioaddons/node-red-aarch64 with version v4.0.2
19-07-14 13:12:05 INFO (MainThread) [hassio.api.security] /host/info access from a0d7b954_nodered
19-07-14 13:12:09 INFO (SyncWorker_18) [hassio.docker.interface] Stop addon_a0d7b954_nodered application
19-07-14 13:12:10 INFO (SyncWorker_18) [hassio.docker.interface] Clean addon_a0d7b954_nodered application
19-07-14 13:12:55 INFO (SyncWorker_10) [hassio.docker.addon] Start Docker add-on hassioaddons/node-red-aarch64 with version v4.0.2
19-07-14 13:12:57 ERROR (MainThread) [hassio.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62547 ssl:None [Connection refused]
19-07-14 13:13:02 INFO (MainThread) [hassio.api.security] /host/info access from a0d7b954_nodered
19-07-14 13:13:03 ERROR (MainThread) [hassio.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62547 ssl:None [Connection refused]
19-07-14 13:13:06 INFO (SyncWorker_8) [hassio.docker.interface] Stop addon_a0d7b954_nodered application
19-07-14 13:13:06 INFO (SyncWorker_8) [hassio.docker.interface] Clean addon_a0d7b954_nodered application
19-07-14 13:13:09 INFO (SyncWorker_7) [hassio.docker.addon] Start Docker add-on hassioaddons/node-red-aarch64 with version v4.0.2
19-07-14 13:13:11 ERROR (MainThread) [hassio.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62547 ssl:None [Connection refused]
19-07-14 13:13:15 INFO (MainThread) [hassio.api.security] /host/info access from a0d7b954_nodered
19-07-14 13:13:18 INFO (SyncWorker_13) [hassio.docker.interface] Stop addon_a0d7b954_nodered application
19-07-14 13:13:19 INFO (SyncWorker_13) [hassio.docker.interface] Clean addon_a0d7b954_nodered application
19-07-14 13:13:19 INFO (SyncWorker_13) [hassio.docker.interface] Remove image hassioaddons/node-red-aarch64 with latest and v4.0.2
19-07-14 13:13:19 INFO (MainThread) [hassio.addons.addon] Remove add-on data folder /data/addons/data/a0d7b954_nodered
19-07-14 13:14:22 INFO (MainThread) [hassio.addons] Create Home Assistant add-on data folder /data/addons/data/a0d7b954_nodered
19-07-14 13:14:22 INFO (SyncWorker_8) [hassio.docker.interface] Pull image hassioaddons/node-red-aarch64 tag 4.0.2.
19-07-14 13:14:25 INFO (SyncWorker_8) [hassio.docker.interface] Tag image hassioaddons/node-red-aarch64 with version 4.0.2 as latest
19-07-14 13:15:09 INFO (SyncWorker_9) [hassio.docker.addon] Start Docker add-on hassioaddons/node-red-aarch64 with version v4.0.2
19-07-14 13:15:11 ERROR (MainThread) [hassio.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62547 ssl:None [Connection refused]
19-07-14 13:15:15 INFO (MainThread) [hassio.api.security] /host/info access from a0d7b954_nodered
19-07-14 13:15:31 INFO (SyncWorker_13) [hassio.docker.interface] Clean addon_a0d7b954_nodered application
19-07-14 13:15:31 INFO (SyncWorker_13) [hassio.docker.interface] Remove image hassioaddons/node-red-aarch64 with latest and v4.0.2
19-07-14 13:15:31 INFO (MainThread) [hassio.addons.addon] Remove add-on data folder /data/addons/data/a0d7b954_nodered
19-07-14 13:15:39 INFO (MainThread) [hassio.addons] Create Home Assistant add-on data folder /data/addons/data/a0d7b954_nodered
19-07-14 13:15:39 INFO (SyncWorker_2) [hassio.docker.interface] Pull image hassioaddons/node-red-aarch64 tag 4.0.2.
19-07-14 13:15:43 INFO (SyncWorker_2) [hassio.docker.interface] Tag image hassioaddons/node-red-aarch64 with version 4.0.2 as latest
19-07-14 13:15:52 INFO (SyncWorker_11) [hassio.docker.addon] Start Docker add-on hassioaddons/node-red-aarch64 with version v4.0.2
19-07-14 13:15:53 ERROR (MainThread) [hassio.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62547 ssl:None [Connection refused]
19-07-14 13:15:58 INFO (MainThread) [hassio.api.security] /host/info access from a0d7b954_nodered
19-07-14 13:16:12 INFO (SyncWorker_19) [hassio.docker.interface] Clean addon_a0d7b954_nodered application
19-07-14 13:16:12 INFO (SyncWorker_19) [hassio.docker.interface] Remove image hassioaddons/node-red-aarch64 with latest and v4.0.2
19-07-14 13:16:12 INFO (MainThread) [hassio.addons.addon] Remove add-on data folder /data/addons/data/a0d7b954_nodered
posted by Bazmundi almost 6 years ago

add-on logs... please...

posted by frenck almost 6 years ago

I am good. If it is this problematic out of the box it isn't ready for production.

posted by Bazmundi almost 6 years ago

? @Bazmundi have you fixed the issue? Not sure what you are referring to, the addon is absolutely production ready.

posted by frenck almost 6 years ago

Reopening issue, since I feel like it is unsolved

posted by frenck almost 6 years ago

I have the same issue on a new docker install (odroid-c2) no log show up under the add-on this is pulled from the hass.io system logs.

19-07-15 01:54:58 INFO (MainThread) [hassio.addons] Create Home Assistant add-on data folder /data/addons/data/a0d7b954_nodered 19-07-15 01:54:58 INFO (SyncWorker_17) [hassio.docker.interface] Pull image hassioaddons/node-red-aarch64 tag 4.0.2. 19-07-15 01:55:50 INFO (SyncWorker_17) [hassio.docker.interface] Tag image hassioaddons/node-red-aarch64 with version 4.0.2 as latest 19-07-15 01:55:54 INFO (MainThread) [hassio.ingress] Update Ingress as panel for a0d7b954_nodered 19-07-15 01:56:28 ERROR (SyncWorker_16) [hassio.docker] Can't start addon_a0d7b954_nodered: 500 Server Error: Internal Server Error ("linux runtime spec devices: error gathering device information while adding custom device "/dev/mem": no such file or directory") 19-07-15 01:56:29 ERROR (MainThread) [hassio.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62792 ssl:None [Connection refused] 19-07-15 01:56:36 INFO (SyncWorker_7) [hassio.docker.interface] Clean addon_a0d7b954_nodered application

posted by deadman96385 almost 6 years ago

I just wanted to comment that immediately after a restart of Hassio when using NGINX on an RPI3B+, Node Red takes about 15 seconds to "boot up" before it is accessible via the side-menu. Attempts to access it before the 15 second time frame post boot will return 502 Bad Gateway. Anything longer than 15 seconds would indicate an issue to me and referring to the add-on log display (at the bottom of the Node Red add-on configuration page) would be the best way to establish the source of the problem.

Incorrect initial set up of the Node Red configuration and ignoring the add-on logs can easily lead to this error occurring.

posted by universenz almost 6 years ago

@deadman96385 Your issue is related to your device/HassOS (I guess?) From the add-on perspective, there is not much I can do for your issue. A bug report @ hassio / hassos might be more fitting.

To bad @Bazmundi doesn't respond anymore. We all really work really hard to get thing perfect, that kinda attitude of creating an issue, ran off before we can do anything about it and stating it is not production-ready is just wrong.

Closing for now. Happy to help if it occurs again.

posted by frenck almost 6 years ago

Hi, I was seeing this same issue (on Hass.io, getting "502 bad gateway") The solution (in my case) was to .... just wait a bit and give node-red time to come online Thanks to @universenz for mentioning it. When I saw in the Node-red logs that the Add-on deployed OK. I assumed that that meant that the services were actually "on-line". Indeed, these are two different things...

So, once in a while, the solution is simple Unfortunately, this doesn't happen nearly enough

posted by cvdabbeele over 5 years ago

Hi, I was seeing this same issue (on Hass.io, getting "502 bad gateway") The solution (in my case) was to .... just wait a bit and give node-red time to come online Thanks to @universenz for mentioning it. When I saw in the Node-red logs that the Add-on deployed OK. I assumed that that meant that the services were actually "on-line". Indeed, these are two different things...

So, once in a while, the solution is simple Unfortunately, this doesn't happen nearly enough

posted by cvdabbeele over 5 years ago

@frenck I think I have the same issue.

I installed hassio today

502: Bad Gateway

no matter how many times I click Start, it always stops some seconds later

seems I need some SSL file, but this is not mentioned in installation step-by-step manual

[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.1.0
 You are running the latest version of this add-on.
 System: HassOS 3.3  (armv7 / raspberrypi4)
 Home Assistant version: 0.97.2
 Supervisor version: 184
-----------------------------------------------------------
 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... 
[23:58:53] FATAL: 
[23:58:53] FATAL: SSL has been enabled using the 'ssl' option,
[23:58:53] FATAL: this requires a SSL certificate file which is
[23:58:53] FATAL: configured using the 'certfile' option in the
[23:58:53] FATAL: add-on configuration.
[23:58:53] FATAL: 
[23:58:53] FATAL: Unfortunately, the file specified in the
[23:58:53] FATAL: 'certfile' option does not exists.
[23:58:53] FATAL: 
[23:58:53] FATAL: Please ensure the certificate file exists and
[23:58:53] FATAL: is placed in the Hass.io '/ssl/' directory.
[23:58:53] FATAL: 
[23:58:53] FATAL: In case you don't have SSL yet, consider getting
[23:58:53] FATAL: a SSL certificate or setting the 'ssl' option
[23:58:53] FATAL: to 'false' in case you are not planning on using
[23:58:53] FATAL: SSL with this add-on.
[23:58:53] FATAL: 
[23:58:53] FATAL: Check the add-on manual for more information.
[23:58:53] 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.


{
  "credential_secret": "removed",
  "dark_mode": false,
  "http_node": {
    "username": "",
    "password": ""
  },
  "http_static": {
    "username": "",
    "password": ""
  },
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "require_ssl": true,
  "system_packages": [],
  "npm_packages": [],
  "init_commands": []
}
posted by qqgg231 over 5 years ago

If you don't have an SSL cert, set "ssl": false, this is documented.

posted by sinclairpaul 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