Home-assistant_v2.db corrupt after each reboot

Hi together,
I do have my homeassistant installed in a docker on my raspberry pi5 running on a SSD card.
I’m a bit lost - copilot as well doesn’t have a solution.
More or less after each reboot, home-assistant_v2.db is corrupt. I can delete it but homeassistant restores it in a corrupt way again. That’s the log:
13:54:58] INFO: Home Assistant Core finish process exit code 256
[13:54:58] INFO: Home Assistant Core finish process received signal 11
s6-linux-init-hpr: fatal: unable to talk to shutdownd: Operation not permitted
execlineb: fatal: unable to exec /package/admin/s6-linux-init/command/s6-linux-init-shutdownd: Exec format error
execlineb: fatal: unable to exec /package/admin/s6-linux-init/command/s6-linux-init-shutdownd: Exec format error
execlineb: fatal: unable to exec /package/admin/s6-linux-init/command/s6-linux-init-shutdownd: Exec format error
execlineb: fatal: unable to exec /package/admin/s6-linux-init/command/s6-linux-init-shutdownd: Exec format error
2025-10-28 13:55:02.284 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
2025-10-28 13:55:02.363 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=736 from 2025-10-28 12:54:37.880482)

Only solution so far ist removing homeassistant docker, create new and restore backup.
Why is homeassistant restoring a corrupt db?

Thanks for your time!

If you mean these two lines, these are warnings. I also get these on every restart and i just ignore them and home assistant is working normally. Do you have other symptoms that let you think that the database is corrupt?
(3 instances of HA in docker containers)

Hi Jürgen - yes - don’t miss these:
13:54:58] INFO: Home Assistant Core finish process exit code 256
[13:54:58] INFO: Home Assistant Core finish process received signal 11

It’s an endless loop and you can’t access the website - moreover the PI5 is running at roughly 50% CPU all the time

Try to find the reason for these messages. It is probably dependent on the installed linux distribution.

I think you are making a connection that do not really exist.
It looks like the DB is shutdown (with the standard warning about a clean shutdown), but something else made HA fail.
I do not run a Docker installation, so I am unsure of the requirements. Check if you are missing something, like a host network access or a system service.

nothing missing - when I stop homeassistant via docker stop homeassistant before shutdown/rebooting all is fine. Meanwhe I changed my PI5 to HAT M.2 SSD and I’m instaling a shutdown script that should stop homeassistant ( and others ) before shutdown/reboot/halt and I’m testing this service

unfortunately the script runs manually but not via shutdown/reboot/halt

I had this very early on when I had a docker installation (since moved to HAOS) and got warnings about the database not being shutdown cleanly, but add a

–stop-timeout 180

to your docker run command (or option when setting up the docker, or use the docker stop command) to increase the timeout see docker container stop | Docker Docs as mentioned in the docker documentation it defaults just to 10 seconds to allow it to shutdown cleanly. I increased it to 90 seconds but don’t think it takes that long to do it.

Test it to see if that stops that error from happening!

Alex

1 Like

Hi Alex - thanks - I do have already 90s break in it.
What finally helped was moving to M.2 SSD. This is fast enough to write and close everything before shutdown. but now - how wonder - I have another error in the logs:
execlineb: fatal: unable to exec /package/admin/s6-linux-init/command/s6-linux-init-shutdownd: Exec format error

Seems that something is missing:
alfred@raspberrypi5:~ $ docker run -it --rm Package home-assistant · GitHub sh
ls -l /package/admin/s6-linux-init/command/
=> shows nothing

I run docker and require no special command

History/recorder is hard on HDD/SD. I had this issue when running pi with SD. Eventually I disable recorder/history and only reenable after move back to x86/hdd.

DB never have issue for me even if pull power plug and bad shutdown.

Could you have hardware issue?

Hi, no - it’s the 3rd PI5 now.
I guess slow SSD created the problems. After moving to HAT M.2 SSD problem is gone - but now I do have an s6related prob.

Hi Alfred,

Unfortunately I don’t have the docker image to be able to check if I can see if that is the same. I take it the execlineb is from the home-assistant.log or from docker logs home-assistant?

Does your architecture match up as Exec format error seems to indicate that?

On the docker host try

uname -m

then check the docker image that is used

docker image inspect home-assistant/home-assistant --format=‘{{.Architecture}}’

the image name may need to be changed (e.g.

docker image ls

)

Hopefully you have aarch64 for the docker host and possibly the same in the docker image?

Hi Alex,

yes you’re right - logs are out of container “docker logs homeassistant”.
I tried a lot of things with the installation.
At the end I destroyed home assistant container completely, started from scratch and resored latest backup :slight_smile:
Since that time it’s running as expected - no issues at all.Thanks for your time!

1 Like