Upgrade to 2022.2.1 "The system cannot restart while a database upgrade is in progress"

Hi All

I did the upgrade and after 3 days I still couldnt do a re-boot without this message:

“The system cannot restart while a database upgrade is in progress”

I am using the Maria DB integration and when I looked in the log files there I could see this:

[17:46:29] INFO: Ensuring internal database upgrades are performed
This installation of MariaDB is already upgraded to 10.4.19-MariaDB, use --force if you still need to run mysql_upgrade

So I decided to just restart the Maria DB and then I was able to re-boot the HA!
But after the reboot I am back to the same problem I cant do a reboot of HA

So is there a way to just delete the Maria DB and restart HA?
Or some command I can run to force this DB upgrade?

Also found this in the logs:
22-02-04 17:46:27 WARNING (SyncWorker_3) [supervisor.docker.interface] Can’t grep logs from homeassistant/amd64-addon-mariadb: 409 Client Error for http+docker://localhost/v1.41/containers/d73c50807de26067003f9f4029161aad5cffb553b1fba56d55c992e1fcc455aa/logs?stderr=1&stdout=1&timestamps=0&follow=0&tail=100: Conflict (“can not get logs from container which is dead or marked for removal”)

Before using MariaDB I would just have deleted the local HA DB…

For anyone else: I ended up removing the Maria DB installation and re-installed it again…

I ended up having the same issue.
Thanks for posting your steps to resolve this.
Removing and re-adding MariaDB at least got me past this upgrading DB roadblock.

I’m having the same issue. Where did you perform this ? On the console ?

I did it here: HomeAssistant Web Interface → Configuration → Ad-Ons

Ok thank you. I did not have Maria DB installed. I did install it changed config and removed the old db and restarted the server. Looks ok now

My situation is similar.

  1. What changes did you make to Maria DB config?
  2. How did you remove old DB?
    TIA

I found answers to my question here:

  1. Fixing Home Assistant DataBase Problems With MariaDB Addon
  2. How do I delete the database on home assistant

But I did not really need 1) to fix problem.
I just needed following shell commands from 2):

ha core stop
rm /config/home-assistant_v2.db
ha core start

Yeah. I just went to file editor and deleted it there and restarted.

Of course.
That is the way to go, if you aren’t comfortable running a shell :+1:

Yep. Although I am quite familiar with Unix and shell this is the easy way. Ssh not putting me in a regular shell makes me uneasy.

Hello,

i have the same Problem after the upgrade to 2023.2.1

is there another solution to fix this problem, i would dont like delete my mariadb, i would dont loose my history and GPS Data from Traccar.

thank you

2023.2 contains a breaking change related to MariaDB version.

It is in the release notes:

Hello,

i know, i have forget it to upgrade the maria DB before HA upgrade.

my maria DB is now running on latest version,

i think its fixed after delete home-assistant_v2.db and 2 restarts of the HA core