HA Core won't start at boot, but does manually

Hi,
I’ve HA core installed on a raspberry PI with Raspbian.
I followed instructions here: Autostart using systemd using the Pyhton virtual environment.
My problem is that when I start manually the service like this:
sudo systemctl restart home-assistant@homeassistant
HA starts
When I reboot the Raspberry, HA gives me error 403 and in the log I see

hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of analytics. Setup failed for dependencies: api, websocket_api
hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Setup failed for analytics: Could not set up all dependencies.
hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of cloud. Setup failed for dependencies: http, webhook
hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Setup failed for cloud: Could not set up all dependencies.
hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: analytics, auth, http, person
hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: api, auth, config, http, onboarding, search, system_log, w>
hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of safe_mode. Setup failed for dependencies: frontend, cloud
hass[383]: 2021-12-21 15:17:22 ERROR (MainThread) [homeassistant.setup] Setup failed for safe_mode: Could not set up all dependencies.

Then, again, if I start it manually with
sudo systemctl disable home-assistant@homeassistant
the UI starts

That disables the service, not starts it

However, you need to check the log file for HA and fix the problems. The other, probably easier, option would be to move to using Docker and the Container install method.

Sorry, bad cut/past. Edited.

This is the log I get when starting during boot

2021-12-31 20:17:19 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //home/homeassistant/.homeassistant/home-assistant_v2.db was shutdown cleanly
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Error during setup of component http
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/setup.py", line 229, in _async_setup_component
    result = await task
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/__init__.py", line 192, in async_setup
    local_ip = await async_get_source_ip(hass)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/network/__init__.py", line 35, in async_get_source_ip
    return source_ip if source_ip in all_ipv4s else all_ipv4s[0]
IndexError: list index out of range
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of system_log. Setup failed for dependencies: http
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for system_log: Could not set up all dependencies.
2021-12-31 20:17:19 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=30 from 2021-12-31 22:17:18.709964)
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of api. Setup failed for dependencies: http
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for api: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of webhook. Setup failed for dependencies: http
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for webhook: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of auth. Setup failed for dependencies: http
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for auth: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of config. Setup failed for dependencies: http
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for config: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of image. Setup failed for dependencies: http
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for image: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of websocket_api. Setup failed for dependencies: http
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for websocket_api: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of cloud. Setup failed for dependencies: http, webhook
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for cloud: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of person. Setup failed for dependencies: image
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for person: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of analytics. Setup failed for dependencies: api, websocket_api
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for analytics: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of search. Setup failed for dependencies: websocket_api
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for search: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: analytics, auth, http, person
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: api, auth, config, http, onboarding, search, system_log, websocket_api
2021-12-31 20:17:19 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
2

I am getting the same, did you find a solution?

Not yet… :frowning:

This worked for me.

1 Like

I have the same problem. Even adding After=network-online.target Wants=network-online.target did not resolve the issue.

Delaying the start of HA with ExecStartPre=/bin/sleep 20 right at the beginning of the [service] section in [email protected] worked, but slows down the boot up and feels a bit like a workaround. (solution found here: Help with HA service startup delay (Debian) - #3 by sfnetwork)

Would be nice to find out on which service HA is reliant to start correctly, so that we could add it in the [unit] section as primary.