Home Assistant Community Add-on: Node-RED

Solved it! Actually it was two things, if anyone is interested:

For some reason I had to change the DNS server to Google. You can use the SSL/terminal add-on for this:

ha dns options --servers dns://8.8.8.8
ha dns restart

After that I got a different error, that ‘make’ package wasn’t installed. I had to add ‘make’ to the node-red configuration file, under system packages. I also added ‘node-red-contrib-m’ to npm-packages, restarted, and it’s all working now!

i have the same issue, connection on port 1880 goes into a 500 Internal Server Error.

2021/01/23 23:06:11 [error] 570#570: *1 lua entry thread aborted: runtime error: /usr/share/lua/common/resty/core/request.lua:124: no request found
stack traceback:
coroutine 0:
	[C]: in function 'error'
	/usr/share/lua/common/resty/core/request.lua:124: in function 'get_headers'
	/etc/nginx/lua/ha-auth.lua:7: in function 'authenticate'
	/etc/nginx/lua/ha-auth.lua:73: in function </etc/nginx/lua/ha-auth.lua:1>, client: 192.168.x.y, server: a0d7b954-nodered, request: "GET / HTTP/1.1", host: "192.168.x.x:1880"
[23/Jan/2021:23:06:11 +0100] 500 -(192.168.x.y) GET / HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36)
2021/01/23 23:06:12 [error] 570#570: *2 lua entry thread aborted: runtime error: /usr/share/lua/common/resty/core/request.lua:124: no request found
stack traceback:
coroutine 0:
	[C]: in function 'error'
	/usr/share/lua/common/resty/core/request.lua:124: in function 'get_headers'
	/etc/nginx/lua/ha-auth.lua:7: in function 'authenticate'
	/etc/nginx/lua/ha-auth.lua:73: in function </etc/nginx/lua/ha-auth.lua:1>, client: 192.168.x.y, server: a0d7b954-nodered, request: "GET /favicon.ico HTTP/1.1", host: "192.168.x.x:1880", referrer: "http://192.168.x.x:1880/"```
1 Like

I also have this issue – 500 Internal Server Error.
I rolled back the update and everything was fine, updated again and the issue presented itself agian.
This is the NodeRed update not the HA update

I’m not very Linux savvy but my setup is as follows:
Host - NUC running Ubuntu
HA and all addons(Node Red Included) are running via Docker

I have tried to install OpenResty and it claims its installed however every time I boot up NodeRed it claims its running LuaJIT

nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16) in /etc/nginx/nginx.conf:43
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)

Not sure if that’s linked to the issue or not. I can access the NodeRed UI through HA but not directly anymore… When I attempt to connect directly I get the following message in the logs

HTTP/1.1 (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0)
2021/01/23 17:30:26 [error] 573#573: *1298 lua entry thread aborted: runtime error: /usr/share/lua/common/resty/core/request.lua:124: no request found
stack traceback:
coroutine 0:
	[C]: in function 'error'
	/usr/share/lua/common/resty/core/request.lua:124: in function 'get_headers'
	/etc/nginx/lua/ha-auth.lua:7: in function 'authenticate'
	/etc/nginx/lua/ha-auth.lua:73: in function </etc/nginx/lua/ha-auth.lua:1>, client: 192.168.50.5, server: a0d7b954-nodered, request: "GET / HTTP/2.0", host: "192.168.50.5:1880"
[23/Jan/2021:17:30:26 -0500] 500 -(192.168.50.5) GET / HTTP/2.0 (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0)
2021/01/23 17:30:26 [error] 573#573: *1298 lua entry thread aborted: runtime error: /usr/share/lua/common/resty/core/request.lua:124: no request found
stack traceback:
coroutine 0:
	[C]: in function 'error'
	/usr/share/lua/common/resty/core/request.lua:124: in function 'get_headers'
	/etc/nginx/lua/ha-auth.lua:7: in function 'authenticate'
	/etc/nginx/lua/ha-auth.lua:73: in function </etc/nginx/lua/ha-auth.lua:1>, client: 192.168.50.5, server: a0d7b954-nodered, request: "GET /favicon.ico HTTP/2.0", host: "192.168.50.5:1880", referrer: "https://192.168.50.5:1880/"
[23/Jan/2021:17:30:26 -0500] 500 -(192.168.50.5) GET /favicon.ico HTTP/2.0 (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0)

Also – I cannot find those file paths on the host system

I checked on github and many others have this issue, so we are not alone :laughing:

That’s good! The more with issues, the faster the fix will present itself! Also I have found those files
/etc/nginx/lua/ha-auth.lua
/usr/share/lua/common/resty/core/request.lua
Got to them via Portianer -> Container Console
But I have no idea how to open or manipulate them lol – I need to learn more about linux

Also if you have remote access to your host system, you can still access the UI by going to
http://127.0.0.1:46836/ (found this url in the log files as well)
sadly it refuses the connection when I try to do it over the local network
in my case – http://192.168.50.5:46836/

After I upgrade node-red adddon to 8.1.0 I have a problem with serialport an node node-red-contrib-rfxcom not working.

How I can fix this problem?

Error:

> @serialport/[email protected] install /config/node-red/node_modules/@serialport/list/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=14.15.4 runtime=node arch=arm libc=musl platform=linux)
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:183:21)
gyp ERR! System Linux 5.4.79-v7
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /config/node-red/node_modules/@serialport/list/node_modules/@serialport/bindings
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
> @serialport/[email protected] install /config/node-red/node_modules/node-red-contrib-modbus/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=14.15.4 runtime=node arch=arm libc=musl platform=linux)
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:183:21)
gyp ERR! System Linux 5.4.79-v7
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /config/node-red/node_modules/node-red-contrib-modbus/node_modules/@serialport/bindings
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: olm@https://matrix.org/packages/npm/olm/olm-1.0.0.tgz (node_modules/matrix-js-sdk/node_modules/olm):
npm WARN 404 SKIPPING OPTIONAL DEPENDENCY: Not Found - GET https://packages.matrix.org/npm/olm/olm-1.0.0.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @serialport/[email protected] (node_modules/@serialport/list/node_modules/@serialport/bindings):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @serialport/[email protected] install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @serialport/[email protected] (node_modules/node-red-contrib-modbus/node_modules/@serialport/bindings):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @serialport/[email protected] install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
audited 519 packages in 34.137s
20 packages are looking for funding
  run `npm fund` for details
found 31 vulnerabilities (21 low, 2 moderate, 7 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

I found on this link that maybe alpine linux base is a problem:
serialport

Greetings all
Quick question how can I manually trigger a Node Red update? I’m currently running 8.0.1 on Hass.io, yet I noticed in the log that there is a newer version 8.1.0 available:

Add-on version: 8.0.1
There is an update available for this add-on!
Latest add-on version: 8.1.0
Please consider upgrading as soon as possible.
System: Home Assistant OS 5.10 (amd64 / qemux86-64)
Home Assistant Core: 2021.1.5
Home Assistant Supervisor: 2021.01.7

I have deliberately not enabled automatic updates as I prefer to snapshot my VM before upgrading critical components.

Does anybody know how to fix this issue that seems to appear on the latest version of the addon:

Thanks in advance

mkdir: can’t create directory ‘/dev/shm/’: No such file or directory
[17:23:57] FATAL: Could not create cache folder
Add-on:
mkdir: can’t create directory ‘/dev/shm/’: No such file or directory
[17:23:57] FATAL: Could not create cache folder

mkdir: can’t create directory ‘/dev/shm/’: No such file or directory
[17:23:58] FATAL: Could not create cache folder
Add-on version:
mkdir: can’t create directory ‘/dev/shm/’: No such file or directory
[17:23:58] FATAL: Could not create cache folder

/dev/shm/ does exist and it is fully accessible i.e. (chmod 777) but the problem persists, not only for this adds-on, but also for ssh & web terminal.

some more info

Operating System
Ubuntu 20.04 LTS
Docker version
19.03.12

Supervisor
Version
supervisor-2021.02.6
Newest Version
supervisor-2021.02.6

Core
Version
core-2021.2.2
Newest Version
core-2021.2.2

Others have asked too, but I haven’t seen an answer yet.

If I understand this correctly, the Dashboard works with ingress? If yes, how do I access it?
When I click on the Dashboard link I get to “https://[NabuCasaIP]/endpoint/ui” which shows me an 404: Not Found. I really appreciate your help. Thanks

I am trying to add a node to access some sensors I have connected to the I2C bus on the same Pi that i have Homeassistant-supervisor (in docker container) running with the Node-Red add-on. Adding any node with a reference to an i2c device fails to install with the below messages in the log. The relevant part of the docker compose config is also listed.

The main error seems to be related to a missing linux/type.h file but I don’t understand how this is missing when it installs fine on a vanilla Node red install outside of docker.

system_packages:
  - make
  - g++
  - gcc
npm_packages:
  - node-red-contrib-scd30
init_commands: []
devices:
  - '/dev/i2c-1:/dev/i2c-1'
privileged: true
[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: 8.1.1
 You are running the latest version of this add-on.
 System: Raspbian GNU/Linux 10 (buster)  (armv7 / raspberrypi3)
 Home Assistant Core: 2021.2.3
 Home Assistant Supervisor: 2021.02.9
-----------------------------------------------------------
 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... 
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/armv7/APKINDEX.tar.gz
v3.13.1-136-gc30d8ead50 [https://dl-cdn.alpinelinux.org/alpine/v3.13/main]
v3.13.1-136-gc30d8ead50 [https://dl-cdn.alpinelinux.org/alpine/v3.13/community]
OK: 13487 distinct packages available
(1/1) Installing make (4.3-r0)
Executing busybox-1.32.1-r0.trigger
OK: 125 MiB in 47 packages
(1/12) Installing binutils (2.35.1-r1)
(2/12) Installing libgomp (10.2.1_pre1-r3)
(3/12) Installing libatomic (10.2.1_pre1-r3)
(4/12) Installing libgphobos (10.2.1_pre1-r3)
(5/12) Installing gmp (6.2.1-r0)
(6/12) Installing isl22 (0.22-r0)
(7/12) Installing mpfr4 (4.1.0-r0)
(8/12) Installing mpc1 (1.2.0-r0)
(9/12) Installing gcc (10.2.1_pre1-r3)
(10/12) Installing musl-dev (1.2.2-r0)
(11/12) Installing libc-dev (0.7.2-r3)
(12/12) Installing g++ (10.2.1_pre1-r3)
Executing busybox-1.32.1-r0.trigger
OK: 249 MiB in 59 packages
OK: 249 MiB in 59 packages
[22:12:40] INFO: Starting installation of custom NPM/Node-RED packages...
> [email protected] install /opt/node_modules/i2c-bus
> node-gyp rebuild
make: Entering directory '/opt/node_modules/i2c-bus/build'
  CXX(target) Release/obj.target/i2c/src/i2c.o
In file included from ../src/i2c.cc:17:
../src/./i2c-dev.h:26:10: fatal error: linux/types.h: No such file or directory
   26 | #include <linux/types.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [i2c.target.mk:109: Release/obj.target/i2c/src/i2c.o] Error 1
make: Leaving directory '/opt/node_modules/i2c-bus/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 5.10.11-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/node_modules/i2c-bus
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-02-17T11_43_54_326Z-debug.log
[22:13:54] FATAL: Failed to install a specified npm package
[cont-init.d] customizations.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.

@briandee
hi you solved this problem i have exactly the same one

Hey …
Works for me:

credential_secret: MYSECRET
dark_mode: false
http_node:
  username: ''
  password: ''
http_static:
  username: ''
  password: ''
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
require_ssl: false
system_packages:
  - make
  - g++
  - linux-headers
npm_packages:
  - node-red-dashboard
  - node-red-contrib-i2c
init_commands: []

The missing package linux-headers is causing this error fatal error: linux/types.h

Hope this helps.
Now trying the same thing. Read a sensor (INA219)

Just tried using Node-Red via a separate browser, it worked fine. I just logged in with the same credentials I used for HA.

I am trying to convert some Zwave devices from Homeseer to HA and would like to use the Node Red Add-on to connect both systems until they are supported on HA. I’ve installed the Homeseer module and am able to see the devices. In order for those devices to show their current state, the Homeseer instructions states:

In order for Node-RED to receive device status updates from HomeSeer you need to setup a webhook URL. From the HomeSeer web interface go to Setup > Custom and add your Node-RED URL followed by /homeseer/webhook . For example if Node-RED is running on the same machine as HomeSeer, it should be something like http://127.0.0.1:1880/homeseer/webhook

When I configure HS with
http://192.168.1.66:1880/homeseer/webhook
I get the following error - auth request unexpected status: 500 while sending to client, in the HA Node Red logs.

When I configure HS with
http://192.168.1.66:1880/endpoint/homeseer/webhook
I get the following error - Posting to webhook failed: The remote server returned an error: (404) Not Found. URL: http://192.168.1.66:1880/endpoint/homeseer/webhook in the HS logs

I’m running HA on a pi4 and am at all current versions as of today.

Should I be able to configure HS with the Add-on? If not, I know I can with a separate install of Node Red…but I’d prefer to use the Add-on if possible.

I am starting to loos my mind here, where should I type in my strong password to not get a warning from the supervisor?

I have generated a strong password, and when I check in at haveibeenpawned I get the result " Good news — no pwnage found!" The add on logg states

[17:30:39] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[17:30:39] INFO: Password is NOT in the Have I Been Pwned database! Nice!

But I still get this notifications

image

This is my config now, what am I missing?

I think the credential_secret is also being checked. I changed mine and the notifications stopped, but then I started getting warnings in Node Red about my credentials not able to be decrypted. Unsure how to fix this without breaking anything, I just reverted to my original credential_secret and will live with the warnings. I also did try to block the pwnedpasswords.com and haveibeenpwned.com domains using AdGuard, but I still get the warnings.

I did the same with credential_secret but got the same issue as you describes. There is a heated thread about this pwned thing here

I have not tried this myself yet but the notifications can be stop with this automation

fix the credential_secret, that is what fixed it for me

@gokuro How did you do that in Node-RED?