Error Connecting to external database

I have moved my installation to a new PI raspberry 4 .
This installation uses an external database Maria DB.
After a reboot of raspberry I am getting an error in the log file
Thu Dec 05 2019 12:38:49 GMT+0200 (GMT+02:00)

Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, “Can’t connect to MySQL server on ‘192.168.10.105’ (101)”) (Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)

Then, it connects successfully. This only happens after I reboot raspberry but not when I restart only home assistant.

Any thoughts?

arch armv7l
dev false
docker false
hassio false
os_name Linux
python_version 3.7.3
timezone Europe/Nicosia
version 0.102.3
virtualenv true

Lovelace

mode auto-gen

The mysql Server is on the same machine as the HA installation? Then the mysql server is not fully loaded, when HA tries to establish a connection. Nothing to worry about, HA should try it a few seconds later, and if the server is running, it will automatically connect.

Edit: if you restart HA, you only start the docker container again, not the PI. That’s why your mysql server is not affected by a HA restart. :slight_smile:

The mysql server is on a NAS which is on a different machine. It is always running since there are other databases running. My installation is in a virtual environment not in a docker(can be seen in my initial post)
My service that starts home assistant
Description=Home Assistant
After=network-online.target
[email protected]

[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c “/home/homeassistant/.homeassistant”

[Install]
WantedBy=multi-user.target

Oops, sorry, should have read more thoroughly. :slight_smile:

On one of our servers at work we have

Wants=network-online.target
After=network.target network-online.target

I’ll try to catch our network admin, maybe he can/is interested enough to explain to me why… :wink:

Just want to let you know that with the same setup on my previous raspberry I was not facing any issue with the auto start of the Home Assistant.
The only difference was the hardware old pi raspberry and the python version was 3.6.5