Home assistant repeatedly crashing

I have had a new problem with my HA over the last week and a bit. My HA runs in a Virtual Box on Ubuntu 22.04 on a pc. Over the last week it crashed 3 times - a week ago, two days ago and today. When it crashes it becomes unavailable and I have to force shutdown the virtual box instance and restart it (i.e. it doesn’t respond to ACPI Shutdown). Every time there is a lot of output on the cli window which I can’t make sense of but I think it is the same output every time. There is nothing in the logs (downloading the logs and viewing via journalctl), the log just stops and then starts again with the new boot. I took a snapshot of the cli because I can’t copy/paste from it:

Any idea what is happening? Any way of capturing the cli output to see earlier messages?

Sure does not look good. I would create a new vm and restore a backup.

As you just found out, the logs get overwritten on each restart. However, HA does save a log from before the restart. It’ll be located in the HA config folder and named as home-assistant.log.1.

Try finding that log and having a look through (probably towards the end of the file), in case something jumps out.

Thanks. Crash happened again overnight. I have already tried that but for some reason my backup doesn’t restore well - despite being a full backup it only restores my add-ons and doesn’t restore anything else - automation, devices, frontend, etc. I tried a new VM on VirtualBox and on KVM and both had the same issue. After a restore I am just re-directed back to onboarding. If I create a user I can login but only the add-ons are there. I also tried to to make a new backup which made no difference. It is the same HASSOS version. I am going to try an older backup to see what happens. Very frustrating!

Thanks. A persistent log is also kept at /var/log/journal. I copied it to my local machine and could view it with journalctl as I mentioned in the post. There is nothing suspicious there before the crash.

Are you sure that’s the home assistant log and not the VM log?

Yep, just compared and it is the same log.