hassio-addons/addon-node-red

Node-Red fails to start, shows "mv: can't rename '/etc/nginx/servers/direct.disables': No such file or directory" #743

hurenkam posted onGitHub

Problem/Motivation

While setting up Home Assistant (Supervised) in a Debian Buster VM running on ProxMox, starting the Node-Red add-on after installation seems to fail. Selecting 'Open Web UI' shows 502: Bad Gateway

Taking a look at the containers status with 'docker container list --all' shows this:

0f8ec0f3c0e7        hassioaddons/node-red-amd64:7.2.7                "/init"                  8 minutes ago       Exited (1) 3 minutes ago                           addon_a0d7b954_nodered
4f8f6629bf28        hassioaddons/vscode-amd64:2.8.2                  "/init"                  9 minutes ago       Up 8 minutes                                       addon_a0d7b954_vscode
fcad0835929e        homeassistant/qemux86-64-homeassistant:0.117.2   "/init"                  12 minutes ago      Up 12 minutes                                      homeassistant
81eb8c740aaf        homeassistant/amd64-hassio-multicast:3           "/init"                  14 minutes ago      Up 14 minutes                                      hassio_multicast
33793a0645b5        homeassistant/amd64-hassio-observer:2020.10.1    "/init"                  14 minutes ago      Up 14 minutes               0.0.0.0:4357->80/tcp   hassio_observer
8d5cfb7cc1ba        homeassistant/amd64-hassio-cli:2020.10.1         "/init /bin/bash -c …"   14 minutes ago      Up 14 minutes                                      hassio_cli
4010f84838ef        homeassistant/amd64-hassio-audio:17              "/init"                  14 minutes ago      Up 14 minutes                                      hassio_audio
6cd3aa749e86        homeassistant/amd64-hassio-dns:2020.11.0         "/init"                  14 minutes ago      Up 14 minutes                                      hassio_dns
f032b5c3e179        homeassistant/amd64-hassio-supervisor            "/init"                  15 minutes ago      Up 14 minutes                                      hassio_supervisor

Leading me to believe that the addon is crashing on start.

Starting the 'addon_a0d7b954_nodered` container manually with 'docker container start -a addon_a0d7b954_nodered' shows the following:

[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: 7.2.7
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 10 (buster)  (amd64 / qemux86-64)
 Home Assistant Core: 0.117.2
 Home Assistant Supervisor: 2020.10.1
-----------------------------------------------------------
 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...
mv: can't rename '/etc/nginx/servers/direct.disabled': No such file or directory
[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.
[s6-finish] sending all processes the KILL signal and exiting.

Expected behavior

Node-Red service starts normally, and selecting 'Open Web UI' brings up the Node-Red editor.

Actual behavior

Initially 502: Bad Gateway is shown when an attempt is made to bring up the Node-Red editor. After that, the 'Start' option re-appears, and the 'Open Web UI' options is gone, suggesting the service did not start properly.

Steps to reproduce

  1. Install debian buster inside a Proxmox VM.
  2. Install home assistant supervised by using the script: https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh | bash -s
  3. Go to the add-ons and install Node-Red
  4. Select 'Start' and subsequently 'Open Web UI'

Proposed changes

It seems there is a file missing, simplest thing to do would be to just add it.


Please uninstall the addon, reinstall and start from the UI, and post the logs from the UI.

Also please post the addon config.

posted by sinclairpaul over 4 years ago

Reinstalling gives the same results. UI Logs contain only a single error:

 Log Details (ERROR)

Logger: aiohttp.server
Source: /usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py:355
First occurred: 8:15:11 AM (1 occurrences)
Last logged: 8:15:11 AM 

Unhandled exception

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 461, in start
    await prepare_meth(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_fileresponse.py", line 223, in prepare
    st = await loop.run_in_executor(None, filepath.stat)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/pathlib.py", line 1197, in stat
    return self._accessor.stat(self)
FileNotFoundError: [Errno 2] No such file or directory: '/config/home-assistant.log'

options.json for the addon contains the following:

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

Strangely, this file seems to be reset to default values after each attempt to start. (changing the error to a missing ssl certificate) Am i editing this in the wrong location? I'm editing /usr/share/hassio/addons/data/a0d7b954_nodered/options.json

posted by hurenkam over 4 years ago

That is the Homeassistant Log, not the addon log.

All addons have tabs at the top of the page, please use those.

image

posted by sinclairpaul over 4 years ago

Looks like I've been editing the configuration in the wrong place. I just noticed the top menu bar changes when i select supervisor then node-red, and that there is a Configuration item there in the menu. When i make changes there, they are persistent, and I am now able to use the editor. Not sure yet how everything else is working, but this particular installation problem is due to misunderstanding on my side. Sorry for any inconvenience caused.

This issue can be closed as far as I am concerned.

posted by hurenkam over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests