Home Assistant crashes every Sunday night on a Raspberry Pi

Hello all,

I have Home Assistant (Supervisor: 2023.8.4 - Operating System: 10.5 - Frontend 20230802.1) installed on a Raspberry Pi 3B. An SD card with 32 GB capacity is used. I use the original Raspberry power supply. Furthermore, the Raspberry is connected to the network via an Ethernet cable. It gets a fixed IP address from the router (Fritzbox 7590). I use the KNX integration and the Studio Code Server add-on. I have written a yaml file which contains various buttons to control my KNX installation. Except for these things, nothing is added to the Home Assistant installation.

I now have the following problem: Every night from Sunday to Monday something happens so that Home Assistant is no longer accessible. Neither via the Android app nor via http://homeassistant.local:8123 in the browser can Home Assistant be reached. In addition, the LEDs of the Ethernet socket on the Raspberry Pi no longer light up and it also no longer appears in the network overview of the router (Fritzbox). If I disconnect the power supply from the Raspberry and then reconnect it, Home Assistant is booting and gets assigned an IP address. I checked this with a monitor, which I connected directly to the Raspberry Pi. Nevertheless, Home Assistant is not accessible via the app or the browser. To solve this, I have always had to format the SD card and reinstall Home Assistant. This problem occurs since the first installation. I suspect that in the night from Sunday to Monday an update is installed by default, which seems to go wrong every time. But I can’t find anything about this. Can any of you help me? Thank you very much.

Recorder does a weekly maintenance activity on some Sunday. You may try to disable it.

Automatically repack the database every second Sunday after the auto purge. Without a repack, the database may not decrease in size even after purging, which takes up disk space and can make Home Assistant slow. If you disable auto_repack it is recommended that you create an automation to call the recorder.purge periodically. This flag has no effect if auto_purge is disabled.

The only thing that is auto-updating is Supervisor, and that does not happen every sunday. If you don’t need your code server, stop it, and only start it when needed. It is a memory hog, and the 3b only has 1 Gb. Maybe this will help, maybe not.

Hello fuatakgun,

thank you very much. I have now disbaled the automatic repacking by disabling the automatic purge. For this I wrote the following in the configuration.yaml:

  auto_purge: false

we will see what will happen this night.

Hello francisp,

thank you very much for your idea. I have now stopped Studio Code Server and will see if it helped.

Fingers crossed, waiting for good news

Strange… It’s a Bank Holiday in the UK this weekend so this might not happen until Monday night :wink: - if you are UK based.

No, actually i am in Germany. But since i am on vaccation, tomorrow is also somehow a holidy for me.

Unfortunately, the Raspberry became inaccessible again last night. The event must have happened between 3:00 and 5:00. Now Home Assistant is unreachable again even after a restart. Is there a way to view the system logs of the last hours via a connected monitor and keyboard?

Logs are in /data. First see if you actually see something on the monitor, or if HA is totally crashed.

If so, you can take the card out and insert into a computer. If you have a Linux computer, you can read immediately, if a Windows computer, you need the free Linux Reader

Thank you. I connected the monitor and the Raspberry is in an infinite booting sequence. I just installed the program but it is not running. Windows ask me how to open it. Very strange… I also used an other program to read data from the SD card but it cant find anything. Maybe the content of the card is totaly crashed.

To work around the problem, I will turn off the power supply from Raspberry Pi on Mondays between 3 and 5 with a time-controlled KNX switching actuator.

This is of course botched and not a satisfactory solution. Therefore, any other ideas what could be the cause of the described problem?

Have you tried to use a different (new) SD card? Or better yet, a SSD.

Router reboots weekly?

Not yet. I will try an new one. Thank you.

No. But it installs updates, if available, at 4:00. But according to the event logs of the router, the last update was installed in july. This was before i startet with home assistant. But i changed the time to 9:00 just to see, if there is any effect.


I have been using another SD card (also 32 GB) for almost 4 weeks now. During this time, there have been no more crashes of Home Assistant or the Raspberry Pi. After about 2 weeks, I inserted the old SD card into the Raspberry as a test. Immediately after booting, Home Assistant was accessible via the app and the browser. Shortly afterwards (approx. 30 minutes), the problem described occurred, Home Assistant was not available. I suspect that an update or something similar was carried out after switching on, which is normally done on Mondays at 4:00 am. Because of the long time of 2 weeks, it was probably done directly after booting. In any case, it really seems to have been the SD card itself, although I don’t understand why. Thank you very much for your support!

1 Like