RPi 4, HA Docker + Supervisor on RPi OS => Can't update Home Assistant access token! / Login attempt or request with invalid authentication

Hello,
I am trying to add the Supervisor to a HA docker install in RPi OS. The symptoms are every 5 seconds:

journalctl:

[supervisor.homeassistant.api] Can't update Home Assistant access token!

HA logs:

[homeassistant.components.http.ban] Login attempt or request with invalid authentication from 172.30.32.2 (172.30.32.2). Requested URL: '/auth/token'. (HomeAssistantSupervisor/2022.09.1 aiohttp/3.8.1 Python/3.10)

I’ve read tons of posts but can’t figure where my issue is. I had Zigbee2MqTT running in a docker and stopped it. I’ve removed the deCONZ USB stick and rebooted, still the same.

At boot a lot seems to be working, it even restarts the HA container:

Sep 24 10:34:06 pi 27369895b6b3[791]: 22-09-24 10:34:06 ERROR (MainThread) [supervisor.homeassistant.api] Can't update Home Assistant access token!
Sep 24 10:34:06 pi 27369895b6b3[791]: 22-09-24 10:34:06 WARNING (MainThread) [supervisor.misc.tasks] Watchdog miss API response from Home Assistant
Sep 24 10:36:06 pi 27369895b6b3[791]: 22-09-24 10:36:06 ERROR (MainThread) [supervisor.homeassistant.api] Can't update Home Assistant access token!
Sep 24 10:36:06 pi 27369895b6b3[791]: 22-09-24 10:36:06 ERROR (MainThread) [supervisor.misc.tasks] Watchdog found a problem with Home Assistant API!
Sep 24 10:36:06 pi 27369895b6b3[791]: 22-09-24 10:36:06 INFO (SyncWorker_0) [supervisor.docker.interface] Restarting ghcr.io/home-assistant/raspberrypi4-64-homeassistant

Very early it shows:

[supervisor.homeassistant.secrets] Loaded 0 Home Assistant secrets

Do I need to set an API secret for the Supervisor?

I have followed the requirements and instructions. I’ve fixed the AppAmor start with:
add apparmor=1 security=apparmor to /boot/cmdline.txt

My running dockers:

dennis@pi:~ $ sudo docker ps
CONTAINER ID   IMAGE                                                       COMMAND   CREATED         STATUS         PORTS                                   NAMES
aeaca45c2eb3   ghcr.io/home-assistant/aarch64-hassio-multicast:2022.02.0   "/init"   7 minutes ago   Up 7 minutes                                           hassio_multicast
07465de06f33   ghcr.io/home-assistant/aarch64-hassio-audio:2022.07.0       "/init"   7 minutes ago   Up 7 minutes                                           hassio_audio
150b7eabb174   ghcr.io/home-assistant/aarch64-hassio-dns:2022.04.1         "/init"   7 minutes ago   Up 7 minutes                                           hassio_dns
b92f5bddba8a   ghcr.io/home-assistant/aarch64-hassio-cli:2022.08.0         "/init"   7 minutes ago   Up 7 minutes                                           hassio_cli
27369895b6b3   ghcr.io/home-assistant/aarch64-hassio-supervisor:latest     "/init"   15 hours ago    Up 7 minutes                                           hassio_supervisor
779734a052b2   ghcr.io/home-assistant/aarch64-hassio-observer:2021.10.0    "/init"   15 hours ago    Up 8 minutes   0.0.0.0:4357->80/tcp, :::4357->80/tcp   hassio_observer
611b6b939151   ghcr.io/home-assistant/home-assistant:stable                "/init"   10 days ago     Up 2 minutes                                           homeassistant

The ERRORs and WARNINGS of the Supervisor:

dennis@pi:~ $ journalctl -n 2000 | grep 27369895b6b3| egrep " ERROR|WARNING"
Sep 24 11:43:10 pi 27369895b6b3[798]: 22-09-24 11:43:10 WARNING (MainThread) [supervisor.dbus.manager] Can't load dbus interface de.pengutronix.rauc: The name de.pengutronix.rauc was not provided by any .service files
6* Sep 24 11:43:34 pi 27369895b6b3[798]: 22-09-24 11:43:34 ERROR (MainThread)  [supervisor.homeassistant.api] Can't update Home Assistant access token!
Sep 24 11:43:39 pi 27369895b6b3[798]: 22-09-24 11:43:39 WARNING (MainThread) [supervisor.resolution.evaluations.base] Found unsupported images: {'ghcr.io/home-assistant/home-assistant'} (more-info: https://www.home-assistant.io/more-info/unsupported/software)

The dbus interface warning seems to be ok, as it states afterwards:

Sep 24 11:43:10 pi 27369895b6b3[798]: 22-09-24 11:43:10 INFO (MainThread) [supervisor.dbus.manager] Load dbus interface org.freedesktop.resolve1

I am confused about the image warning. My images are:

dennis@pi:~ $ sudo docker images
REPOSITORY                                         TAG         IMAGE ID       CREATED         SIZE
ghcr.io/home-assistant/aarch64-hassio-supervisor   2022.09.1   dc573062d824   7 days ago      365MB
ghcr.io/home-assistant/aarch64-hassio-supervisor   latest      dc573062d824   7 days ago      365MB
ghcr.io/home-assistant/home-assistant              stable      f972d82f68a8   12 days ago     1.42GB
koenkk/zigbee2mqtt                                 latest      1edccc9ae9a6   3 weeks ago     214MB
ghcr.io/home-assistant/aarch64-hassio-cli          2022.08.0   33c6f4a8e64f   3 weeks ago     116MB
eclipse-mosquitto                                  2.0         ad57ad0879c7   5 weeks ago     11.6MB
ghcr.io/home-assistant/aarch64-hassio-audio        2022.07.0   c4435f74fa3c   7 weeks ago     152MB
ghcr.io/home-assistant/aarch64-hassio-dns          2022.04.1   362b749494ab   5 months ago    96.7MB
ghcr.io/home-assistant/aarch64-hassio-multicast    2022.02.0   3ce91958464c   7 months ago    81.5MB
ghcr.io/home-assistant/aarch64-hassio-observer     2021.10.0   9c3593efc7e1   11 months ago   89.2MB

Very early it states:

Sep 24 11:43:10 pi 27369895b6b3[798]: 22-09-24 11:43:10 INFO (SyncWorker_0) [supervisor.docker.supervisor] Attaching to Supervisor ghcr.io/home-assistant/aarch64-hassio-supervisor with version 2022.09.1

The observer shows:
image

Every help and pointer is much appreciated. I’ve been struggling through this for days :wink: I like to add the Supervisor to have a stable setup, and add addons like MariaDB, InfluxDB, SSH Terminal.

I’ve installed os-agent_1.4.0_linux_aarch64.deb and homeassistant-supervised 1.2.2

I’ve installed portainer now as well, if that helps :wink:

Is this a fresh install or an update that broke something on a previously working system?

Which guide did you follow?

Any of that useful?

Can’t say I have much else to offer, I haven’t bumped into this before

1 Like

@HasQT thanks for your swift response. It’s pretty much a new install. I’ve started a couple few month ago with the HAOS, then went to RPi OS with HA as container. I’ve added Zigbee2Mqtt, wich is disabled now. Then I wanted to add the Supervisor, to get a proper setup with MariaDB, Influx and the stability of the Supervisor. I’ll read the article and come back soon …

thank you, I found that suggestion somewhere else before and I don’t seem to have the ip_bans file:

dennis@pi:/opt/homeassistant/config $ ls -R | grep -i ban
dennis@pi:/opt/homeassistant/config $

@HasQT I’ve used this guide

I usually follow this basically when I do a fresh install. I haven’t done a fresh install for a while though.

couple of missing notes from that guide

  • os-agent is 1.4.0 atm

  • my cmdline.txt has a couple of additions beyond the apparmor

    cat /boot/cmdline.txt
    console=serial0,115200 console=tty1 root=PARTUUID=89a15c5a-02 rootfstype=ext4 
    elevator=deadline fsck.repair=yes systemd.unified_cgroup_hierarchy=false 
    systemd.legacy_systemd_cgroup_controller=false apparmor=1 security=apparmor rootwait
    
  • You may need to check how you installed docker.
    sudo usermod -aG docker pi might be needed.

1 Like

@HasQT thank you for the more info. My docker install might be an issue. I don’t have a pi user, I assume I can just use dennis?

1 Like

yeah pi = your user

1 Like

check connection solution - @BebeMischa

SSH to the HA server

sudo nano /etc/NetworkManager/NetworkManager.conf

add this to the file:

[connectivity]
uri=http://checkonline.home-assistant.io/online.txt
interval=600

Save and exit the file.

run:

busctl set-property org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager ConnectivityCheckEnabled b true

reboot the server

Ahh You will perhaps hit this too.

1 Like

Awesomest, tthanks a lot, I will try it soon, I started a Backup for a reload, but that would be just awesomest :wink:

1 Like