I am running Nextcloud on Debian 11. Recently, I tried upgrading using php-updater, and afterwards MariaDB stopped working properly.
System details:
Debian 11
MariaDB 11.3.2
Apache with mpm_prefork (no php-fpm)
Nextcloud data in /var/www/owncloud/ (I am in the middle of a migration. Owncloud to Nextcloud worked so far, however, I wanted to use the php-updater script for the following Nextcloud upgrades)
Database: owncloud (visible via SHOW DATABASES; when MariaDB works)
What happened:
Right before this issue happened, I used php-updater. It said
It looks like both the 'Apache 2.0 Handler SAPI' libapache2-mod-php7.4 and the 'FastCGI Process Manager SAPI' php7.4-fpm are connected to it. This is a serious misconfiguration which must be fixed.
I: The Apache2 server has loaded the 'prefork' multi-processing module required by the Apache 2.0 Handler SAPI
and the 'event' module, which is required for operation with php-fpm, is not loaded.
I used the option disconnect apache2 from php*-fpm, without changing the loaded modules.
, MariaDB takes minutes to stop/start, or fails to start.
Log shows:
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
- My
/var/lib/mysql/currently contains:
ibdata1.bak (618M)
ibtmp1
undo001, undo002, undo003
(no ib_logfile0 / ib_logfile1 present anymore)
- I tried adding a low-memory config (
60-lowmem.cnf):
[mysqld]
innodb_force_recovery=6
innodb_buffer_pool_size = 16M
innodb_log_file_size = 16M
innodb_log_buffer_size = 8M
max_connections = 10
table_open_cache = 100
tmp_table_size = 8M
max_heap_table_size = 8M
skip-name-resolve
- With
innodb_force_recovery=6, MariaDB briefly started once, but after restoring configs, it fails again.
What I tried so far
- Restored
ibdata1fromibdata1.bak - Tried creating fresh empty
ib_logfile0/ib_logfile1(owned bymysql:mysql) - Adjusted permissions for all
/var/lib/mysql/* - Tried different
innodb_force_recoverylevels (1–6)
Current state
- MariaDB always fails with
Unknown/unsupported storage engine: InnoDB. - I cannot get it to start reliably, even in recovery mode.
- Nextcloud is down because the database is inaccessible.
My questions
- How can I force MariaDB to accept the existing
ibdata1.bak(InnoDB system tablespace)? - Is there a safe way to recreate the missing
ib_logfile*files so MariaDB will start? - If recovery is impossible, what’s the recommended way to salvage data from
ibdata1.bakand the/var/lib/mysql/owncloud/directory? I also have some backup data - at least before the Nextcloud migration, the relevant directories and a database backup were done. After the migration I backed up the data directory and once the database, when I once was able to restart the maria database.
Any hints or experience with recovering MariaDB after missing/corrupted InnoDB logs would be very much appreciated.