No Home Assistant connection after Node-RED restart
See original GitHub issueProblem/Motivation
After restarting Node-RED from supervisor, Node-RED is no longer connecting to Home assistant and is throwing an error about an “Invalid access token or password”
Log
[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: 6.0.4
You are running the latest version of this add-on.
System: null (amd64 / qemux86-64)
Home Assistant version: 0.105.5
Supervisor version: 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...
[12:47:57] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[12:47:58] INFO: Password is NOT in the Have I Been Pwned database! Nice!
patching file nodes/ui_base.html
Hunk #1 succeeded at 1243 (offset 712 lines).
npm WARN babel-loader@7.1.5 requires a peer of babel-core@6 but none is installed. You must install peer dependencies yourself.
npm WARN babel-loader@7.1.5 requires a peer of webpack@2 || 3 || 4 but none is installed. You must install peer dependencies yourself.
audited 17226 packages in 43.523s
27 packages are looking for funding
run `npm fund` for details
found 5 vulnerabilities (2 low, 1 moderate, 2 high)
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...
[12:48:48] INFO: Starting installation of custom NPM/Node-RED packages...
+ node-red-contrib-theme-midnight-red@1.0.29
updated 1 package and audited 3856 packages in 19.616s
19 packages are looking for funding
run `npm fund` for details
found 2 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
[cont-init.d] user.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[12:49:12] INFO: Starting Node-RED...
[services.d] done.
> hassio-addon-node-red@ start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
23 Feb 12:49:14 - [info]
Welcome to Node-RED
===================
23 Feb 12:49:14 - [info] Node-RED version: v1.0.3
23 Feb 12:49:14 - [info] Node.js version: v12.14.0
23 Feb 12:49:14 - [info] Linux 4.4.59+ x64 LE
23 Feb 12:49:15 - [info] Loading palette nodes
Initializing chat-platform lib, you should see this only once
Running at: /config/node-red/node_modules/chat-platform Version: 1.0.11
Sun, 23 Feb 2020 17:49:25 GMT node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. at internal/modules/cjs/loader.js:959:30
23 Feb 12:49:32 - [info] RedBot version: 0.18.12 (node-red-contrib-chatbot)
Compiling dictionary
23 Feb 12:49:56 - [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!
23 Feb 12:50:02 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
23 Feb 12:50:02 - [info] Settings file : /etc/node-red/config.js
23 Feb 12:50:02 - [info] Context store : 'default' [module=memory]
23 Feb 12:50:02 - [info] User directory : /config/node-red/
23 Feb 12:50:02 - [warn] Projects disabled : editorTheme.projects.enabled=false
23 Feb 12:50:02 - [info] Flows file : /config/node-red/flows.json
23 Feb 12:50:02 - [info] Server now running at http://127.0.0.1:46836/
23 Feb 12:50:02 - [info] Starting flows
Telegram Bot Home Assistant Telegram will be launched, environment is development
No context provider specified for chatbot Home Assistant Telegram. Defaulting to "memory"
23 Feb 12:50:02 - [info] Started flows
------ WebHooks for TELEGRAM----------------
http://localhost:46836/redbot/telegram/test/
http://localhost:46836/redbot/telegram/
[12:50:02] INFO: Starting NGinx...
23 Feb 12:50:02 - [info] [server:Home Assistant] WebSocket Connecting http://supervisor/core
23 Feb 12:50:02 - [error] [server:Home Assistant] Error: Invalid access token or password for websocket
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)
Expected behavior
(What you expected to happen)
Actual behavior
(What actually happened)
Steps to reproduce
(How can someone else make/see it happen)
Proposed changes
(If you have a proposed change, workaround or fix, describe the rationale behind it)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Node-Red keeps crashing at home assistant restart
Hi guys, Since a few days, my node-red is been having some problems. Whenever I restart home-assistant, it is not able to start...
Read more >Node-red no longer connecting to home assistant after reboot
I then tried restarting the Node-red add-on from hassio. After this restart, it seems like NR is no longer connecting to HA. All...
Read more >Getting Started | node-red-contrib-home-assistant-websocket
After deploying a green box with a status message, i.e. connected, stated_changed, should appear below the Events: all node. If you see an...
Read more >Basics: Connecting Home-Assistant to Node-red
The beauty of this, is that when Home-Assistant needs to be restarted Node-red can happily sit there working away in the background.
Read more >Node-RED won't listen for new events, after I restart Home ...
However, when I reboot Home Assistant, it no longer works. ... like I have to tell Node-RED that it has to connect to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The latest release should have automatically changed this for you, however will add something to the docs as a troubleshooting step. There is really nothing apart from that which can be done from the addon perspective (the challenge is around the changes to the node configuration).
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.