Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mariadb Logs füllen plötzlich Cache Disk

Featured Replies

Hi zusammen, 

 

seit kurzem müllt MariaDB meine Cache Disk mit Logs zu. Aktuell ist der log Folder 228GB groß. 

 

root@Tower:~# du -sh /mnt/user/appdata/mariadb/*
4.0K    /mnt/user/appdata/mariadb/custom.cnf
136G    /mnt/user/appdata/mariadb/databases
228G    /mnt/user/appdata/mariadb/log

 

Hier ist noch die custom.cnf

## custom configuration file, please be aware that changing options here may break things

[mysqld_safe]
nice		= 0

[mysqld]
character-set-server	= utf8
max_connections		= 100
connect_timeout		= 5
wait_timeout		= 600
max_allowed_packet	= 16M
thread_cache_size       = 128
sort_buffer_size	= 4M
bulk_insert_buffer_size	= 16M
tmp_table_size		= 32M
max_heap_table_size	= 32M
binlog_format=mixed
log_error = /config/log/mysql/mariadb-error.log
#
# * MyISAM
#
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched. On error, make copy and try a repair.
myisam_recover_options = BACKUP
key_buffer_size		= 128M
#open-files-limit	= 2000
table_open_cache	= 400
myisam_sort_buffer_size	= 512M
concurrent_insert	= 2
read_buffer_size	= 2M
read_rnd_buffer_size	= 1M
#
# * Query Cache Configuration
#
# Cache only tiny result sets, so we can fit more in the query cache.
query_cache_limit		= 128K
query_cache_size		= 64M
# for more write intensive setups, set to DEMAND or OFF
#query_cache_type		= DEMAND
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /config/log/mysql/mysql.log
#general_log             = 1
#
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
#
# we do want to know about network errors and such
log_warnings		= 2
#
# Enable the slow query log to see queries with especially long duration
#slow_query_log[={0|1}]
slow_query_log_file	= /config/log/mysql/mariadb-slow.log
long_query_time = 10
#log_slow_rate_limit	= 1000
log_slow_verbosity	= query_plan

#log-queries-not-using-indexes
#log_slow_admin_statements
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id		= 1
#report_host		= master1
#auto_increment_increment = 2
#auto_increment_offset	= 1
log_bin			= /config/log/mysql/mariadb-bin
log_bin_index		= /config/log/mysql/mariadb-bin.index
# not fab for performance, but safer
#sync_binlog		= 1
expire_logs_days	= 10
max_binlog_size         = 100M
# slaves
#relay_log		= /config/log/mysql/relay-bin
#relay_log_index	= /config/log/mysql/relay-bin.index
#relay_log_info_file	= /config/log/mysql/relay-bin.info
#log_slave_updates
#read_only
#
# If applications support it, this stricter sql_mode prevents some
# mistakes like inserting invalid dates etc.
#sql_mode		= NO_ENGINE_SUBSTITUTION,TRADITIONAL
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
default_storage_engine	= InnoDB
# you can't just change log file size, requires special procedure
#innodb_log_file_size	= 50M
innodb_buffer_pool_size	= 256M
innodb_log_buffer_size	= 8M
innodb_file_per_table	= 1
innodb_open_files	= 400
innodb_io_capacity	= 400
innodb_flush_method	= O_DIRECT
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0

[mysqldump]
quick
quote-names
max_allowed_packet	= 16M

[mysql]
#no-auto-rehash	# faster start of mysql but no tab completion

[isamchk]
key_buffer_size		= 16M

 

───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    99
User GID:    100
───────────────────────────────────────
Linuxserver.io version: 11.4.4-r1-ls171
Build-date: 2025-01-22T17:54:07+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
250124 04:42:50 mysqld_safe Logging to '/config/log/mysql/mariadb-error.log'.
250124 04:42:50 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Logrotate is enabled
[ls.io-init] done.

 

Hat jemand eine Idee, woran das liegen und wie ich das stoppen kann? Nutze mariadb in Verbindung mit Nextcloud. 

 

Kann ich alte Logs einfach löschen? 

 

Freue mich über Hilfe. Danke!! 

Solved by unn4m3d

21 minutes ago, unn4m3d said:

Hat jemand eine Idee, woran das liegen und wie ich das stoppen kann? Nutze mariadb in Verbindung mit Nextcloud. 

 

dazu würde ich mal schauen was NC so treibt ... muss ja einiges los sein bei dir ;)

 

200 GB+ an logs ... 

 

Nextcloud, Homeassistent, guacamole, Kodi ... in einer mariadb docker session

 

root@AlsServerII:~# du -sh /mnt/user/appdata/mariadb/*
4.0K    /mnt/user/appdata/mariadb/custom.cnf
7.9G    /mnt/user/appdata/mariadb/databases
0       /mnt/user/appdata/mariadb/event
167M    /mnt/user/appdata/mariadb/log
24K     /mnt/user/appdata/mariadb/mysql-schema
8.0K    /mnt/user/appdata/mariadb/supervise
root@AlsServerII:~#

 

  • Author

Es liegt wirklich an Nextcloud. 

 

Hier aus dem Docker Log von Nextcloud. 

 

Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused in /app/www/public/lib/private/DB/Connection.php:233
Stack trace:
#0 /app/www/public/3rdparty/doctrine/dbal/src/Connection.php(453): OC\DB\Connection->connect()
#1 /app/www/public/3rdparty/doctrine/dbal/src/Connection.php(411): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /app/www/public/3rdparty/doctrine/dbal/src/Connection.php(318): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /app/www/public/lib/private/DB/Connection.php(899): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /app/www/public/lib/private/DB/ConnectionAdapter.php(235): OC\DB\Connection->getDatabaseProvider()
#5 /app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php(96): OC\DB\ConnectionAdapter->getDatabaseProvider()
#6 /app/www/public/lib/private/AppConfig.php(1211): OC\DB\QueryBuilder\QueryBuilder->expr()
#7 /app/www/public/lib/private/AppConfig.php(237): OC\AppConfig->loadConfig()
#8 /app/www/public/lib/private/AppConfig.php(1351): OC\AppConfig->searchValues()
#9 /app/www/public/lib/private/App/AppManager.php(126): OC\AppConfig->getValues()
#10 /app/www/public/lib/private/App/AppManager.php(147): OC\App\AppManager->getInstalledAppsValues()
#11 /app/www/public/lib/private/legacy/OC_App.php(191): OC\App\AppManager->getInstalledApps()
#12 /app/www/public/lib/private/AppFramework/Bootstrap/Coordinator.php(48): OC_App::getEnabledApps()
#13 /app/www/public/lib/base.php(659): OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration()
#14 /app/www/public/lib/base.php(1134): OC::init()
#15 /app/www/public/cron.php(24): require_once('...')
#16 {main}

 

Hat einer eine Idee was ich checken kann? Scheint ja so, als wenn er sich nicht zur MariaDB verbinden kann. 

  • Author

Es lag wohl am daran, dass ich für SWAG mal ein eigenes Subnet eingerichtet hatte. Bin von SWAG auf NGINX Proxy Manager gewechselt vor kurzem. 

 

MariaDB und NC liefen nicht beide im Bridge Mode. Das habe ich jetzt korrigiert. Vielleicht war es das schon!

Edited by unn4m3d
verschrieben

  • Author

Puh, leider war es das doch noch nicht. 

 

Die Logs wachsen weiter fleißig. Das hier ist der Nextcloud Log:

 

Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2006] MySQL server has gone away in /app/www/public/lib/private/DB/Connection.php:233
Stack trace:
#0 /app/www/public/3rdparty/doctrine/dbal/src/Connection.php(453): OC\DB\Connection->connect()
#1 /app/www/public/3rdparty/doctrine/dbal/src/Connection.php(411): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /app/www/public/3rdparty/doctrine/dbal/src/Connection.php(318): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /app/www/public/lib/private/DB/Connection.php(899): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /app/www/public/lib/private/DB/ConnectionAdapter.php(235): OC\DB\Connection->getDatabaseProvider()
#5 /app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php(96): OC\DB\ConnectionAdapter->getDatabaseProvider()
#6 /app/www/public/lib/private/AppConfig.php(1211): OC\DB\QueryBuilder\QueryBuilder->expr()
#7 /app/www/public/lib/private/AppConfig.php(237): OC\AppConfig->loadConfig()
#8 /app/www/public/lib/private/AppConfig.php(1351): OC\AppConfig->searchValues()
#9 /app/www/public/lib/private/App/AppManager.php(126): OC\AppConfig->getValues()
#10 /app/www/public/lib/private/App/AppManager.php(147): OC\App\AppManager->getInstalledAppsValues()
#11 /app/www/public/lib/private/legacy/OC_App.php(191): OC\App\AppManager->getInstalledApps()
#12 /app/www/public/lib/private/AppFramework/Bootstrap/Coordinator.php(48): OC_App::getEnabledApps()
#13 /app/www/public/lib/base.php(659): OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration()
#14 /app/www/public/lib/base.php(1134): OC::init()
#15 /app/www/public/cron.php(24): require_once('...')
#16 {main}

 

Hier mal der aktuelle MariaDB Log. 

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    99
User GID:    100
───────────────────────────────────────
Linuxserver.io version: 11.4.4-r1-ls171
Build-date: 2025-01-22T17:54:07+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
250126 05:33:38 mysqld_safe Logging to '/config/log/mysql/mariadb-error.log'.
250126 05:33:38 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Logrotate is enabled
[ls.io-init] done.

 

Nextcloud ist Responsive übers WebUI und scheinbar normal benutzbar. Wie kann ich checken ob er richtig mit der DB verbunden ist? 

20 hours ago, unn4m3d said:

Puh, leider war es das doch noch nicht. 

 

eher nicht, wenn NC eingerichtet ist über sql verbunden zu sein, dann geht auch NC nicht wenn keine Verbindung da wäre

 

ich würde mal eher wie folgt ansetzen, schau mal im entsprechenden database Ordner von Nextcloud was da sehr groß ist

 

image.png.7911f9e90b500fbd8c2095ac54c86162.png

 

da sieht man hier das bei mir sogar der Großteil von memories kommt ... (Bilder addon mit Erkennung usw ...)

 

und was auch immer bei dir da steht, würde ich mal bei Nextcloud suchen warum hier ggf. extrem viel logging pasiert (und auch sehr große Datenbanken produziert).

  • Author

Bei mir ist es oc_filecache.ibd die unfassbar groß ist. 

 

Muss ich mich mal einlesen woher das kommen mag.. 

@unn4m3dDas ist bei mir auch so.

Meine ist derzeit bei über 12GB. Das empfinde ich für meine kleine Instanz schon eindeutig zu viel. Gerade einmal 5 Nutzer greifen darauf zu.

Diese Datei enthält aber nicht die logs, sondern all die nötigen Metadaten deiner Dateien in der Nextcloud. 

 

Schau doch mal in den Log Ordner selber rein, und was dort in den jeweiligen Logs steht. Da sollte noch mehr zu erfahren sein was das Problem ist.

 

Wie alt sind denn die Logs nun? Über 10 Tage oder doch jünger? 

  • Author

Die Logs fangen an am 10.01. und werden auch nicht gelöscht, heißt die vom 10.01. sind noch im Logfolder in der MariaDB. 

 

Bin weiterhin ratlos. 

  • Author

Ich habe das Thema ein bisschen weiter eingrezen können. Ich hatte per NC einen SFTP Share auf das System gesetzt. Den habe ich rausgenommen. Dennoch blieb die oc_filecache so groß. 

 

Ein

ALTER TABLE oc_filecache FORCE;
führte zu folgendem Output. 

 

MariaDB [nextcloud]> ALTER TABLE oc_filecache FORCE;
ERROR 1878 (HY000): Temporary file write failure

 

Daraufhin half dann nur noch TRUNCATE TABLE oc_filecache;
 

MariaDB [nextcloud]> TRUNCATE TABLE oc_filecache;
Query OK, 0 rows affected (0.097 sec)

 

NC baut die DB gerade wieder auf. Ich bin erstmal zuversichtlich das Problem eingegrenzt zu haben. Aber abwarten.

  • Author

Habe jetzt in MariaDB mit 

RESET MASTER; 

 

alle Binary Logs gelöscht. Jetzt ist zumindest der Diskspace wieder frei. Mal gucken, wie sich MariaDB jetzt verhält. 

  • Author
  • Solution

Scheint damit gelöst zu sein, falls mal jemand das selbe Problem hat - geht gern die Schritte durch. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.