Home Assistant Community Add-on: Node-RED

If you go into the node-red container with a shell, do you have a file /etc/node-red/config.js ?
The log says that it cannot find this file…
And then, if you have a backup, you could restore your node-red config.
GV

I just managed to start node-red again. It looks like it was not an issue with the update.

I deleted my flows file from the configuration folder and suddenly, the add-on starts normally again. Maybe something was weird in there. I have to re-create my flows now, but that is okay.

The config.js file was normally available. Probably the problem was when the config tried to load the flows.

:tada: Release v6.0.4

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :arrow_up: Updates node-red-node-email to v1.7.6 (#435)
  • :ambulance: node-red/package.json to reduce vulnerabilities (#436)

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work:
https://github.com/sponsors/frenck or https://patreon.com/frenck

1 Like

Hi, can Anyone help me with node red in hassio. if I need to click, I only get a loading screen. nothing else happens. while it has always worked … has been reinstalled several times node-red and hass restarted. The log Gives also no errors. how do i solve this problem ? I dont know it anymore

Did you ever find a fix @matou ? Having the exact same issue. Tried a repair of the supervisor also and that didnt help.

Finally got it working again. Had to install portainers and node-red plugins. Then went into portainers and deleted the network from the image, then the container and images, then uninstalled the plugin. Rebooted hassos, reinstall node red. What a pain.

Is the Node Red RPI GPIO working? I try to make a clean install HassIO with 6.0.4 plug-in and the GPIO isn’t working.

[{"id":"e1b52e7f.33523","type":"inject","z":"ca610ca5.a165a","name":"1","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":420,"wires":[["3d79302e.1c951"]]},{"id":"3d79302e.1c951","type":"rpi-gpio out","z":"ca610ca5.a165a","name":"","pin":"7","set":true,"level":"0","freq":"","out":"out","x":440,"y":400,"wires":[]},{"id":"fa0fe2b5.ca047","type":"inject","z":"ca610ca5.a165a","name":"0","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":360,"wires":[["3d79302e.1c951"]]}]

:tada: Release v6.1.0

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :arrow_up: Updates node-red-dashboard to v2.19.4 (#441)
  • :hammer: Re-branding
  • :hammer: Update add-on with latest Supervisor changes
  • :hammer: Update add-on config with new password & list features
  • :books: Update add-on documentation to use new YAML configuration format
  • :arrow_up: Upgrades npm to 12.15.0-r1
  • :arrow_up: Updates node-red-node-email to v1.7.7 (#443)
  • :hammer: Re-branding
  • :shirt: Improve indenting in NGINX configuration
  • :arrow_up: Updates node-red-contrib-theme-midnight-red to v1.0.29 (#456)
  • :arrow_up: Upgrades add-on base image to v7.0.2
  • :hammer: Update community forum links
  • :arrow_up: Updates node-red-contrib-home-assistant-websocket to v0.20.2 (#448)
  • :arrow_up: Updates snyk to v1.296.0 (#447)
  • :arrow_up: Updates node-red-contrib-cast to v0.2.14 (#449)
  • :hammer: Update flows.json to use addon property (#451)
  • :ambulance: Add migration script for upstream breaking change

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work:
https://github.com/sponsors/frenck or https://patreon.com/frenck

After the upgrade I receive the following error:

24 Feb 02:00:46 - [error] [server:Home Assistant] Error: Invalid access token or password for websocket

Same here. Going to try to restore to an earlier snapshot to see if that will get me back up and running.

I fixed Node-RED by going into the configuration node settings. In the HASSIO node, the “I use Home Assistant Add On” was unchecked. I checked it and it now works.

Somehow it was unchecked and had an encryption key. AFAIK, the encryption key is used to set up Node-RED if it’s a standalone install.

3 Likes

Didn’t work for me! Any ideas?

26 Feb 11:50:24 - [info] [server:Home Assistant] WebSocket Connecting http://supervisor/core
26 Feb 11:50:24 - [info] [mqtt-broker:mosquitto] Connected to broker: mqtt://192.168.5.246:1883
26 Feb 11:50:24 - [error] [server:Home Assistant] Error: Invalid access token or password for websocket

I can’t seem to figure out how to navigate to the “Edit server node” menu. Would you mind explaining how to get there?

Running into the same issue as the other folks, also receiving the same error after the update:

[error] [server:Home Assistant] Error: Invalid access token or password for websocket

https://github.com/hassio-addons/addon-node-red#known-issues-and-limitations

Thank you! Thanks @PickleSlice as well.

I’ve currently rolled back to an earlier version (<3 VM’s) but I’ll upgrade again today and make sure this box is checked. Hopefully this fixes the issue. Thanks again.

I already checked the state “I use the Home Assistant Add-on”, but still not connecting!

[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: 6.1.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 10 (buster)  (amd64 / intel-nuc)
 Home Assistant Core: 0.105.5
 Home Assistant Supervisor: 201
-----------------------------------------------------------
 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).
audited 178 packages in 11.341s

13 packages are looking for funding
  run `npm fund` for details

found 2 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
[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.
[13:39:33] INFO: Starting Node-RED...

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

26 Feb 13:39:39 - [info] 

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

26 Feb 13:39:39 - [info] Node-RED version: v1.0.3
26 Feb 13:39:39 - [info] Node.js  version: v12.15.0
26 Feb 13:39:39 - [info] Linux 4.19.0-8-amd64 x64 LE
26 Feb 13:39:40 - [info] Loading palette nodes
26 Feb 13:39:54 - [info] Dashboard version 2.19.4 started at /endpoint/ui
Traceback (most recent call last):
  File "/opt/node_modules/node-red-node-pi-gpio/testgpio.py", line 4, in <module>
    import RPi.GPIO as GPIO
  File "/usr/lib/python2.7/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
26 Feb 13:39:56 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
26 Feb 13:39:56 - [info] Settings file  : /etc/node-red/config.js
26 Feb 13:39:56 - [info] Context store  : 'default' [module=memory]
26 Feb 13:39:56 - [info] User directory : /config/node-red/
26 Feb 13:39:56 - [warn] Projects disabled : editorTheme.projects.enabled=false
26 Feb 13:39:56 - [info] Flows file     : /config/node-red/flows.json
26 Feb 13:39:56 - [info] Server now running at http://127.0.0.1:46836/
26 Feb 13:39:57 - [info] Starting flows
[13:39:57] 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)
26 Feb 13:39:59 - [info] Started flows
26 Feb 13:39:59 - [info] [mqtt-broker:mosquitto] Connected to broker: mqtt://192.168.5.246:1883
26 Feb 13:40:02 - [info] [server:Home Assistant] WebSocket Connecting http://supervisor/core
26 Feb 13:40:02 - [error] [server:Home Assistant] [object Object]
26 Feb 13:40:05 - [error] [api-call-service:Umidade Solo do Jardim] Call-Service attempted without connection to server.

Did you restart the add-on after making the change?

Yes! I not just restarted the add-on, but restarted the OS too. Still no connecting in both cases… :frowning: :sob:

More info from the log:

File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/hassio/hassio/api/security.py", line 117, in token_validation
    return await handler(request)
  File "/usr/src/hassio/hassio/api/proxy.py", line 201, in websocket
    client = await self._websocket_client()
  File "/usr/src/hassio/hassio/api/proxy.py", line 112, in _websocket_client
    url, heartbeat=30, verify_ssl=False
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 738, in _ws_connect
    headers=resp.headers)
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='https://172.30.32.1:8123/api/websocket
20-02-27 11:00:51 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished coro=<WebSocketWriter.ping() done, defined at /usr/local/lib/python3.7/site-packages/aiohttp/http_websocket.py:631> exception=RuntimeError('unable to perform operation on <TCPTransport closed=True reading=False 0x55b54ae47dc0>; the handler is closed')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_websocket.py", line 635, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_websocket.py", line 617, in _send_frame
    self.transport.write(header + message)
  File "uvloop/handles/stream.pyx", line 673, in uvloop.loop.UVStream.write
  File "uvloop/handles/handle.pyx", line 159, in uvloop.loop.UVHandle._ensure_alive
RuntimeError: unable to perform operation on <TCPTransport closed=True reading=False 0x55b54ae47dc0>; the handler is closed
20-02-27 11:00:51 INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
20-02-27 11:00:51 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
20-02-27 11:00:51 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/hassio/hassio/api/security.py", line 117, in token_validation
    return await handler(request)
  File "/usr/src/hassio/hassio/api/proxy.py", line 201, in websocket
    client = await self._websocket_client()
  File "/usr/src/hassio/hassio/api/proxy.py", line 112, in _websocket_client
    url, heartbeat=30, verify_ssl=False
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 738, in _ws_connect
    headers=resp.headers)
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='https://172.30.32.1:8123/api/websocket
20-02-27 11:00:56 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished coro=<WebSocketWriter.ping() done, defined at /usr/local/lib/python3.7/site-packages/aiohttp/http_websocket.py:631> exception=RuntimeError('unable to perform operation on <TCPTransport closed=True reading=False 0x55b54ae9e3e0>; the handler is closed')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_websocket.py", line 635, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_websocket.py", line 617, in _send_frame
    self.transport.write(header + message)
  File "uvloop/handles/stream.pyx", line 673, in uvloop.loop.UVStream.write
  File "uvloop/handles/handle.pyx", line 159, in uvloop.loop.UVHandle._ensure_alive
RuntimeError: unable to perform operation on <TCPTransport closed=True reading=False 0x55b54ae9e3e0>; the handler is closed
20-02-27 11:00:56 INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
20-02-27 11:00:56 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
20-02-27 11:00:56 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/hassio/hassio/api/security.py", line 117, in token_validation
    return await handler(request)
  File "/usr/src/hassio/hassio/api/proxy.py", line 201, in websocket
    client = await self._websocket_client()
  File "/usr/src/hassio/hassio/api/proxy.py", line 112, in _websocket_client
    url, heartbeat=30, verify_ssl=False
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 738, in _ws_connect
    headers=resp.headers)
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='https://172.30.32.1:8123/api/websocket
20-02-27 11:01:01 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished coro=<WebSocketWriter.ping() done, defined at /usr/local/lib/python3.7/site-packages/aiohttp/http_websocket.py:631> exception=RuntimeError('unable to perform operation on <TCPTransport closed=True reading=False 0x55b54ae5dba0>; the handler is closed')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_websocket.py", line 635, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_websocket.py", line 617, in _send_frame
    self.transport.write(header + message)
  File "uvloop/handles/stream.pyx", line 673, in uvloop.loop.UVStream.write
  File "uvloop/handles/handle.pyx", line 159, in uvloop.loop.UVHandle._ensure_alive
RuntimeError: unable to perform operation on <TCPTransport closed=True reading=False 0x55b54ae5dba0>; the handler is closed
20-02-27 11:01:01 INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
20-02-27 11:01:02 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
20-02-27 11:01:02 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/hassio/hassio/api/security.py", line 117, in token_validation
    return await handler(request)
  File "/usr/src/hassio/hassio/api/proxy.py", line 201, in websocket
    client = await self._websocket_client()
  File "/usr/src/hassio/hassio/api/proxy.py", line 112, in _websocket_client
    url, heartbeat=30, verify_ssl=False
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 738, in _ws_connect
    headers=resp.headers)
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='https://172.30.32.1:8123/api/websocket