Node Red can't connect to HA after restoring a backup

Hey there,
I’ve migrated off a RPi over to a VM (in Unraid – followed the procedure at Linux - Home Assistant – so both are HA OS). Everything is working just fine, except for Node Red, which I can’t make connect to HA properly.

HA logs are uninterresting: HA logs · GitHub
Node Red ones: Node Red logs · GitHub

The only interresting line might be the “13 Dec 11:32:48 - [warn] Encrypted credentials not found”

I have tried deleting the Add on and reinstalling it (without wiping the data directory), but it didn’t solve the issue. I put something random in “credential_secret”, hoping it would re-do the connection or something, but that didn’t work either.

I still have the RPi and backups if needed, but would appreciate not having to reinstall/restore the whole VM over again. It is stuck in a loop with “[info] [server:Home Assistant] Connecting to http://supervisor/core

NB1: It also lost connection to Core Mosquitto when I changed the credential_secret, but I restored that easily

NB2: Yes, I need to remove that rpi_power crap as well, but that’s hopefully unrelated

I’ve tried debugging directly from within the container, the problem really seem to be about authentication between them, but I’ve no idea how to fix it from there:

➜  ~ docker exec -it 59284e0e4b32 bash
root@a0d7b954-nodered:/opt$ ping supervisor
PING supervisor (172.30.32.2): 56 data bytes
64 bytes from 172.30.32.2: seq=0 ttl=64 time=0.045 ms
64 bytes from 172.30.32.2: seq=1 ttl=64 time=0.036 ms
^C
--- supervisor ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.036/0.040/0.045 ms
root@a0d7b954-nodered:/opt$ curl "http://supervisor/core"
401: Unauthorized

I’ve even tried to setup a connection without going the “Using Home Assistant Add On” way and adding a token on my user (for debug), but when saving in Node Red I’m welcome with a naughty “Invalid format of Base URL: http://supervisor/core

Hi, did you setup/re-create the access token from within the server connection in NR?

Could you elaborate? I might be missing something stupid. If you look at the screenshot I posted, there is no “access token” option when the “Using the Home Assistant Add-on” is checked – but maybe then it’s moved somewhere else or something?

Ok, I see that you’re using the add-on, I think if you have that you don’t need to add in a key. Mine is setup using a key, so it’s different. No reason why you can’t test it though. A few methods posted here:

Maybe these will help.

Thanks – It does indeed work if I setup the connection with a token using the public IP of the server – but still, I don’t understand why I have this problem in the first place, and I’d like to move back to the standard way of connecting for Add ons.

I’m inspecting a backup, and I see in addon.json and “access_token” entry and a “ingress_token” – I guess those got changed with the reinstall. But there is no way to access or edit those AFAIK, except maybe by going through the SSH to HA route.

I just tried deleting this completely including the add ons data, since I can restore my flows from the backup anyway, and noticed this:

So… I guess it was some permission issue somewhere. I went the hard way, redownloaded the image and restored the backup again, and this time I didn’t have the problem surface again. Quite annoying not to know what was the problem in the first place, but I’m glad my system is now working properly :confused: