Home Assistant automatic restart for API call error?

Updated to these versions and it is still very very stable

  • Core 2024.2.2
  • Supervisor 2024.01.1
  • Operating System 11.5
  • Frontend 20240207.1
    Very happy…
    I hope it will continue like this…

sometimes I only see these … but the system is not restarting so frequently as in the past

Login attempt or request with invalid authentication from supervisor (172.30.32.2). Requested URL: ‘/api/core/state’. (HomeAssistantSupervisor/2024.01.1 aiohttp/3.9.3 Python/3.12)

and

24-02-19 09:42:38 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
24-02-19 09:50:15 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call https://172.30.32.1:8123/api/core/state.

I have a similiar problem as you guys facing. It got worse when I played around with dashboards today. I was creating and modifying a markdown template dashboard item, where I looped over something like this

{{ 
  expand(states.sensor) 
  |selectattr('state', 'eq', 'unavailable') 
  |map(attribute='entity_id')
  | join('\n') 
}}

when I saw the UI freeze and the supervisor log saying

24-02-25 16:23:04 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.

So I guess for the state something is wrong which makes it freeze. I try to fix it now by deleting the part in the dashboard.

I recently had the same issue and the root cause CALDav integration connected to an icloud email. Removing that fixed everything

In my case… it is happening again a frequent reboot (:-() and it seems it’s caused by core_mosquitto…
I already had in the past this feeling (that core mosquitt was the cause of reboot) but then with latest updates it did not create any problem…
Now it started again…

24-03-01 10:54:37 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call https://172.30.32.1:8123/api/core/state.
24-03-01 10:54:42 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call https://172.30.32.1:8123/api/core/state.
24-03-01 10:54:43 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missed an Home Assistant Core API response.
24-03-01 10:55:33 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with core_mosquitto application!
24-03-01 10:55:45 INFO (SyncWorker_7) [supervisor.docker.manager] Stopping addon_core_mosquitto application
24-03-01 10:56:24 INFO (SyncWorker_7) [supervisor.docker.manager] Cleaning addon_core_mosquitto application
24-03-01 10:56:47 ERROR (MainThread) [supervisor.misc.tasks] Watchdog missed 2 Home Assistant Core API responses in a row. Restarting Home Assistant Core API!

@spanzetta Hai risolto? Io non ne riesco a venire a capo da settimane ormai.
I miei problemi iniziano quando avvio Node-red (che utilizza core-mosquitto). Ma se uso solo core-mosquitto (per un altro add-on che ne fa uso) non ho di questi errori.

Purtroppo la situazione è estremamente variabile… e non credo avra’ mai una soluzione definitiva.

Ad ogni aggiornamento la situazione può migliorare o peggiorare … e quando sembra stabile (es dopo update Core a 2024.3) poi magari ad un certo punto senza motivo inizia a non rispondere piu e inizia a fare reboot uno dietro l’altro… poi magari torna ad essere stabile…(mi e’ successo proprio ieri, e non era la prima volta).

Dai log l’unica cosa che ho notato è che i due add-on che piu di altri sembrano provocare i blocchi (e quindi i reboot dovuti al watchdog) sono Core Mosquitto (che pero mi serve per cui e’ ON) e File Editor (che tengo spento e accendo solo se serve)…

Ma può anche essere fuorviante… che i problemi sono causati da altro… difficile scoprirlo…

Sino ad un riavvio ogni uno/due giorni lo considero normale (per un RPI con 512Mb di Ram) … quando si riavvia 10 volte in due ore anche no…

Io non ho node-red…

Novità di qualche giorno fa (e successo di nuovo oggi) e che dopo restart vedo che la memoria utilizzata è intorno al 75% invece che 85/88% che sono i valori soliti…
Quando accade ciò è ancora più instabile … e si riavvia… non si capisce come mai ha un utilizzo di memoria inferiore… ma è più instabile…
Solo dopo ulteriori riavvi… la situazione diventa “normale” con utilizzo di memoria del 85/88%…
Misteri!!

@spanzetta Please remember the HA community is English only

(Recuerde que la comunidad HA solo está disponible en inglés.)

Yes… sorry…

1 Like

No worries we just want everyone to be able to understand the answer :joy:

The problem is still there … at least on my “poor” Raspberry PI3A+…

I noticed that after 2 timeout error on call (api/core/state) the watchdog restart HomeAssistant…

Maybe it would be appropriate to change the values of either timeout (maybe it’s too short) or Max attempts (in supervisor code) … in order to give “more time” to react and eventually avoid all of these HA restart which may not be necessary…

I understand that from a developer point of view everything should react as in theory should be (on enough powerfull HW) but givin the fact that there are many “small HW” that maybe are much slower… giving the options to “accept” some slower reaction to avoid useless restart could be a good idea…

Maybe these values can be configurable with UI (so who has slower HW can better tune these values accepting that system will react slowly

  • “TimeoutError” in supervisor/supervisor/homeassistant/api.py
  • “ASS_WATCHDOG_MAX_API_ATTEMPTS” (currently = 2) in supervisor/supervisor/misc/tasks.py

What do you think about?

After several months I fixed it by replacing my Rpi4 with an Intel Mini Pc and a backup of my HaOS instance. No more freeze or error in supervisor logs.

That is the proof that the problems we are talking about affects only Raspberry… so developers should try to fix since there are tons of HA instance running on Raspberry (all variations)

That’s right, I’ve been saying for months that the problem was in recent updates and some incompatibility with raspberry.

Nope…i am in the same boat and i have an Intel NUC8, with a core I5, X86 system and i have several reboot when i am on Esphome dashboard.

And the bad thing is now i cant open 2 differentes nodes config in a 2 differents browser (firefox + chrome) because i cant save anymore my nodes after changes…

If i close the chrome browser, “file save” appear immédiately in Firefox…really strange…seems something is blocked in a browser when an other is open…and i have a lot of :

2024-07-06 11:01:58.054 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:01:58.055 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:02:28.038 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:02:28.041 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:02:58.049 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:02:58.050 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:03:28.047 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:03:28.048 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:03:58.053 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:03:58.057 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:04:28.050 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:04:28.052 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:04:58.058 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:04:58.059 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:05:28.053 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
2024-07-06 11:05:28.059 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None

and after…restart of ha because of watchdog error :

2024-07-06 11:29:28.845 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.

i try ha core rebuild doesnt work better

Ok but this looks a different situation…

What we was describing here is a problem caused by

ERROR (MainThread) [supervisor.homeassistant.api] Error on call https://172.30.32.1:8123/api/core/state

And then the watchdog restart HA …

yes i read all post, and i have this same error too, then ha restart

the error is in my previous post just above, last line

i try ha supervisor repair seems to be better… will see in the couple next hours…

If it happens also on X86/NUC it is even worst…

I wonder how developers didn’t find a solution after so long… (well… some builds in the past apparently fixed it but then it did come again)

1 Like

Hello,
some news on my side,

i have take a look to home-assistant.log and just before the restart, there is a problem with HASS-AGENT.

Dont know if you use it in your config but i am using it.

In the Github repo issues, i saw a bunch of guys that encounter the same problem, its related to the old version, need to delete the integrations in HA, then the custom component HASS-AGENT in HACS, then add the new repo to HACS, install and do integration of my 4 Pcs.

repo: https://github.com/hass-agent/HASS.Agent-Integration

more info : https://github.com/LAB02-Research/HASS.Agent-Integration?tab=readme-ov-file

the new version is HASS-Agent2, i dont even know there is a new version…my bad.

Errors and Restarts about watchdog complaining have gone…for now :wink:

If it can help others…

EDIT : perhaps its another custom_component for others, but sure now its not related to the hardware side :wink: