Login failed to Node-RED

I think I am struggling with the same error.

I have read the FAQ, and I have deleted my user setup, and set ssl to false (Got the key cert error)
But I still see this about Token in the logs?

The solution to this is simple:

  • Click on one of the Home Assistant nodes in your flow.
  • Click on the little edit button, next to the server name.
  • Change the URL to: http://hassio/homeassistant .
  • Save it, and deploy your flow!
  • Now the add-on handles the authentication for you.

5 Nov 20:50:55 - [error] [server:Home Assistant] Error: Invalid access token or password.

Should I delete the Token listed under the URL URL to: http://hassio/homeassistant ?

I keep getting this after login to Node reed
Error: Invalid access token or password.

@Kermit can you tell me why I get this after updating? and if the solution is to use Legacy API password?

image

Should I enable:
Use Legacy API Password X ? under server for HA in Node Reed?

No, you don’t need to enable Legacy API password. Can you take a screengrab of the server config window?

Things to check:

  1. Go to Hamburger Icon -> Configuration Nodes. Make sure you don’t have any server nodes there that are not in use or grayed out. Delete if you have them.

  2. If you are already using http://hassio/homeassistant as your base URL and you are still getting a token error, restart Hass.io – it should regenerate a token and fix the problem.

@rsuplido @Kermit I dont have any server nodes there are not used
these are in use but looks grayed out?

image

Should the MQTT server link also now be replaced with the new hassio http link?

Thanks my server configuration is like this
(I have tried to delete the token and reboot but its repopulated with the same token again.)
The only way sofar has been to activate Legacy API password that stops the token errors

image

Again thanks for helping me out I have been struggling with this for some time now

I don’t see anything wrong with your server config. I just released v0.2.0 and I’m sure that they’ll be updating the community node-red hass.io addon in short order. Give that a try when it’s released and see if it fixes your problems.

… and any love or guidance for those of us NOT using hass.io? Is Node-RED just basically broken on Hassbian for now? Virtually every single update I’ve seen has been for hass.io, which I ain’t got.

If it’s broken or in the works, that’s cool - I’ll let you guys do you thing. I just need to know so I can stop bashing my head against the wall until it’s fixed.

1 Like

What’s not working for you?

Bah, you name it. I’m just finishing up swapping my (unfinished) setup to Hass.io, since that feels like where a lot of the energy is right now. I was on Hassbian yesterday. There’s about three different techniques and methods to installing Node-RED on Hassbian and I couldn’t get a single one of them to connect to my HA instance. I searched and Googled and Bing-ed until I went nuts, trying to find out what kind of authentication we’re supposed to need. Some mysterious api: entry in configuration.yaml? Some kind of hashed token from node-red itself? Our usual HA password? Every single one of them got me the "cannot GET Homeassistant " message from a server node.

Meanwhile, I hear the modular-install Hass.io version has gone 1.0 (over 1.0 by now) and people are running it with big smiles.

I’m just frustrated, that’s all. This is a great project but I’ve had a really lousy last few weeks in the real world. Burnout happens.

Hi All,

Can someone guide me on how to get back into Node-Red? Prior to big update, I had a user that worked. Now I have uninstalled, re-installed, and tried multiple config from Add-in but I still cannot login.

I have also tried putting in a defined user for http_node and http_static, but to no avail.

### From Add-in Config ###
{
  "log_level": "info",
  "credential_secret": "biglongsecret",
  "http_node": {
    "username": "",
    "password": ""
  },
  "http_static": {
    "username": "",
    "password": ""
  },
  "port": 1880,
  "ssl": false,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "require_ssl": true,
  "system_packages": [],
  "npm_packages": [],
  "init_commands": []
}


### Log
[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 v1.1.0
 Flow-based programming for the Internet of Things
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 armhf / Resin OS 2.3.0+rev1 / HA 0.82.0 / SU 139 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 20-config.sh: executing... 
[cont-init.d] 20-config.sh: exited 0.
[cont-init.d] 80-system-packages.sh: executing... 
[cont-init.d] 80-system-packages.sh: exited 0.
[cont-init.d] 81-npm-packages.sh: executing... 
[cont-init.d] 81-npm-packages.sh: exited 0.
[cont-init.d] 82-user-scripts.sh: executing... 
[cont-init.d] 82-user-scripts.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
> hassio-addon-node-red@ start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
15 Nov 11:37:41 - [info] 
Welcome to Node-RED
===================
15 Nov 11:37:41 - [info] Node-RED version: v0.19.5
15 Nov 11:37:41 - [info] Node.js  version: v8.12.0
15 Nov 11:37:41 - [info] Linux 4.4.50 arm LE
15 Nov 11:37:43 - [info] Loading palette nodes

Thanks in Advance,
~Bryan

So, took a little-bit more of a dramatic approach. Removed Node-Red add-in, deleted /config/node-red directory, reinstalled via instructions, but to no avail. My config is using :
auth_providers:
- type: homeassistant
- type: legacy_api_password
But I still get prompted for userid/password, and login always fails.

Banging my head against the wall!

~Bryan

SOLVED: Deleted \hassio\config.storage directory, restarted and it gets automatically recreated. Puts you into new onboarding routine. Below article helped me.

https://community.home-assistant.io/t/solved-unable-to-create-user-with-new-auth-system/61200/2

Are you using your Home Assistant username and password to login into Node-RED?

I’m logging in with my HA credentials, yes.

In the terminal, after I start node-red (don’t have it set up as a service yet), I see the following:

15 Nov 22:48:58 - [error] [server:Home Assistant] Error: Invalid access token or password.
15 Nov 22:50:06 - [info] Stopping flows
15 Nov 22:50:06 - [info] Stopped flows
15 Nov 22:50:06 - [info] Starting flows
15 Nov 22:50:06 - [info] Started flows
15 Nov 22:50:06 - [error] [server:Home Assistant] Error: Invalid access token or password.

I generated an access token from the directions on this page: https://nodered.org/docs/security.html

I got a result like this…

$2a$08$jx6P6zexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

And I put it in the proper place in the settings.js file. Now that block of settings.js looks like this:

adminAuth: {
        type: "credentials",
        users: [{
            username: "bundito",
            password: "$2a$08$jx6P6ze/gxdBi/8VNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            permissions: "*"
        }]
    },

I put that same $2a$08$jx6P6ze/gxdBi/8VN2yCxxxxxxxxxxxxxxxxxxxxxxxxxxxx in the first HomeAssistant node I placed::

Screenshot_20181115_170008

And the log dumped to the terminal still says invalid token.

What I seem to be missing is something that connects Node-RED and my HA server. And for the love of god, I can’t figure out what it is.

Halp!

You have the generated password of the Node-RED settings correct. The Access Token in the Home Assistant node is incorrect. The token that goes there is the one you generate inside Home Assistant from here.

I am using legacy API – so never really created a user. Just tried creating a user and got “unauthorized.”

Thank you for guiding me down that path.

Looks like my reply didn’t go through:

ALL HAIL THE LONG-LIVED ACCESS TOKEN!

It works perfectly now. Thanks, Kermit.

Now I just have to figure out the BigTimer difference between “dawn” and “sunrise”; and “dusk” and “sunset” so I can get my timers programmed appropriately.

One of the things I’m still trying to sort out is how to send input into Node-RED. Also how fast it is, compared to a YAML automation. But that’s another topic.

U probably saved me from a looong looong night. thanx mate!

Thank You, It´s great!

You a Genius !!! TKS.

Man… +1. Thanks… Now I feel dumb