Login failed to Node-RED

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

Hi all

I’m also encountering this issue.

I’ve uninstalled, deleted the config/node-red and config/.storage folders completely, restarted hassio, reinstalled Node-Red addon, but I keep getting Login Failed.

{
  "log_level": "info",
  "credential_secret": "xxxxxxxxxxxxxxx",
  "http_node": {
    "username": "user",
    "password": "pass"
  },
  "http_static": {
    "username": "user",
    "password": "pass"
  },
  "port": 1880,
  "ssl": false,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "require_ssl": false,
  "system_packages": [],
  "npm_packages": [],
  "init_commands": [
    "echo 'This is a test'",
    "echo 'So is this...'"
  ]
} 

This is what I get from log after trying to login three times:

Welcome to Node-RED
===================
17 Jan 09:22:11 - [info] Node-RED version: v0.19.5
17 Jan 09:22:11 - [info] Node.js  version: v8.14.0
17 Jan 09:22:11 - [info] Linux 4.14.81-v7 arm LE
17 Jan 09:22:12 - [info] Loading palette nodes
17 Jan 09:22:22 - [info] Settings file  : /etc/node-red/config.js
17 Jan 09:22:22 - [info] Context store  : 'default' [module=memory]
17 Jan 09:22:22 - [info] User directory : /config/node-red/
17 Jan 09:22:22 - [warn] Projects disabled : editorTheme.projects.enabled=false
17 Jan 09:22:22 - [info] Flows file     : /config/node-red/flows.json
17 Jan 09:22:22 - [info] Starting flows
17 Jan 09:22:22 - [info] Started flows
17 Jan 09:22:22 - [info] Server now running at http://127.0.0.1:1880/
17 Jan 09:22:23 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant
17 Jan 09:22:42 - HA Auth - Failed to authenticate: vittorio
17 Jan 09:23:12 - HA Auth - Failed to authenticate: vittorio
17 Jan 09:23:24 - HA Auth - Failed to authenticate: vittorio

Any suggestion?

Thanks

PS:
Solved
Now I have to use the Hassio credentials rather than the one defined in the Addon config.
It’s confusing the fact that there are still user/pass definition that is not going to be used…

1 Like

Hi,

I am unsure about my solution and I fail to login.

I have read the notes to the update and my node red config is:

 {
   "log_level": "info",
   "credential_secret": "redacted",
   "http_node": {
     "username": "",
     "password": ""
   },
   "http_static": {
     "username": "",
     "password": ""
   },
   "port": 1880,
   "ssl": true,
   "certfile": "fullchain.pem",
   "keyfile": "privkey.pem",
   "require_ssl": true,
   "system_packages": [],
   "npm_packages": [],
   "init_commands": []
 }

I restart node red.

I have reset my login after deleting the files auth, auth_provider.homeassistant and onboarding. Thereafter I restart

I reset by entering a new user name and password.

I try to login to node red using this user name and password.

The result is login failed.

What is my mistake?

How did you solve this? I am still stuck. See my post.

The login credentials are the HA credentials, not the one you can write in the Node-RED config.

Have you tried like this?