hassio-google-drive-backup icon indicating copy to clipboard operation
hassio-google-drive-backup copied to clipboard

HA OS freeze during backup Full and Partial

Open RamiRihawi opened this issue 2 years ago • 1 comments

My setup is freezing whenever the add on trigger automatic backup or when i manually trigger it myself. The freezing issue does not occur immediately, after about two hours from starting the backup process. I thought that might be due to the large size of media folder so i excluded it from backup yet the issue still exist. I also stopped some of the CPU intensive other add-ons like Frigate but the same problem.

The HA would not start again until power cycle the System.

My setup:

Raspberry pi 4, 4GB HA OS 512GB SSD drive over USB 3

RamiRihawi avatar Sep 08 '22 19:09 RamiRihawi

To provide some context know that this add-on doesn't actually create backups, it just asks Home Assistant to create them. If something is locking up during a backup its almost certainly because of how Home Assistant (the "supervisor" specifically) is creating the backup. Some addons additionally can cause periodic problems during a backup because Home Assistant needs to pause them while their files are read and compressed, such as with the MariaDB addon.

So there a couple potential causes:

  • Even without the /media folder your backups may still be very large, for example if you have a large sensor history database in the /config folder or in the MariaDB addon. A common problem is for some folder or addon to suddenly get large and then backups either take a long time or run out of disk space while trying to take the backup. One time on my personal HA instance the sensor database randomly exploded to 100 GB and even compressed it ate up the entire hard drive and caused the system to fail miserably, HA will happily exhaust all available disk space and render itself unable to run if you ask it to make a huge backup. Figuring out if this is your problem can be tricky because HA doesn't give you tools to see how much space a given folder or addon is using, but here are a couple tips:
    • You can create partial backups of just one thing at a time in the Home Assistant web-ui (Settings > Backups). That can help you narrow it down, though it is quite tedious.
    • You can monitor free disk space in Home Assistant using the System Monitor integration.
  • Creating a backup is very CPU and disk intense, and the rpi doesn't have a lot of power to spare. Some loss of performance is expected during a backup but I have also seen a system appear to be completely unresponsive during a backup. You can use the Glances addon to get an idea of whats eating up CPU during a backup, its in the Community Addon store and shows which processes are using CPU over a web-ui.
  • If you're able to let a backup finish, eg your aren't running out of disk space and the backup actually just takes a long time because its big, then you should be able to see which part is taking a long time by looking at the backup's details.
  • If none of that works, there might be something going wrong while the backup is being taken. The most likely places to find clues for what that is are in the supervisor logs (recall that the supervisor is what actually creates the backup). You can get the logs in a few different ways:
    • If the web-ui is still accessible, you can see them at Settings > System> Logs> Supervisor (top right drop-down menu). Please ensure you have "Advanced Mode" turned on in your Home Assistant user profile to make the logs accessible.
    • If the web-ui is unavailable, you can either:
      • Connect a monitor and keyboard to the raspberry pi, and run the command supervisor logs from the command line there.
      • Install the community SSH addon, connect to your Home Assistant machine over ssh (use putty or a similar terminal application) and run the command ha supervisor logs

sabeechen avatar Sep 09 '22 16:09 sabeechen

My setup is freezing whenever the add on trigger automatic backup or when i manually trigger it myself. The freezing issue does not occur immediately, after about two hours from starting the backup process. I thought that might be due to the large size of media folder so i excluded it from backup yet the issue still exist. I also stopped some of the CPU intensive other add-ons like Frigate but the same problem.

The HA would not start again until power cycle the System.

My setup:

Raspberry pi 4, 4GB HA OS 512GB SSD drive over USB 3

I've been having this exact issue over the last 2 weeks. The only way to get it (rpi and HA) working is unfortunately pulling the plug. I disabled the plugin this morning and waiting to see if that fixed it. My system would freeze within a few hours of restarting host. And my full back up is 1500MB. I have 64GB of free space. And none of the logs for the addon survive a reboot, so I can't actually see what's going wrong.

bencollinz avatar Oct 27 '22 16:10 bencollinz

If the system freezes within a few hours with the addon disabled, do you still suspect something is wrong with this addon?

Its difficult to think of something I can do with the information I have about this, as were not even sure if the addon is causing the problem. Getting the logs out of a non-responsive HA install is difficult, were you able to have any luck with the ssh addon? I've also seen some have luck persisting their logs using shell command actions.

sabeechen avatar Nov 04 '22 01:11 sabeechen

Mine's been running rock solid since disabling the addon a week ago. I just went with a different solution for my needs. Good luck, OP.

bencollinz avatar Nov 04 '22 01:11 bencollinz

I'm going to close this issue for now, but if you think there is something else I can help with please reopen and let me know.

sabeechen avatar Mar 24 '23 16:03 sabeechen