Nextcloud has filled the database SD card 100%

Hello all masterminds out there!
I really need your support…

First of all; My english is not great, I know, but I’ll try using everything I’ve learned from school :wink:

Ok, so I have been running Nextcloud in Docker on an Openmediavault platform for almost 1 year. Since day one, Nextcloud has worked flawless. I am using a single board computer which is connected to a SATA-bay via USB, and I have done all upgrades as they came. Today, I am running version 18.x.x.x of Nextcloud.

The problem
A couple of days ago, I lost normal access to Nextcloud from my browser. When trying to connect from browser, I get the following message:
`Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.`
The desktop client on my Windows laptop is connected to the server, but can not sync (the icon is red, not green as usual) - “unknown error”.

After some troubleshooting yesterday, I found that the SD card containing AppData is completely full (the error.log told me). Further research showed that Nextclouds database has taken approximately 18GB of the SD card 32GB* avaliable storage. This folder is also the largest one on the memory card.

Additional information

  • I was using Techno Dad Life’s videos when first installing Nextcloud.
  • I am using MaraDB as database.
  • I am able to connect to the server via SSH.
  • There are less than 1TB of data in the data folder.
  • We are four (4) users using the instance at daily basis.
  • The folder which is 18GB is this one: \Nextclouddb\log\mysql
  • This folder is having 182 files named “mariadb-bin.000253” “mariadb-bin.000254” “mariadb-bin.0002535” and so on.
  • Each file is around 100MB.

So, what can I do to get my instance up running again? Is it possible to shrink the database?

If you’ll need any more details, let me know! :slight_smile:

Perhaps you can purge MariaDB-logs from shell

After fixing the immediate problem, I would recomment moving as much as possible to your SATA storage: logs, database, … not only to avoid future problems of this type but to preclude an even more catastrophic event:

SD cards are not exactly known for their durability and they don’t cope well with many write instructions. This is especially problematic for server log files, database files as well as temporary files. If your SD card with the database gives up you will spend some time getting everything up and running again from your latest backup…

Thanks for helping!

I tried this today, but I am unable to connect to the local MySQL server.

From terminal, logged in as an user with sudo privileges, this is what I am trying to do:

$ sudo docker exec -it nextclouddb bash
root@3a015fd1cf70: mysql -u admin -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Am I doing it wrong? Should I really bash into Nextclouds database?

You are right. Maybe I will move every Docker config files to my HDDs. I wanted to use a memory card for this because my HDDs would have to spin up x times a day updating a log file.
Is there any guides moving such Docker config files/application data to another directory? From Portainer maybe?