The nextcloud snap renders its own update impossible, because the MySQL database fills all available disk space.
Recently, I wondered, why my nextcloud snap does not update to the recent version. It turned out that snapd tried to do the update but failed. Investigation of the problem showed, that snapd always keeps the last three versions of the snap on disk (including the data below /var/snap/…). During update of the snap the contents of the current directory get copied (I saw the “cp” command running in top).
The mysql database of my nextcloud snap is 19GB. It turned out that on my root partition there was only 2,2 GB of empty space.
The solution seemed clear: extend root partition to have at least 19GB of free space, so that the snap could be copied during update. That’s what I did. I shrank “/home” and increased “/” to have about 30GB of free space. The snap successfully upgraded to the last version after that.
All well? Well, not. After the update I saw “mysqld” running wild on my disk. The process ran for about two days, then stopped and guess what now? There’s again only 2,2 GB of free space on my root partition. The database filled up all of the disk space I added! Since there’s now only 2,2 GB of space, the next update of the nextcloud snap will inevitably fail again, and there’s nothing I can do. I can’t add disk space with each update.
This seems like a serious problem with the nextcloud snap.
How can I change the MySQL config to not eat up all disk space??